Connect to data sources on premises from logic apps with on-premises data gateway

To access data sources on premises from your logic apps, set up an on-premises data gateway that logic apps can use with supported connectors. The gateway acts as a bridge that provides quick data transfer and encryption between data sources on premises and your logic apps. The gateway relays data from on-premises sources on encrypted channels through the Azure Service Bus. All traffic originates as secure outbound traffic from the gateway agent. Learn more about how the data gateway works.

The gateway supports connections to these data sources on premises:

  • BizTalk Server 2016
  • DB2
  • File System
  • Informix
  • MQ
  • MySQL
  • Oracle Database
  • PostgreSQL
  • SAP Application Server
  • SAP Message Server
  • SharePoint
  • SQL Server
  • Teradata

These steps show how to set up the on-premises data gateway to work with your logic apps. For more information about supported connectors, see Connectors for Azure Logic Apps.

For information about how to use the gateway with other services, see these articles:


  • You must have already installed the data gateway on a local computer.

  • When you sign in to the Azure portal, you have to use the same work or school account that was used to install the on-premises data gateway. Your sign-in account must also have an Azure subscription to use when you create a gateway resource in the Azure portal for your gateway installation.

  • Your gateway installation can't already be claimed by an Azure gateway resource. You can associate your gateway installation to only one Azure gateway resource. Claim happens when you create the gateway resource so that the installation is unavailable for other resources.

  • The on-premises data gateway runs as a Windows service and is set up to use NT SERVICE\PBIEgwService for the Windows service logon credentials. To create and maintain the gateway resource in the Azure portal, the Windows service account must have at least Contributor permissions.


    The Windows service account differs from the account used for connecting to on-premises data sources, and from the Azure work or school account used to sign in to cloud services.

Install the on-premises data gateway

If you haven't already, follow the steps to install the on-premises data gateway. Before you continue with the other steps, make sure that you installed the data gateway on a local computer.

Create an Azure resource for the on-premises data gateway

After you install the gateway on a local computer, you must create your data gateway as a resource in Azure. This step also associates your gateway resource with your Azure subscription.

  1. Sign in to the Azure portal. Make sure to use the same Azure work or school email address used to install the gateway.

  2. On the main Azure menu, choose Create a resource > Enterprise Integration > On-premises data gateway.

    Find "On-premises data gateway"

  3. On the Create connection gateway page, provide these details to create your data gateway resource:

    • Name: Enter a name for your gateway resource.

    • Subscription: Select the Azure subscription to associate with your gateway resource. This subscription should be the same subscription as your logic app.

      The default subscription is based on the Azure account that you used to sign in.

    • Resource group: Create a resource group or select an existing resource group for deploying your gateway resource. Resource groups help you manage related Azure assets as a collection.

    • Location: Azure restricts this location to the same region that was selected for the gateway cloud service during gateway installation.


      Make sure that the gateway resource location matches the gateway cloud service location. Otherwise, your gateway installation might not appear in the installed gateways list for you to select in the next step.

      You can use different regions for your gateway resource and for your logic app.

    • Installation Name: If your gateway installation isn't already selected, select the gateway that you previously installed.

      To add the gateway resource to your Azure dashboard, choose Pin to dashboard. When you're done, choose Create.

      For example:

      Provide details to create your on-premises data gateway

      To find or view your data gateway at any time, from the main Azure menu, choose All services. In the search box, enter "on-premises data gateways", then choose On-premises Data Gateways.

      Find "On-premises Data Gateways"

Connect your logic app to the on-premises data gateway

Now that you've created your data gateway resource and associated your Azure subscription with that resource, create a connection between your logic app and the data gateway.


Your gateway connection location must exist in the same region as your logic app, but you can use a data gateway that exists in a different region.

  1. In the Azure portal, create or open your logic app in Logic App Designer.

  2. Add a connector that supports on-premises connections, like SQL Server.

  3. Following the order shown, select Connect via on-premises data gateway, provide a unique connection name and the required information, and select the data gateway resource that you want to use. When you're done, choose Create.


    A unique connection name helps you easily identify that connection later, especially when you create multiple connections. If applicable, also include the qualified domain for your username.

    Create connection between logic app and data gateway

Congratulations, your gateway connection is now ready for your logic app to use.

Edit your gateway connection settings

After you create a gateway connection for your logic app, you might want to later update the settings for that specific connection.

  1. To find the gateway connection:

    • On the logic app menu, under Development Tools, select API Connections.

      The API Connections pane shows all API connections associated with your logic app, including gateway connections.

      Go to your logic app, select "API Connections"

    • Or, from the main Azure menu, go to More Services > Web + Mobile > API Connections for all API connections, including gateway connections, that are associated with your Azure subscription.

    • Or, on the main Azure menu, go to All resources for all API connections, including gateway connections, that are associated with your Azure subscription.

  2. Select the gateway connection that you want to view or edit, and choose Edit API connection.


    If your updates don't take effect, try stopping and restarting the gateway Windows service.

Switch or delete your on-premises data gateway resource

To create a different gateway resource, associate your gateway with a different resource, or remove the gateway resource, you can delete the gateway resource without affecting the gateway installation.

  1. From the main Azure menu, go to All resources.
  2. Find and select your data gateway resource.
  3. Choose On-premises Data Gateway, and on the resource toolbar, choose Delete.

Frequently asked questions

Q: Why did the location for my existing gateway change?
A: Gateway resources created before May 3, 2017 were moved to the original locations of the Azure AD tenant for the work or school account that created those gateways. However, these changes shouldn't affect currently running logic apps, which should continue working as usual. With the gateway's general availability in May, gateway resource locations can differ from logic app locations.

Next steps