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
+40-11Lines changed: 40 additions & 11 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
@@ -10,9 +10,9 @@ ms.custom: devx-track-azurecli
10
10
11
11
---
12
12
13
-
# Quickstart: Create an Azure Front Door Premium - Azure CLI
13
+
# Quickstart: Create an Azure Front Door Standard/Premium - Azure CLI
14
14
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.
16
16
17
17
> [!NOTE]
18
18
> 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
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,31 +235,35 @@ 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="Screenshot of the message: 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:
216
241
217
242
1. Open a browser, as described above, and go to the endpoint hostname: `contosofrontend-<hash>.z01.azurefd.net`.
218
243
219
244
2. Stop one of the Web Apps by running [az webapp stop](/cli/azure/webapp#az-webapp-stop&preserve-view=true)
245
+
220
246
```azurecli
221
247
az webapp stop --name WebAppContoso-01 --resource-group myRGFD
222
248
```
223
249
224
-
4. Refresh your browser. You should see the same information page.
250
+
3. Refresh your browser. You should see the same information page.
225
251
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.
228
254
229
-
5. Find the other web app, and stop it as well.
255
+
4. Find the other web app, and stop it as well.
230
256
231
257
```azurecli
232
258
az webapp stop --name WebAppContoso-02 --resource-group myRGFD
233
259
```
234
260
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
+
236
265
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.
238
267
239
268
```azurecli
240
269
az webapp start --name WebAppContoso-01 --resource-group myRGFD
0 commit comments