You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: 'Connect Azure Front Door Premium to an App Service (Web App or Function App) origin with Private Link'
2
+
title: Connect Azure Front Door to an App Service Origin
3
3
titleSuffix: Azure Private Link
4
4
description: Learn how to connect your Azure Front Door Premium to a web app or function app privately.
5
5
author: halkazwini
6
6
ms.author: halkazwini
7
7
ms.service: azure-frontdoor
8
8
ms.topic: how-to
9
-
ms.date: 11/15/2024
10
-
ms.custom:
11
-
- build-2025
9
+
ms.date: 07/31/2025
10
+
ms.custom:devx-track-azurecli, build-2025
11
+
zone_pivot_groups: front-door-dev-exp-portal-cli
12
12
---
13
13
14
14
# Connect Azure Front Door Premium to an App Service (Web App or Function App) origin with Private Link
@@ -19,29 +19,46 @@ This article guides you through configuring Azure Front Door Premium to connect
19
19
20
20
## Prerequisites
21
21
22
-
* An active Azure subscription. [Create a free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
22
+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
23
23
24
-
> [!NOTE]
25
-
> Private endpoints require your App Service plan to meet specific requirements. For more information, see [Using Private Endpoints for Azure Web App](../../app-service/networking/private-endpoint.md).
26
-
> This feature is not supported with App Service Slots.
24
+
::: zone pivot="front-door-portal"
25
+
26
+
- An Azure Front Door Premium profile with an origin group. For more information, see [Create an Azure Front Door](../create-front-door-portal.md).
27
+
28
+
- A Private Link. For more information, see [Create a Private Link service](../../private-link/create-private-link-service-portal.md).
29
+
30
+
- Sign in to the [Azure portal](https://portal.azure.com) with your Azure account.
31
+
32
+
::: zone-end
33
+
34
+
::: zone pivot="front-door-cli"
35
+
36
+
- An Azure Front Door Premium profile with an origin group. For more information, see [Create an Azure Front Door](../create-front-door-cli.md).
27
37
28
-
## Sign in to Azure
38
+
- A Private Link. For more information, see [Create a Private Link service](../../private-link/create-private-link-service-cli.md).
29
39
30
-
Sign in to the [Azure portal](https://portal.azure.com).
40
+
- Azure Cloud Shell or Azure CLI.
41
+
42
+
The steps in this article run the Azure CLI commands interactively in [Azure Cloud Shell](/azure/cloud-shell/overview). To run the commands in the Cloud Shell, select **Open Cloud Shell** at the upper-right corner of a code block. Select **Copy** to copy the code, and paste it into Cloud Shell to run it. You can also run the Cloud Shell from within the Azure portal.
43
+
44
+
You can also [install Azure CLI locally](/cli/azure/install-azure-cli) to run the commands. If you run Azure CLI locally, sign in to Azure using the [az login](/cli/azure/reference-index#az-login) command.
45
+
46
+
::: zone-end
47
+
48
+
> [!NOTE]
49
+
> Private endpoints require your App Service plan to meet specific requirements. For more information, see [Using Private Endpoints for Azure Web App](../../app-service/networking/private-endpoint.md). This feature isn't supported with App Service Slots.
31
50
32
51
## Enable Private Link to an App Service (Web App or Function App) in Azure Front Door Premium
33
52
53
+
::: zone pivot="front-door-portal"
54
+
34
55
In this section, you map the Private Link service to a private endpoint within Azure Front Door's private network.
35
56
36
57
1. In your Azure Front Door Premium profile, go to *Settings* and select **Origin groups**.
37
58
38
59
1. Choose the origin group that should contain the App Service (Web App or Function App) origin you want to enable Private Link for.
39
60
40
-
1. Select **+ Add an origin** to add a new origin or select an existing one from the list.
41
-
42
-
:::image type="content" source="../media/how-to-enable-private-link-app-service/private-endpoint-app-service.png" alt-text="Screenshot of enabling private link.":::
43
-
44
-
1. Use the following table to configure the settings for the origin:
61
+
1. Select **+ Add an origin** to add a new origin or select an existing one from the list. Use the following table to configure the settings for the origin:
45
62
46
63
| Setting | Value |
47
64
| ------- | ----- |
@@ -57,27 +74,76 @@ In this section, you map the Private Link service to a private endpoint within A
57
74
| Target sub resource | Choose *site* as the subresource type for the selected resource. |
58
75
| Request message | Enter a custom message to display while approving the Private Endpoint. |
59
76
77
+
:::image type="content" source="../media/how-to-enable-private-link-web-app/private-endpoint-app-service.png" alt-text="Screenshot of enabling private link.":::
78
+
60
79
1. Select **Add** to save your configuration, then select **Update** to save the origin group settings.
61
80
81
+
::: zone-end
82
+
83
+
::: zone pivot="front-door-cli"
84
+
85
+
Use the [az afd origin create](/cli/azure/afd/origin#az-afd-origin-create) command to create a new Azure Front Door origin. The `private-link-location` value must be from the [available regions](../private-link.md#region-availability) and the `private-link-sub-resource-type` value is **sites**.
86
+
87
+
```azurecli-interactive
88
+
az afd origin create --enabled-state Enabled \
89
+
--resource-group 'myResourceGroup' \
90
+
--origin-group-name 'og1' \
91
+
--origin-name 'myapporigin' \
92
+
--profile-name 'contosoAFD' \
93
+
--host-name 'example.contoso.com' \
94
+
--origin-host-header 'example.contoso.com' \
95
+
--http-port 80 \
96
+
--https-port 443 \
97
+
--priority 1 \
98
+
--weight 500 \
99
+
--enable-private-link true \
100
+
--private-link-location 'EastUS' \
101
+
--private-link-request-message 'AFD app service origin Private Link request.' \
## Approve Azure Front Door Premium private endpoint connection from App Service
63
109
110
+
::: zone pivot="front-door-portal"
111
+
64
112
1. Navigate to the App Service you configured with Private Link in the previous section. Under **Settings**, select **Networking**.
65
113
66
-
1. In the **Networking** section, select on **Configure your private endpoint connections**.
114
+
1. In the **Networking** section, select **Configure your private endpoint connections**.
67
115
68
-
:::image type="content" source="../media/how-to-enable-private-link-app-service/app-service-configure-endpoint.png" alt-text="Screenshot of networking settings in App Service.":::
116
+
:::image type="content" source="../media/how-to-enable-private-link-web-app/app-service-configure-endpoint.png" alt-text="Screenshot of networking settings in App Service.":::
69
117
70
118
1. Find the *pending* private endpoint request from Azure Front Door Premium and select **Approve**.
71
119
72
-
1. After approval, the connection status will update. It can take a few minutes for the connection to fully establish. Once established, you can access your web app or function app through Azure Front Door Premium. Direct access to the app from the public internet is disabled once private endpoint is enabled.
120
+
::: zone-end
73
121
74
-
## Common mistakes to avoid
122
+
::: zone pivot="front-door-cli"
123
+
124
+
1. Use the [az network private-endpoint-connection list](/cli/azure/network/private-endpoint-connection#az-network-private-endpoint-connection-list) command to list the private endpoint connections for your web app. Note the `Resource ID` of the private endpoint connection on the first line of the output.
75
125
76
-
The following are common mistakes when configuring an origin with Azure Private Link enabled:
126
+
```azurecli-interactive
127
+
az network private-endpoint-connection list --name 'webapp1' --resource-group 'myResourceGroup' --type 'Microsoft.Web/sites'
128
+
```
129
+
130
+
1. Use the [az network private-endpoint-connection approve](/cli/azure/network/private-endpoint-connection#az-network-private-endpoint-connection-approve) command to approve the private endpoint connection.
131
+
132
+
```azurecli-interactive
133
+
az network private-endpoint-connection approve --id '/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/webapp1/privateEndpointConnections/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e'
134
+
```
135
+
136
+
::: zone-end
137
+
138
+
It can take a few minutes for the connection to fully establish after approval. Once established, you can access your web app or function app through Azure Front Door Premium. Direct access to the app from the public internet is disabled once private endpoint is enabled.
139
+
140
+
## Common mistakes to avoid
77
141
78
-
* Adding the origin with Azure Private Link enabled to an existing origin group that contains public origins. Azure Front Door doesn't allow mixing public and private origins in the same origin group.
142
+
The following mistake is common when configuring an origin with Azure Private Link enabled:
79
143
144
+
- Adding the origin with Azure Private Link enabled to an existing origin group that contains public origins. Azure Front Door doesn't allow mixing public and private origins in the same origin group.
80
145
81
-
## Next steps
146
+
## Related content
82
147
83
-
Learn about [Private Link service with App service](../../app-service/networking/private-endpoint.md).
148
+
- [Connect Azure Front Door Premium to an Azure Application Gateway with Private Link](../how-to-enable-private-link-application-gateway.md)
149
+
- [Use private endpoints for Azure App Service apps](../../app-service/networking/private-endpoint.md)
0 commit comments