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/container-apps/waf-app-gateway.md
+40-12Lines changed: 40 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.author: wviriya
10
10
zone_pivot_groups: azure-cli-or-portal
11
11
---
12
12
13
-
# Protect Azure Container Apps with Web Application Firewall on Application Gateway
13
+
# Protect Azure Container Apps with Web Application Firewall on Application Gateway
14
14
15
15
When you host your apps or microservices in Azure Container Apps, you may not always want to publish them directly to the internet. Instead, you may want to expose them through a reverse proxy.
16
16
@@ -21,8 +21,8 @@ Reverse proxies allow you to place services in front of your apps that supports
21
21
- Routing
22
22
- Caching
23
23
- Rate limiting
24
-
- Security layers
25
24
- Load balancing
25
+
- Security layers
26
26
- Request filtering
27
27
28
28
This article demonstrates how to protect your container apps using a [Web Application Firewall (WAF) on Azure Application Gateway](../web-application-firewall/ag/ag-overview.md) with an internal Container Apps environment.
@@ -31,24 +31,30 @@ For more information on networking concepts in Container Apps, see [Networking A
31
31
32
32
## Prerequisites
33
33
34
-
- Have a container app that is on an internal environment and integrated with a custom virtual network. For more information on how to create a custom virtual network integrated app, see [provide a virtual network to an internal Azure Container Apps environment](./vnet-custom-internal.md).
35
-
- If you must use TLS/SSL encryption to the application gateway, a valid public certificate that's used to bind to your application gateway is required.
34
+
-**Internal environment with custom VNet**: Have a container app that is on an internal environment and integrated with a custom virtual network. For more information on how to create a custom virtual network integrated app, see [provide a virtual network to an internal Azure Container Apps environment](./vnet-custom-internal.md).
35
+
36
+
-**Security certificates**: If you must use TLS/SSL encryption to the application gateway, a valid public certificate that's used to bind to your application gateway is required.
36
37
37
38
## Retrieve your container app's domain
38
39
39
-
In the following steps, you retrieve the values of the **default domain** and the **static IP** which you use to set up your Private DNS Zone.
40
+
Use the following steps to retrieve the values of the **default domain** and the **static IP** to set up your Private DNS Zone.
40
41
41
42
1. From the resource group's *Overview* window in the portal, select your container app.
43
+
42
44
1. On the *Overview* window for your container app resource, select the link for **Container Apps Environment**
43
45
44
-
1. On the *Overview* window for your container app environment resource, select **JSON View** in the upper right-hand corner of the page to view the JSON representation of the container apps environment.
46
+
1. On the *Overview* window for your container app environment resource, select **JSON View** in the upper right-hand corner of the page to view the JSON representation of the container apps environment.
47
+
45
48
1. Copy the values for the **defaultDomain** and **staticIp** properties and paste them into a text editor. You'll create a private DNS zone using these values for the default domain in the next section.
46
49
47
50
## Create and configure an Azure Private DNS zone
48
51
49
-
1. On the Azure portal menu or the **Home** page, select **Create a resource**.
52
+
1. On the Azure portal menu or the *Home* page, select **Create a resource**.
53
+
50
54
1. Search for *Private DNS Zone*, and select **Private DNS Zone** from the search results.
55
+
51
56
1. Select the **Create** button.
57
+
52
58
1. Enter the following values:
53
59
54
60
| Setting | Action |
@@ -59,8 +65,11 @@ In the following steps, you retrieve the values of the **default domain** and th
59
65
| Resource group location | Leave as the default. A value isn't needed as Private DNS Zones are global. |
60
66
61
67
1. Select **Review + create**. After validation finishes, select **Create**.
68
+
62
69
1. After the private DNS zone is created, select **Go to resource**.
70
+
63
71
1. In the *Overview* window, select **+Record set**, to add a new record set.
72
+
64
73
1. In the *Add record set* window, enter the following values:
65
74
66
75
| Setting | Action |
@@ -72,7 +81,9 @@ In the following steps, you retrieve the values of the **default domain** and th
72
81
| IP address | Enter the **staticIp** property of the Container Apps Environment from the previous section. |
73
82
74
83
1. Select **OK** to create the record set.
84
+
75
85
1. Select **+Record set** again, to add a second record set.
86
+
76
87
1. In the *Add record set* window, enter the following values:
77
88
78
89
| Setting | Action |
@@ -84,7 +95,9 @@ In the following steps, you retrieve the values of the **default domain** and th
84
95
| IP address | Enter the **staticIp** property of the Container Apps Environment from the previous section. |
85
96
86
97
1. Select **OK** to create the record set.
87
-
1. Select the **Virtual network links** window from the menu on the left side of the page.
98
+
99
+
1. Select the **Virtual network links** window from the menu on the left side of the page.
100
+
88
101
1. Select **+Add** to create a new link with the following values:
89
102
90
103
| Setting | Action |
@@ -115,7 +128,7 @@ In the following steps, you retrieve the values of the **default domain** and th
115
128
| WAF Policy | Select **Create new** and enter **my-waf-policy** for the WAF Policy. Select **OK**. If you chose **Standard V2** for the tier, skip this step. |
116
129
| Virtual network | Select the virtual network that your container app is integrated with. |
117
130
| Subnet | Select **Manage subnet configuration**. If you already have a subnet you wish to use, use that instead, and skip to [the Frontends section](#frontends-tab). |
118
-
131
+
119
132
1. From within the *Subnets* window of *my-custom-vnet*, select **+Subnet** and enter the following values:
120
133
121
134
| Setting | Action |
@@ -124,15 +137,17 @@ In the following steps, you retrieve the values of the **default domain** and th
124
137
| Subnet address range | Keep the default values. |
125
138
126
139
1. For the remainder of the settings, keep the default values.
140
+
127
141
1. Select **Save** to create the new subnet.
128
142
129
143
1. Close the *Subnets* window to return to the *Create application gateway* window.
144
+
130
145
1. Select the following values:
131
146
132
147
| Setting | Action |
133
148
|---|---|
134
149
| Subnet | Select the **appgateway-subnet** you created. |
135
-
150
+
136
151
1. Select **Next: Frontends**, to proceed.
137
152
138
153
### Frontends tab
@@ -154,17 +169,20 @@ In the following steps, you retrieve the values of the **default domain** and th
154
169
The backend pool is used to route requests to the appropriate backend servers. Backend pools can be composed of any combination of the following resources:
155
170
156
171
- NICs
157
-
- Virtual Machine Scale Sets
158
172
- Public IP addresses
159
173
- Internal IP addresses
174
+
- Virtual Machine Scale Sets
160
175
- Fully qualified domain names (FQDN)
161
176
- Multi-tenant back-ends like Azure App Service and Container Apps
162
177
163
178
In this example, you create a backend pool that targets your container app.
164
179
165
180
1. Select **Add a backend pool**.
166
-
1. Open a new tab and navigate to your container app.
181
+
182
+
1. Open a new tab and navigate to your container app.
183
+
167
184
1. In the *Overview* window of the Container App, find the **Application Url** and copy it.
185
+
168
186
1. Return to the *Backends* tab, and enter the following values in the **Add a backend pool** window:
169
187
170
188
| Setting | Action |
@@ -175,6 +193,7 @@ In this example, you create a backend pool that targets your container app.
175
193
| Target | Enter the **Container App Application Url** you copied and remove the *https://* prefix. This location is the FQDN of your container app. |
176
194
177
195
1. Select **Add**.
196
+
178
197
1. On the *Backends* tab, select **Next: Configuration**.
179
198
180
199
### Configuration tab
@@ -243,14 +262,17 @@ On the *Configuration* tab, you connect the frontend and backend pool you create
243
262
1. In the *Add a routing rule* window, select **Add** again.
244
263
245
264
1. Select **Next: Tags**.
265
+
246
266
1. Select **Next: Review + create**, and then select **Create**.
247
267
248
268
## Add private link to your Application Gateway
249
269
250
270
This step is required for internal only container app environments as it allows your Application Gateway to communicate with your Container App on the backend through the virtual network.
251
271
252
272
1. Once the Application Gateway is created, select **Go to resource**.
273
+
253
274
1. From the menu on the left, select **Private link**, then select **Add**.
275
+
254
276
1. Enter the following values:
255
277
256
278
| Setting | Action |
@@ -260,14 +282,17 @@ This step is required for internal only container app environments as it allows
260
282
| Frontend IP Configuration | Select the frontend IP for your Application Gateway. |
261
283
262
284
1. Under **Private IP address settings** select **Add**.
285
+
263
286
1. Select **Add** at the bottom of the window.
264
287
265
288
## Verify the container app
266
289
267
290
# [Default domain](#tab/default-domain)
268
291
269
292
1. Find the public IP address for the application gateway on its *Overview* page, or you can search for the address. To search, select *All resources* and enter **my-container-apps-agw-pip** in the search box. Then, select the IP in the search results.
293
+
270
294
1. Navigate to the public IP address of the application gateway.
295
+
271
296
1. Your request is automatically routed to the container app, which verifies the application gateway was successfully created.
272
297
273
298
# [Custom domain](#tab/custom-domain)
@@ -291,8 +316,11 @@ When you no longer need the resources that you created, delete the resource grou
291
316
To delete the resource group:
292
317
293
318
1. On the Azure portal menu, select **Resource groups** or search for and select *Resource groups*.
319
+
294
320
1. On the *Resource groups* page, search for and select **my-container-apps**.
321
+
295
322
1. On the *Resource group page*, select **Delete resource group**.
323
+
296
324
1. Enter **my-container-apps** under *TYPE THE RESOURCE GROUP NAME* and then select **Delete**
0 commit comments