Skip to content

Commit 8d09468

Browse files
Merge pull request #303722 from halkazwini/afd-app
Connect Azure Front Door Premium to an App Service
2 parents cc7ee4f + 0a1d58a commit 8d09468

File tree

7 files changed

+95
-106
lines changed

7 files changed

+95
-106
lines changed

articles/frontdoor/.openpublishing.redirection.frontdoor.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"redirections": [
3+
{
4+
"source_path_from_root": "/articles/frontdoor/standard-premium/how-to-enable-private-link-web-app-cli.md",
5+
"redirect_url": "/azure/frontdoor/standard-premium/how-to-enable-private-link-web-app",
6+
"redirect_document_id": false
7+
},
38
{
49
"source_path_from_root": "/articles/frontdoor/standard-premium/how-to-enable-private-link-storage-account-cli.md",
510
"redirect_url": "/azure/frontdoor/standard-premium/how-to-enable-private-link-storage-account",

articles/frontdoor/TOC.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,7 @@
120120
- name: Connect to Azure Storage static website
121121
href: how-to-enable-private-link-storage-static-website.md
122122
- name: Connect to Azure App Service
123-
items:
124-
- name: Azure portal
125-
href: standard-premium/how-to-enable-private-link-web-app.md
126-
- name: Azure CLI
127-
href: standard-premium/how-to-enable-private-link-web-app-cli.md
123+
href: standard-premium/how-to-enable-private-link-web-app.md
128124
- name: Connect to Azure Application Gateway
129125
href: how-to-enable-private-link-application-gateway.md
130126
- name: Connect to Azure API Management

articles/frontdoor/standard-premium/how-to-enable-private-link-web-app-cli.md

Lines changed: 0 additions & 78 deletions
This file was deleted.
Lines changed: 89 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
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
33
titleSuffix: Azure Private Link
44
description: Learn how to connect your Azure Front Door Premium to a web app or function app privately.
55
author: halkazwini
66
ms.author: halkazwini
77
ms.service: azure-frontdoor
88
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
1212
---
1313

1414
# 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
1919

2020
## Prerequisites
2121

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).
2323

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).
2737

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).
2939

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.
3150
3251
## Enable Private Link to an App Service (Web App or Function App) in Azure Front Door Premium
3352

53+
::: zone pivot="front-door-portal"
54+
3455
In this section, you map the Private Link service to a private endpoint within Azure Front Door's private network.
3556

3657
1. In your Azure Front Door Premium profile, go to *Settings* and select **Origin groups**.
3758

3859
1. Choose the origin group that should contain the App Service (Web App or Function App) origin you want to enable Private Link for.
3960

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:
4562

4663
| Setting | Value |
4764
| ------- | ----- |
@@ -57,27 +74,76 @@ In this section, you map the Private Link service to a private endpoint within A
5774
| Target sub resource | Choose *site* as the subresource type for the selected resource. |
5875
| Request message | Enter a custom message to display while approving the Private Endpoint. |
5976

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+
6079
1. Select **Add** to save your configuration, then select **Update** to save the origin group settings.
6180

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.' \
102+
--private-link-resource /'subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/webapp1/appServices' \
103+
--private-link-sub-resource-type sites
104+
```
105+
106+
::: zone-end
107+
62108
## Approve Azure Front Door Premium private endpoint connection from App Service
63109

110+
::: zone pivot="front-door-portal"
111+
64112
1. Navigate to the App Service you configured with Private Link in the previous section. Under **Settings**, select **Networking**.
65113

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**.
67115

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.":::
69117

70118
1. Find the *pending* private endpoint request from Azure Front Door Premium and select **Approve**.
71119

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
73121

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

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
77141
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:
79143
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.
80145
81-
## Next steps
146+
## Related content
82147
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

Comments
 (0)