Skip to content

Commit ee42558

Browse files
committed
add CLI instructions and apply pivots
1 parent c1a9158 commit ee42558

File tree

1 file changed

+84
-16
lines changed

1 file changed

+84
-16
lines changed

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

Lines changed: 84 additions & 16 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,18 +19,39 @@ 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 - CLI](../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"
2735

28-
## Sign in to Azure
36+
- An Azure Front Door Premium profile with an origin group. For more information, see [Create an Azure Front Door - CLI](../create-front-door-cli.md).
2937

30-
Sign in to the [Azure portal](https://portal.azure.com).
38+
- A Private Link. For more information, see [Create a Private Link service](../../private-link/create-private-link-service-cli.md).
39+
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 is not 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**.
@@ -59,8 +80,37 @@ In this section, you map the Private Link service to a private endpoint within A
5980

6081
1. Select **Add** to save your configuration, then select **Update** to save the origin group settings.
6182

83+
::: zone-end
84+
85+
::: zone pivot="front-door-cli"
86+
87+
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**.
88+
89+
```azurecli-interactive
90+
az afd origin create --enabled-state Enabled \
91+
--resource-group 'myResourceGroup' \
92+
--origin-group-name 'og1' \
93+
--origin-name 'myapporigin' \
94+
--profile-name 'contosoAFD' \
95+
--host-name 'example.contoso.com' \
96+
--origin-host-header 'example.contoso.com' \
97+
--http-port 80 \
98+
--https-port 443 \
99+
--priority 1 \
100+
--weight 500 \
101+
--enable-private-link true \
102+
--private-link-location 'EastUS' \
103+
--private-link-request-message 'AFD app service origin Private Link request.' \
104+
--private-link-resource /'subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/webapp1/appServices' \
105+
--private-link-sub-resource-type sites
106+
```
107+
108+
::: zone-end
109+
62110
## Approve Azure Front Door Premium private endpoint connection from App Service
63111

112+
::: zone pivot="front-door-portal"
113+
64114
1. Navigate to the App Service you configured with Private Link in the previous section. Under **Settings**, select **Networking**.
65115

66116
1. In the **Networking** section, select on **Configure your private endpoint connections**.
@@ -69,15 +119,33 @@ In this section, you map the Private Link service to a private endpoint within A
69119

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

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.
122+
::: zone-end
73123

74-
## Common mistakes to avoid
124+
::: zone pivot="front-door-cli"
125+
126+
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.
127+
128+
```azurecli-interactive
129+
az network private-endpoint-connection list --name 'webapp1' --resource-group 'myResourceGroup' --type 'Microsoft.Web/sites'
130+
```
75131
76-
The following are common mistakes when configuring an origin with Azure Private Link enabled:
132+
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.
133+
134+
```azurecli-interactive
135+
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'
136+
```
137+
138+
::: zone-end
139+
140+
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.
141+
142+
## Common mistakes to avoid
77143
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.
144+
The following is a common mistake when configuring an origin with Azure Private Link enabled:
79145
146+
- 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.
80147
81-
## Next steps
148+
## Related content
82149
83-
Learn about [Private Link service with App service](../../app-service/networking/private-endpoint.md).
150+
- [Connect Azure Front Door Premium to an Azure Application Gateway with Private Link](../how-to-enable-private-link-application-gateway.md)
151+
- [Use private endpoints for Azure App Service apps](../../app-service/networking/private-endpoint.md)

0 commit comments

Comments
 (0)