Connect to on-premises data sources from Azure Logic Apps

To access data sources on premises from your logic apps, create an on-premises data gateway resource in the Azure portal. Your logic apps can then use the on-premises connectors. This article shows how to create your Azure gateway resource after you download and install the gateway on your local computer.


To connect to Azure virtual networks, consider creating an integration service environment instead.

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


  • You've already downloaded and installed the data gateway on a local computer.

  • Your gateway installation isn't already associated with a gateway resource in Azure. You can link your gateway installation only to one gateway resource, which happens when you create the gateway resource and select your gateway installation. This linking makes the gateway installation unavailable for other resources.

  • When you sign in to the Azure portal and create the gateway resource, make sure you use the same sign-in account that was previously used to install the on-premises data gateway along with the same Azure subscription that was used to install the gateway. If you don't have an Azure subscription yet, sign up for a free Azure account.

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


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

Download and install gateway

Before you can continue with the steps in this article, make sure your gateway is already installed on a local computer. If you haven't already, follow the steps to download and install the on-premises data gateway.

Create Azure resource for gateway

After you install the gateway on a local computer, you can then create an Azure resource for your gateway. This step also associates your gateway resource with your Azure subscription.

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

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

    Find "On-premises data gateway"

  3. On the Create connection gateway page, provide this information for your gateway resource:

    Property Description
    Name The name for your gateway resource
    Subscription Your Azure subscription's name, which should be the same subscription as your logic app. The default subscription is based on the Azure account you used to sign in.
    Resource group The name for the Azure resource group for organizing related resources
    Location Azure restricts this location to the same region that was selected for the gateway cloud service during gateway installation.

    Note: Make sure this 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.

    Here is an example:

    Provide details to create your on-premises data gateway

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

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

    Find "On-premises Data Gateways"

Connect to on-premises data

After you create your gateway resource and associate your Azure subscription with this resource, you can now create a connection between your logic app and your on-premises data source by using the gateway.

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

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

  3. Now set up your connection:

    1. Select Connect via on-premises data gateway.

    2. For Gateways, select the gateway resource you previously created.

      Although your gateway connection location must exist in the same region as your logic app, you can select a gateway in a different region.

    3. Provide a unique connection name and the other required information.

      The 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.

      Here is an example:

      Create connection between logic app and data gateway

    4. When you're done, choose Create.

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

Edit connection

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

  1. Find your gateway connection:

    • To find all API connections for just your logic app, on your logic app's menu, under Development Tools, select API Connections.

      Go to your logic app, select "API Connections"

    • To find all API connections associated with your Azure subscription:

      • From the main Azure menu, go to All services > Web > API Connections.
      • Or, from the main Azure menu, go to All resources.
  2. Select the gateway connection you want, and then choose Edit API connection.


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

Delete 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 gateway resource.

  3. If not already selected, on your gateway resource menu, select On-premises Data Gateway.

  4. 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.

Get support

Next steps