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
Copy file name to clipboardExpand all lines: articles/frontdoor/standard-premium/create-front-door-cli.md
+31-3Lines changed: 31 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
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.
4
4
ms.topic: sample
5
5
author: duau
6
6
ms.author: duau
@@ -34,6 +34,9 @@ az group create --name myRGFD --location centralus
34
34
35
35
Run [az afd profile create](/cli/azure/afd/profile#az-afd-profile-create) to create an Azure Front Door profile.
36
36
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
+
37
40
```azurecli
38
41
az afd profile create \
39
42
--profile-name contosoafd \
@@ -169,6 +172,9 @@ az afd route create \
169
172
### Create a WAF policy
170
173
171
174
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.
172
178
173
179
```azurecli
174
180
az network front-door waf-policy create \
@@ -182,6 +188,25 @@ az network front-door waf-policy create \
182
188
> [!NOTE]
183
189
> If you select `Detection` mode, your WAF doesn't block any requests.
184
190
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
+
```
185
210
### Create the security policy
186
211
187
212
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,7 +235,7 @@ az afd endpoint show --resource-group myRGFD --profile-name contosoafd --endpoin
210
235
```
211
236
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.
212
237
213
-
238
+
:::image type="content" source="../media/create-front-door-portal/front-door-web-app-origin-success.png" alt-text="Your web app is running and waiting for your content":::
214
239
215
240
To test instant global failover, we'll use the following steps:
6. Refresh your browser. This time, you should see an error message.
236
261
262
+
:::image type="content" source="../media/create-front-door-portal/web-app-stopped-message.png" alt-text="Both instances of the web app stopped":::
263
+
264
+
237
265
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.
0 commit comments