Skip to content

Commit 83d78d1

Browse files
authored
Merge pull request #201316 from Harikrishnan-M-B/QSG2
Quickstart: Create an Azure Front Door Premium - Azure CLI
2 parents 737a1d6 + 89f2f73 commit 83d78d1

File tree

2 files changed

+40
-11
lines changed

2 files changed

+40
-11
lines changed

articles/frontdoor/standard-premium/create-front-door-cli.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Create an Azure Front Door Premium with the Azure CLI
3-
description: Learn how to create an Azure Front Door Premium with Azure CLI. Use Azure Front Door to deliver content to your global user base and protect your web apps against vulnerabilities.
2+
title: Create an Azure Front Door Standard/Premium with the Azure CLI
3+
description: Learn how to create an Azure Front Door Standard/Premium with Azure CLI. Use Azure Front Door to deliver content to your global user base and protect your web apps against vulnerabilities.
44
ms.topic: sample
55
author: duau
66
ms.author: duau
@@ -10,9 +10,9 @@ ms.custom: devx-track-azurecli
1010

1111
---
1212

13-
# Quickstart: Create an Azure Front Door Premium - Azure CLI
13+
# Quickstart: Create an Azure Front Door Standard/Premium - Azure CLI
1414

15-
In this quickstart, you'll learn how to create an Azure Front Door Premium profile using Azure CLI. You'll create this profile using two Web Apps as your origin, and add a WAF security policy. You can then verify connectivity to your Web Apps using the Azure Front Door endpoint hostname.
15+
In this quickstart, you'll learn how to create an Azure Front Door Standard/Premium profile using Azure CLI. You'll create this profile using two Web Apps as your origin, and add a WAF security policy. You can then verify connectivity to your Web Apps using the Azure Front Door endpoint hostname.
1616

1717
> [!NOTE]
1818
> This documentation is for Azure Front Door Standard/Premium. Looking for information on Azure Front Door? View [Azure Front Door Docs](../front-door-overview.md).
@@ -34,6 +34,9 @@ az group create --name myRGFD --location centralus
3434

3535
Run [az afd profile create](/cli/azure/afd/profile#az-afd-profile-create) to create an Azure Front Door profile.
3636

37+
> [!NOTE]
38+
> If you want to deploy Azure Front Door Standard instead of Premium substitute the value of the sku parameter with Standard_AzureFrontDoor. You won't be able to deploy managed rules with WAF Policy, if you choose Standard SKU. For detailed comparison, view [Azure Front Door tier comparison](./tier-comparison.md).
39+
3740
```azurecli
3841
az afd profile create \
3942
--profile-name contosoafd \
@@ -169,6 +172,9 @@ az afd route create \
169172
### Create a WAF policy
170173

171174
Run [az network front-door waf-policy create](/cli/azure/network/front-door/waf-policy#az-network-front-door-waf-policy-create) to create a new WAF policy for your Front Door. This example creates a policy that is enabled and in prevention mode.
175+
176+
> [!NOTE]
177+
> Managed rules will only work with Front Door Premium SKU. You can opt for Standard SKU below to use custom rules.
172178
173179
```azurecli
174180
az network front-door waf-policy create \
@@ -182,6 +188,25 @@ az network front-door waf-policy create \
182188
> [!NOTE]
183189
> If you select `Detection` mode, your WAF doesn't block any requests.
184190
191+
### Assign managed rules to the WAF policy
192+
Run [az network front-door waf-policy managed-rules add](/cli/azure/network/front-door/waf-policy/managed-rules#az-network-front-door-waf-policy-managed-rules-add) to add managed rules to your WAF Policy. This example adds Microsoft_DefaultRuleSet_1.2 and Microsoft_BotManagerRuleSet_1.0 to your policy.
193+
194+
195+
```azurecli
196+
az network front-door waf-policy managed-rules add \
197+
--policy-name contosoWAF \
198+
--resource-group myRGFD \
199+
--type Microsoft_DefaultRuleSet \
200+
--version 1.2
201+
```
202+
203+
```azurecli
204+
az network front-door waf-policy managed-rules add \
205+
--policy-name contosoWAF \
206+
--resource-group myRGFD \
207+
--type Microsoft_BotManagerRuleSet \
208+
--version 1.0
209+
```
185210
### Create the security policy
186211

187212
Run [az afd security-policy create](/cli/azure/afd/security-policy#az-afd-security-policy-create) to apply your WAF policy to the endpoint's default domain.
@@ -210,31 +235,35 @@ az afd endpoint show --resource-group myRGFD --profile-name contosoafd --endpoin
210235
```
211236
In a browser, go to the endpoint hostname: `contosofrontend-<hash>.z01.azurefd.net`. Your request will automatically get routed to the least latent Web App in the origin group.
212237

213-
238+
:::image type="content" source="../media/create-front-door-portal/front-door-web-app-origin-success.png" alt-text="Screenshot of the message: Your web app is running and waiting for your content":::
214239

215240
To test instant global failover, we'll use the following steps:
216241

217242
1. Open a browser, as described above, and go to the endpoint hostname: `contosofrontend-<hash>.z01.azurefd.net`.
218243

219244
2. Stop one of the Web Apps by running [az webapp stop](/cli/azure/webapp#az-webapp-stop&preserve-view=true)
245+
220246
```azurecli
221247
az webapp stop --name WebAppContoso-01 --resource-group myRGFD
222248
```
223249

224-
4. Refresh your browser. You should see the same information page.
250+
3. Refresh your browser. You should see the same information page.
225251

226-
>[!TIP]
227-
>There is a little bit of delay for these actions. You might need to refresh again.
252+
>[!TIP]
253+
>There is a little bit of delay for these actions. You might need to refresh again.
228254
229-
5. Find the other web app, and stop it as well.
255+
4. Find the other web app, and stop it as well.
230256

231257
```azurecli
232258
az webapp stop --name WebAppContoso-02 --resource-group myRGFD
233259
```
234260

235-
6. Refresh your browser. This time, you should see an error message.
261+
5. Refresh your browser. This time, you should see an error message.
262+
263+
:::image type="content" source="../media/create-front-door-portal/web-app-stopped-message.png" alt-text="Screenshot of the message: Both instances of the web app stopped":::
264+
236265

237-
7. Restart one of the Web Apps by running [az webapp start](/cli/azure/webapp#az-webapp-start&preserve-view=true). Refresh your browser and the page will go back to normal.
266+
6. Restart one of the Web Apps by running [az webapp start](/cli/azure/webapp#az-webapp-start&preserve-view=true). Refresh your browser and the page will go back to normal.
238267

239268
```azurecli
240269
az webapp start --name WebAppContoso-01 --resource-group myRGFD

0 commit comments

Comments
 (0)