title | description | services | ms.suite | ms.reviewer | ms.topic | ms.date |
---|---|---|---|---|---|---|
Secure traffic between single-tenant workflows and virtual networks |
Secure traffic between Standard logic app workflows and virtual networks in Azure using private endpoints. |
logic-apps |
integration |
estfan, azla |
how-to |
03/11/2022 |
Secure traffic between single-tenant Standard logic apps and Azure virtual networks using private endpoints and VNet integration
To securely and privately communicate between your workflow in a Standard logic app and an Azure virtual network, you can set up private endpoints for inbound traffic and use VNet integration for outbound traffic.
A private endpoint is a network interface that privately and securely connects to a service powered by Azure Private Link. This service can be an Azure service such as Azure Logic Apps, Azure Storage, Azure Cosmos DB, SQL, or your own Private Link Service. The private endpoint uses a private IP address from your virtual network, which effectively brings the service into your virtual network.
This article shows how to set up access through private endpoints for inbound traffic and VNet integration for outbound traffic.
For more information, review the following documentation:
- What is Azure Private Endpoint? and Private endpoints - Integrate your app with an Azure virtual network
- What is Azure Private Link?
- What is Vnet integration?
You need to have a new or existing Azure virtual network that includes a subnet without any delegations. This subnet is used to deploy and allocate private IP addresses from the virtual network.
For more information, review the following documentation:
- Quickstart: Create a virtual network using the Azure portal
- What is subnet delegation?
- Add or remove a subnet delegation
To secure inbound traffic to your workflow, complete these high-level steps:
-
Start your workflow with a built-in trigger that can receive and handle inbound requests, such as the Request trigger or the HTTP + Webhook trigger. This trigger sets up your workflow with a callable endpoint.
-
Add a private endpoint for your logic app resource to your virtual network.
-
Make test calls to check access to the endpoint. To call your logic app workflow after you set up this endpoint, you must be connected to the virtual network.
In addition to the virtual network setup in the top-level prerequisites, you need to have a new or existing single-tenant based logic app workflow that starts with a built-in trigger that can receive requests.
For example, the Request trigger creates an endpoint on your workflow that can receive and handle inbound requests from other callers, including workflows. This endpoint provides a URL that you can use to call and trigger the workflow. For this example, the steps continue with the Request trigger.
For more information, review the following documentation:
- Create single-tenant logic app workflows in Azure Logic Apps
- Receive and respond to inbound HTTP requests using Azure Logic Apps
-
If you haven't already, create a single-tenant based logic app, and a blank workflow.
-
After the designer opens, add the Request trigger as the first step in your workflow.
-
Based on your scenario requirements, add other actions that you want to run in your workflow.
-
When you're done, save your workflow.
For more information, review Create single-tenant logic app workflows in Azure Logic Apps.
-
On the workflow menu, select Overview.
-
On the Overview page, copy and save the Workflow URL for later use.
To trigger the workflow, you call or send a request to this URL.
-
Make sure that the URL works by calling or sending a request to the URL. You can use any tool you want to send the request, for example, Postman.
-
On your logic app menu, under Settings, select Networking.
-
On the Networking page, on the Inbound traffic card, select Private endpoints.
-
On the Private Endpoint connections, select Add.
-
On the Add Private Endpoint pane that opens, provide the requested information about the endpoint.
For more information, review Private Endpoint properties.
-
After Azure successfully provisions the private endpoint, try again to call the workflow URL.
This time, you get an expected
403 Forbidden
error, which is means that the private endpoint is set up and works correctly. -
To make sure the connection is working correctly, create a virtual machine in the same virtual network that has the private endpoint, and try calling the logic app workflow.
-
If accessed from outside your virtual network, monitoring view can't access the inputs and outputs from triggers and actions.
-
Managed API webhook triggers (push triggers) and actions won't work because they run in the public cloud and can't call into your private network. They require a public endpoint to receive calls. For example, such triggers include the Dataverse trigger and the Event Grid trigger.
-
If you use the Office 365 Outlook trigger, the workflow is triggered only hourly.
-
Deployment from Visual Studio Code or Azure CLI works only from inside the virtual network. You can use the Deployment Center to link your logic app to a GitHub repo. You can then use Azure infrastructure to build and deploy your code.
For GitHub integration to work, remove the
WEBSITE_RUN_FROM_PACKAGE
setting from your logic app or set the value to0
. -
Enabling Private Link doesn't affect outbound traffic, which still flows through the App Service infrastructure.
To secure outbound traffic from your logic app, you can integrate your logic app with a virtual network. First, create and test an example workflow. You can then set up VNet integration.
Important
You can't change the subnet size after assignment, so use a subnet that's large enough to accommodate
the scale that your app might reach. To avoid any issues with subnet capacity, use a /26
subnet with 64 addresses.
If you create the subnet for virtual network integration with the Azure portal, you must use /27
as the minimum subnet size.
-
If you haven't already, in the Azure portal, create a single-tenant based logic app, and a blank workflow.
-
After the designer opens, add the Request trigger as the first step in your workflow.
-
Add an HTTP action to call an internal service that's unavailable through the Internet and runs with a private IP address such as
10.0.1.3
. -
When you're done, save your workflow.
-
From the designer, manually run the workflow.
The HTTP action fails, which is by design and expected because the workflow runs in the cloud and can't access your internal service.
-
In the Azure portal, on the logic app resource menu, under Settings, select Networking.
-
On the Networking pane, on the Outbound traffic card, select VNet integration.
-
On the VNet Integration pane, select Add Vnet.
-
On the Add VNet Integration pane, select the subscription and the virtual network that connects to your internal service.
-
If you use your own domain name server (DNS) with your virtual network, set your logic app resource's
WEBSITE_DNS_SERVER
app setting to the IP address for your DNS. If you have a secondary DNS, add another app setting namedWEBSITE_DNS_ALT_SERVER
, and set the value also to the IP for your DNS. -
After Azure successfully provisions the VNet integration, try to run the workflow again.
The HTTP action now runs successfully.
Important
For the Azure Logic Apps runtime to work, you need to have an uninterrupted connection to the backend storage. For Azure-hosted managed connectors to work, you need to have an uninterrupted connection to the managed API service. With VNet integration, you need to make sure no firewall or network security policy is blocking these connections.
Setting up virtual network integration affects only outbound traffic. To secure inbound traffic, which continues to use the App Service shared endpoint, review Set up inbound traffic through private endpoints.
For more information, review the following documentation: