Skip to content

Commit 0c93bc1

Browse files
authored
Merge pull request #202699 from vhorne/waf-cli-tut
update to use waf policy
2 parents 4731266 + ccb248e commit 0c93bc1

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

articles/web-application-firewall/ag/tutorial-restrict-web-traffic-cli.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to restrict web traffic with a Web Application Firewall o
44
services: web-application-firewall
55
author: vhorne
66
ms.service: web-application-firewall
7-
ms.date: 03/29/2021
7+
ms.date: 06/23/2022
88
ms.author: victorh
99
ms.topic: how-to
1010
ms.custom: devx-track-azurecli
@@ -66,11 +66,17 @@ az network public-ip create \
6666
--sku Standard
6767
```
6868

69-
## Create an application gateway with a WAF
69+
## Create an application gateway with a WAF policy
7070

7171
You can use [az network application-gateway create](/cli/azure/network/application-gateway) to create the application gateway named *myAppGateway*. When you create an application gateway using the Azure CLI, you specify configuration information, such as capacity, sku, and HTTP settings. The application gateway is assigned to *myAGSubnet* and *myAGPublicIPAddress*.
7272

7373
```azurecli-interactive
74+
az network application-gateway waf-policy create \
75+
--name waf-pol \
76+
--resource-group myResourceGroupAG \
77+
--type OWASP \
78+
--version 3.2
79+
7480
az network application-gateway create \
7581
--name myAppGateway \
7682
--location eastus \
@@ -83,14 +89,9 @@ az network application-gateway create \
8389
--frontend-port 80 \
8490
--http-settings-port 80 \
8591
--http-settings-protocol Http \
86-
--public-ip-address myAGPublicIPAddress
87-
88-
az network application-gateway waf-config set \
89-
--enabled true \
90-
--gateway-name myAppGateway \
91-
--resource-group myResourceGroupAG \
92-
--firewall-mode Detection \
93-
--rule-set-version 3.0
92+
--public-ip-address myAGPublicIPAddress \
93+
--waf-policy waf-pol \
94+
--priority 1
9495
```
9596

9697
It may take several minutes for the application gateway to be created. After the application gateway is created, you can see these new features of it:

0 commit comments

Comments
 (0)