Skip to content

Commit 447e0d0

Browse files
Merge pull request #303694 from MicrosoftDocs/main
Auto Publish – main to live - 2025-07-31 22:00 UTC
2 parents 975ce9b + b6e66b2 commit 447e0d0

File tree

67 files changed

+4834
-1498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4834
-1498
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6963,8 +6963,12 @@
69636963
"source_path": "articles/reliability/migrate-sql-database.md",
69646964
"redirect_url": "/azure/azure-sql/database/enable-zone-redundancy",
69656965
"redirect_document_id": false
6966+
},
6967+
{
6968+
"source_path": "articles/reliability/migrate-app-gateway-v2.md",
6969+
"redirect_url": "/azure/reliability/reliability-application-gateway-v2",
6970+
"redirect_document_id": false
69666971
}
6967-
69686972
]
69696973
}
69706974

articles/application-gateway/.openpublishing.redirection.application-gateway.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@
344344
"source_path_from_root": "/articles/application-gateway/scripts/waf-custom-rules-powershell.md",
345345
"redirect_url": "/previous-versions/azure/application-gateway/scripts/waf-custom-rules-powershell",
346346
"redirect_document_id": false
347+
},
348+
{
349+
"source_path_from_root": "/articles/application-gateway/classic-to-resource-manager.md",
350+
"redirect_url": "/azure/virtual-machines/migration/migration-classic-resource-manager-faq",
351+
"redirect_document_id": false
347352
}
348353
]
349354
}

articles/application-gateway/application-gateway-autoscaling-zone-redundant.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ For scale-in events, Application Gateway drains existing connections for 5 minut
3737

3838
## Next steps
3939

40+
- Learn more about zone redundancy in [Reliability for Application Gateway v2](../reliability/reliability-application-gateway-v2.md)
4041
- Learn how to [Schedule autoscaling for Application Gateway](application-gateway-externally-managed-scheduled-autoscaling.md)
4142
- Learn more about [Application Gateway v2](overview-v2.md)
4243
- [Create an autoscaling, zone redundant application gateway with a reserved virtual IP address using Azure PowerShell](tutorial-autoscale-ps.md)

articles/application-gateway/classic-to-resource-manager.md

Lines changed: 0 additions & 95 deletions
This file was deleted.

articles/application-gateway/for-containers/how-to-waf-gateway-api.md

Lines changed: 75 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Web Application Firewall on Application Gateway for Containers - Gateway API
3-
description: This document provides an example scenario for testing the Web Application Firewall (WAF) on Application Gateway for Containers.
2+
title: Azure Web Application Firewall on Application Gateway for Containers - Gateway API
3+
description: This article provides an example scenario for testing Azure Web Application Firewall on Application Gateway for Containers.
44
services: application-gateway
55
author: jackstromberg
66
ms.service: azure-appgw-for-containers
@@ -9,42 +9,46 @@ ms.date: 7/21/2025
99
ms.author: jstrom
1010
---
1111

12-
# Web Application Firewall on Application Gateway for Containers with Gateway API
12+
# Azure Web Application Firewall on Application Gateway for Containers with the Gateway API
1313

14-
This document helps set up an example application that uses the following resources from Gateway API. Steps are provided to:
14+
This article helps you set up an example application that uses resources from the Gateway API. The article provides steps to:
1515

16-
- Create a [Gateway](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) resource with one HTTPS listener.
17-
- Create an [HTTPRoute](https://gateway-api.sigs.k8s.io/api-types/httproute) that references a backend service.
18-
- Create a `WebApplicationFirewallPolicy` resource that references an HTTPRoute.
16+
- Create a [`Gateway`](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) resource with one HTTPS listener.
17+
- Create an [`HTTPRoute`](https://gateway-api.sigs.k8s.io/api-types/httproute) resource that references a back-end service.
18+
- Create a `WebApplicationFirewallPolicy` resource that references an `HTTPRoute` resource.
1919

2020
## Background
2121

22-
Application Gateway for Containers leverages web application firewall to block a malicious request from being proxied to the backend target. See the following example scenario:
22+
Application Gateway for Containers uses Azure Web Application Firewall to block a malicious request from being proxied to the back-end target. The following diagram shows an example scenario.
2323

24-
![A figure showing a malicious request being blocked by Application Gateway for Containers with Web Application Firewall enabled in prevention mode.](./media/how-to-web-application-firewall-gateway-api/web-application-firewall.png)
24+
![Diagram that shows a malicious request being blocked by Application Gateway for Containers with Azure Web Application Firewall enabled in prevention mode.](./media/how-to-web-application-firewall-gateway-api/web-application-firewall.png)
2525

2626
## Prerequisites
2727

28-
1. If following the BYO deployment strategy, ensure you have set up your Application Gateway for Containers resources and [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md)
29-
2. If following the ALB managed deployment strategy, ensure you have provisioned your [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md) and provisioned the Application Gateway for Containers resources via the [ApplicationLoadBalancer custom resource](quickstart-create-application-gateway-for-containers-managed-by-alb-controller.md).
30-
3. Deploy sample HTTP application
31-
Apply the following deployment.yaml file on your cluster to create a sample web application to demonstrate the header rewrite.
28+
- If you're following the bring-your-own (BYO) deployment strategy, ensure that you set up your Application Gateway for Containers resources and [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md).
3229

33-
```bash
34-
kubectl apply -f https://raw.githubusercontent.com/MicrosoftDocs/azure-docs/refs/heads/main/articles/application-gateway/for-containers/examples/traffic-split-scenario/deployment.yaml
35-
```
30+
- If you're following the Application Load Balancer (ALB) managed deployment strategy, ensure that you:
31+
32+
- Provisioned your [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md).
33+
- Provisioned the Application Gateway for Containers resources via the [`ApplicationLoadBalancer` custom resource](quickstart-create-application-gateway-for-containers-managed-by-alb-controller.md).
34+
35+
- Apply the following `deployment.yaml` file on your cluster to create a sample web application that demonstrates the header rewrite:
36+
37+
```bash
38+
kubectl apply -f https://raw.githubusercontent.com/MicrosoftDocs/azure-docs/refs/heads/main/articles/application-gateway/for-containers/examples/traffic-split-scenario/deployment.yaml
39+
```
3640

37-
This command creates the following on your cluster:
41+
This command creates the following items on your cluster:
3842

39-
- a namespace called `test-infra`
40-
- two services called `backend-v1` and `backend-v2` in the `test-infra` namespace
41-
- two deployments called `backend-v1` and `backend-v2` in the `test-infra` namespace
43+
- A namespace called `test-infra`
44+
- Two services called `backend-v1` and `backend-v2` in the `test-infra` namespace
45+
- Two deployments called `backend-v1` and `backend-v2` in the `test-infra` namespace
4246

4347
## Deploy the required Gateway API resources
4448

4549
# [ALB managed deployment](#tab/alb-managed)
4650

47-
Create a gateway:
51+
Create a `Gateway` resource:
4852

4953
```bash
5054
kubectl apply -f - <<EOF
@@ -70,53 +74,53 @@ EOF
7074

7175
[!INCLUDE [application-gateway-for-containers-frontend-naming](../../../includes/application-gateway-for-containers-frontend-naming.md)]
7276

73-
# [Bring your own (BYO) deployment](#tab/byo)
77+
# [BYO deployment](#tab/byo)
7478

75-
1. Set the following environment variables
79+
1. Set the following environment variables:
7680

77-
```bash
78-
RESOURCE_GROUP='<resource group name of the Application Gateway For Containers resource>'
79-
RESOURCE_NAME='alb-test'
80-
81-
RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $RESOURCE_NAME --query id -o tsv)
82-
FRONTEND_NAME='frontend'
83-
```
81+
```bash
82+
RESOURCE_GROUP='<resource group name of the Application Gateway For Containers resource>'
83+
RESOURCE_NAME='alb-test'
84+
85+
RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $RESOURCE_NAME --query id -o tsv)
86+
FRONTEND_NAME='frontend'
87+
```
8488

85-
2. Create a Gateway
89+
2. Create a `Gateway` resource:
8690

87-
```bash
88-
kubectl apply -f - <<EOF
89-
apiVersion: gateway.networking.k8s.io/v1
90-
kind: Gateway
91-
metadata:
92-
name: gateway-01
93-
namespace: test-infra
94-
annotations:
95-
alb.networking.azure.io/alb-id: $RESOURCE_ID
96-
spec:
97-
gatewayClassName: azure-alb-external
98-
listeners:
99-
- name: http-listener
100-
port: 80
101-
protocol: HTTP
102-
allowedRoutes:
103-
namespaces:
104-
from: Same
105-
addresses:
106-
- type: alb.networking.azure.io/alb-frontend
107-
value: $FRONTEND_NAME
108-
EOF
109-
```
91+
```bash
92+
kubectl apply -f - <<EOF
93+
apiVersion: gateway.networking.k8s.io/v1
94+
kind: Gateway
95+
metadata:
96+
name: gateway-01
97+
namespace: test-infra
98+
annotations:
99+
alb.networking.azure.io/alb-id: $RESOURCE_ID
100+
spec:
101+
gatewayClassName: azure-alb-external
102+
listeners:
103+
- name: http-listener
104+
port: 80
105+
protocol: HTTP
106+
allowedRoutes:
107+
namespaces:
108+
from: Same
109+
addresses:
110+
- type: alb.networking.azure.io/alb-frontend
111+
value: $FRONTEND_NAME
112+
EOF
113+
```
110114
111115
---
112116
113-
Once the gateway resource is created, ensure the status is valid, the listener is _Programmed_, and an address is assigned to the gateway.
117+
After you create the `Gateway` resource, ensure that the status is valid, the listener has a status of `Programmed`, and an address is assigned to it:
114118
115119
```bash
116120
kubectl get gateway gateway-01 -n test-infra -o yaml
117121
```
118122
119-
Example output of successful gateway creation.
123+
Here's example output for successful creation of a `Gateway` resource:
120124
121125
```yaml
122126
status:
@@ -163,7 +167,7 @@ status:
163167
kind: HTTPRoute
164168
```
165169
166-
Once the gateway is created, create an HTTPRoute that listens for hostname contoso.com.
170+
Create an `HTTPRoute` resource that listens for the host name `contoso.com`:
167171
168172
```bash
169173
kubectl apply -f - <<EOF
@@ -185,13 +189,13 @@ spec:
185189
EOF
186190
```
187191
188-
Once the HTTPRoute resource is created, ensure the route is _Accepted_ and the Application Gateway for Containers resource is _Programmed_.
192+
After you create the `HTTPRoute` resource, ensure that the status of the route is `Accepted` and the status of the Application Gateway for Containers resource is `Programmed`:
189193
190194
```bash
191195
kubectl get httproute header-rewrite-route -n test-infra -o yaml
192196
```
193197
194-
Verify the status of the Application Gateway for Containers resource has been successfully updated.
198+
Verify that the status of the Application Gateway for Containers resource was successfully updated:
195199
196200
```yaml
197201
status:
@@ -225,7 +229,7 @@ status:
225229
226230
### Configure WebApplicationFirewallPolicy
227231
228-
Application Gateway for Containers uses a custom resource called `WebApplicationFirewallPolicy` to define WAF protection. In this example, WAF will protect a specific HTTPRoute.
232+
Application Gateway for Containers uses a custom resource called `WebApplicationFirewallPolicy` to define Azure Web Application Firewall protection. In this example, Azure Web Application Firewall helps protect a specific `HTTPRoute` resource:
229233
230234
```bash
231235
kubectl apply -f - <<EOF
@@ -240,12 +244,13 @@ spec:
240244
kind: HTTPRoute
241245
name: contoso-waf-route
242246
namespace: test-infra
243-
#sectionNames: ["listenerA"] # defined if targeting a specific listener on a gateway resource or path
247+
#sectionNames: ["listenerA"] # defined if you're targeting a specific listener on a gateway resource or path
244248
webApplicationFirewall:
245249
id: /subscriptions/.../Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/waf-policy-0
246250
EOF
247251
```
248252
253+
```bash
249254
kubectl apply -f - <<EOF
250255
apiVersion: alb.networking.azure.io/v1
251256
kind: WebApplicationFirewallPolicy
@@ -258,27 +263,28 @@ spec:
258263
kind: HTTPRoute
259264
name: contoso-waf-route
260265
namespace: test-infra
261-
#sectionNames: ["listenerA"] # defined if targeting a specific listener on a gateway resource or path
266+
#sectionNames: ["listenerA"] # defined if you're targeting a specific listener on a gateway resource or path
262267
webApplicationFirewall:
263268
id: /subscriptions/711d99a7-fd79-4ce7-9831-ea1afa18442e/resourceGroups/AGC-RG/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/agc-waf
264269
EOF
270+
```
265271
266272
## Test access to the application
267273
268-
Now we're ready to send some traffic to our sample application, via the FQDN assigned to the frontend. Use the following command to get the FQDN:
274+
Now you're ready to send some traffic to the sample application, via the fully qualified domain name (FQDN) assigned to the frontend resource. Use the following command to get the FQDN:
269275
270276
```bash
271277
fqdn=$(kubectl get gateway gateway-01 -n test-infra -o jsonpath='{.status.addresses[0].value}')
272278
```
273279
274-
If you specify the server name indicator using the curl command, `contoso.com` for the frontend FQDN, the output should return a response from the backend-v1 service.
280+
If you specify the server name indicator by using the `curl` command, with `contoso.com` for the frontend resource's FQDN, the output should return a response from the `backend-v1` service:
275281
276282
```bash
277283
fqdnIp=$(dig +short $fqdn)
278284
curl -k --resolve contoso.com:80:$fqdnIp http://contoso.com
279285
```
280286
281-
Via the response we should see:
287+
Via the response, you should see:
282288
283289
```json
284290
{
@@ -310,18 +316,18 @@ Via the response we should see:
310316
}
311317
```
312318
313-
Now, send a request with a malicious query string to trigger a `403 forbidden` response from your Application Gateway for Containers.
319+
Now, send a request with a malicious query string to trigger a `403 forbidden` response from Application Gateway for Containers.
314320
315-
**Example 1:**
321+
Here's one example request:
316322
317323
```bash
318324
curl -k --resolve contoso.com:80:$fqdnIp http://contoso.com/?text=/etc/passwd
319325
```
320326
321-
**Example 2:**
327+
Here's another example request:
322328
323329
```bash
324330
curl -k --resolve contoso.com:80:$fqdnIp http://contoso.com/?1=1=1
325331
```
326332
327-
Congratulations, you have installed ALB Controller, deployed a backend application and used Web Application Firewall functionality to block a malicious request.
333+
Congratulations! You installed an ALB Controller, deployed a back-end application, and used Azure Web Application Firewall functionality to block a malicious request.

0 commit comments

Comments
 (0)