web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Custom Connector using...
Power Automate
Answered

Custom Connector using Gateway, Multiple Servers

(1) ShareShare
ReportReport
Posted on by 248
I have a custom connector that I setup to talk to an API on prem through a Gateway. I now need it to work with additional servers. TEST Server and a PROD server. Is there really no way to make this work besides making a dedicated PROD and TEST version of the custom connector?
I have the same question (0)
  • Suggested answer
    Haque Profile Picture
    2,427 on at
    Hi @NickTT.
     
     
    To my best knowledge, in Power Automate custom connectors using an on-premises data gateway, there isn’t a built-in way to dynamically switch between multiple backend servers (like TEST and PROD) within a single connector instance. Typically, each custom connector is tied to a specific backend URL configured during its setup.
     
    We have some limited alternatives for the same:
     
    Option-1: Create Separate Custom Connectors for Each Environment: This is the most straightforward and common approach. You create one connector configured for the TEST server and another for the PROD server. Then, in your flows, you choose which connector to use based on the environment.
     
    Option-2: Use Environment Variables or Parameters in the Connector (Limited): While custom connectors support parameters, the base URL is usually fixed and cannot be dynamically changed at runtime. Some users try to use parameters in the connector’s host URL, but this is not officially supported for switching environments dynamically.
     
    Option-3: Use Multiple Gateways or Gateway Clusters: You can configure multiple gateways pointing to different servers, but the connector still needs to be associated with a specific gateway and URL.
     
     
    Reference:
     
    1. https://learn.microsoft.com/en-us/connectors/custom-connectors/environment-variables
     
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Suggested answer
    NickTT Profile Picture
    248 on at
    I think I figured out my work around then. I have my Custom Connector in a Solution that I publish to each environment through Pipelines. I would default the connector to use the TEST server host name. Then when I get to the Production environment, modify that connector, creating a solution layer, that has the production server as the host name. That way I don't have to duplicate efforts and change my current workflows.
  • Verified answer
    Haque Profile Picture
    2,427 on at
     
    The solution based work around sounds good, just care should be taken when you move to prod, to "modify the connector" - a cutover task item that should be there to address it (in fact every time you do it).
     
    Thanks for sharing.
  • 11manish Profile Picture
    2,028 on at
    Your workaround using a solution layer override will work, but it is not recommended because it breaks ALM best practices, introduces hidden
     
    configuration, and can be overwritten during future deployments.
     
    The proper approach is to parameterize the connector and use environment variables to define the base URL per environment, ensuring
     
    consistent, maintainable, and pipeline-safe deployments.
  • NickTT Profile Picture
    248 on at
    @11manish except you can't for the base URL with custom connectors that connect through a Gateway. Custom connector wizard won't let you save the file. Even if you go in and change it on the swagger side. I had created an environment variable but the Custom Connector wizard wouldn't let me use it. Would give you an invalid host name error. Really annoying that we can't do this with a custom connector.

    If you are saying there is a way around this... please share the steps or URL to an example.
  • 11manish Profile Picture
    2,028 on at
    Correct , understand your points.
     
    When using a custom connector with an on-premises gateway, the base URL must be static and cannot be parameterized using environment
     
    variables or Swagger modifications.
     
    This is a platform limitation.
     
    The supported approaches are to use multiple connections (each mapped to different gateway data sources), implement a reverse proxy or
     
    unified endpoint to route traffic internally, or maintain separate connectors for each environment.
  • NickTT Profile Picture
    248 on at
    I wonder why the limitation. Security?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 875

#2
Valantis Profile Picture

Valantis 817

#3
Haque Profile Picture

Haque 481

Last 30 days Overall leaderboard