Skip to content

Commit 8e9d5f0

Browse files
Merge pull request #286167 from Harikrishnan-M-B/sww
cli article for PL
2 parents 93e2b31 + 9116ac1 commit 8e9d5f0

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

articles/frontdoor/how-to-enable-private-link-storage-static-website.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ ms.service: azure-frontdoor
88
ms.topic: how-to
99
ms.date: 03/31/2024
1010
ms.author: duau
11+
zone_pivot_groups: front-door-dev-exp-portal-cli
1112
---
1213

1314
# Connect Azure Front Door Premium to a storage static website with Private Link
1415

16+
::: zone pivot="front-door-portal"
17+
1518
This article guides you through how to configure Azure Front Door Premium tier to connect to your storage static website privately using the Azure Private Link service.
1619

1720
## Prerequisites
@@ -76,6 +79,67 @@ When creating a private endpoint connection to the storage static website's seco
7679

7780
Once the origin is added and the private endpoint connection is approved, you can test your private link connection to your storage static website.
7881

82+
::: zone-end
83+
84+
::: zone pivot="front-door-cli"
85+
86+
This article will guide you through how to configure Azure Front Door Premium tier to connect to your Storage Account privately using the Azure Private Link service with Azure CLI.
87+
88+
## Prerequisites - CLI
89+
90+
[!INCLUDE [azure-cli-prepare-your-environment](~/reusable-content/azure-cli/azure-cli-prepare-your-environment.md)]
91+
92+
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
93+
* Have a functioning Azure Front Door Premium profile, an endpoint and an origin group. For more information on how to create an Azure Front Door profile, see [Create a Front Door - CLI](create-front-door-cli.md).
94+
95+
## Enable Private Link to a Storage Static Website in Azure Front Door Premium
96+
97+
1. Run [az afd origin create](/cli/azure/afd/origin#az-afd-origin-create) to create a new Azure Front Door origin. Enter the following settings to configure the Storage Static Website you want Azure Front Door Premium to connect with privately. Notice the `private-link-location` must be in one of the [available regions](private-link.md#region-availability) and the `private-link-sub-resource-type` must be **web**.
98+
99+
```azurecli-interactive
100+
az afd origin create --enabled-state Enabled \
101+
--resource-group testRG \
102+
--origin-group-name default-origin-group \
103+
--origin-name pvtStaticSite \
104+
--profile-name testAFD \
105+
--host-name example.z13.web.core.windows.net\
106+
--origin-host-header example.z13.web.core.windows.net\
107+
--http-port 80 \
108+
--https-port 443 \
109+
--priority 1 \
110+
--weight 500 \
111+
--enable-private-link true \
112+
--private-link-location EastUS \
113+
--private-link-request-message 'AFD Storage static website origin Private Link request.' \
114+
--private-link-resource /subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testingafdpl \
115+
--private-link-sub-resource-type web
116+
117+
```
118+
119+
## Approve Private Endpoint Connection from Storage Account
120+
121+
1. Run [az network private-endpoint-connection list](/cli/azure/network/private-endpoint-connection#az-network-private-endpoint-connection-list) to list the private endpoint connections for your storage account. Note down the 'Resource ID' of the private endpoint connection available in your storage account, in the first line of your output.
122+
123+
```azurecli-interactive
124+
az network private-endpoint-connection list -g testRG -n testingafdpl --type Microsoft.Storage/storageAccounts
125+
126+
```
127+
128+
2. Run [az network private-endpoint-connection approve](/cli/azure/network/private-endpoint-connection#az-network-private-endpoint-connection-approve) to approve the private endpoint connection.
129+
130+
```azurecli-interactive
131+
az network private-endpoint-connection approve --id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testingafdpl/privateEndpointConnections/testingafdpl.00000000-0000-0000-0000-000000000000
132+
133+
```
134+
135+
## Create Private Endpoint Connection to Web_Secondary
136+
137+
When creating a private endpoint connection to the storage static website's secondary sub-resource, you need to add a **-secondary** suffix to the origin host header. For example, if your origin host header is `example.z13.web.core.windows.net`, you need to change it to `example-secondary.z13.web.core.windows.net`.
138+
139+
Once the origin is added and the private endpoint connection is approved, you can test your private link connection to your storage static website.
140+
141+
::: zone-end
142+
79143
## Next steps
80144

81145
Learn about [Private Link service with storage account](../storage/common/storage-private-endpoints.md).

articles/zone-pivot-groups.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,24 @@ groups:
11511151
title: Current
11521152
- id: expressroute-preview
11531153
title: Preview
1154+
# Owner: hmb
1155+
- id: front-door-dev-exp-portal-cli
1156+
title: Front Door Developer experience
1157+
prompt: "Select the developer experience:"
1158+
pivots:
1159+
- id: front-door-portal
1160+
title: Azure portal
1161+
- id: front-door-cli
1162+
title: Azure CLI
1163+
# Owner: wiassaf
1164+
- id: azure-sql-deployment-option-single-elastic
1165+
title: Azure SQL deployment option, single or elastic
1166+
prompt: "Select an Azure SQL Database deployment option:"
1167+
pivots:
1168+
- id: azure-sql-single-db
1169+
title: Single database
1170+
- id: azure-sql-elastic-pool
1171+
title: Elastic pool
11541172
# Owner: karler
11551173
- id: spring-apps-tier-selection
11561174
title: Azure Spring Apps plan

0 commit comments

Comments
 (0)