@@ -67,7 +67,7 @@ Create your root CA certificate using OpenSSL.
67
67
68
68
## Create a server certificate
69
69
70
- Next you'll create a server certificate using OpenSSL.
70
+ Next, you'll create a server certificate using OpenSSL.
71
71
72
72
### Create the certificate’s key
73
73
@@ -191,29 +191,68 @@ Or, you can use Azure CLI or Azure PowerShell to upload the root certificate. Th
191
191
192
192
$gw=Get-AzApplicationGateway -Name appgwv2 -ResourceGroupName rgOne
193
193
194
- Add-AzApplicationGatewayTrustedRootCertificate -ApplicationGateway $gw -Name CustomCARoot -CertificateFile "C:\Users\surmb\Downloads\contoso.cer"
194
+ Add-AzApplicationGatewayTrustedRootCertificate `
195
+ -ApplicationGateway $gw `
196
+ -Name CustomCARoot `
197
+ -CertificateFile "C:\Users\surmb\Downloads\contoso.cer"
195
198
196
- $trustedroot=Get-AzApplicationGatewayTrustedRootCertificate -Name CustomCARoot -ApplicationGateway $gw
199
+ $trustedroot = Get-AzApplicationGatewayTrustedRootCertificate `
200
+ -Name CustomCARoot `
201
+ -ApplicationGateway $gw
197
202
198
203
## Get the listener, backend pool and probe
199
204
200
- $listener=Get-AzApplicationGatewayHttpListener -Name basichttps -ApplicationGateway $gw
201
-
202
- $bepool=Get-AzApplicationGatewayBackendAddressPool -Name testbackendpool -ApplicationGateway $gw
203
-
204
- Add-AzApplicationGatewayProbeConfig -ApplicationGateway $gw -Name testprobe -Protocol Https -HostName "www.fabrikam.com" -Path "/" -Interval 15 -Timeout 20 -UnhealthyThreshold 3
205
-
206
- $probe=Get-AzApplicationGatewayProbeConfig -Name testprobe -ApplicationGateway $gw
207
-
208
- ## Add the configuration to the HTTP Setting and don’t forget to set the “hostname” field to the domain name of the server certificate as this will be set as the SNI header and will be used to verify the backend server’s certificate. Note that SSL handshake will fail otherwise and might lead to backend servers being deemed as Unhealthy by the probes
209
-
210
- Add-AzApplicationGatewayBackendHttpSettings -ApplicationGateway $gw -Name testbackend -Port 443 -Protocol Https -Probe $probe -TrustedRootCertificate $trustedroot -CookieBasedAffinity Disabled -RequestTimeout 20 -HostName www.fabrikam.com
205
+ $listener = Get-AzApplicationGatewayHttpListener `
206
+ -Name basichttps `
207
+ -ApplicationGateway $gw
208
+
209
+ $bepool = Get-AzApplicationGatewayBackendAddressPool `
210
+ -Name testbackendpool `
211
+ -ApplicationGateway $gw
212
+
213
+ Add-AzApplicationGatewayProbeConfig `
214
+ -ApplicationGateway $gw `
215
+ -Name testprobe `
216
+ -Protocol Https `
217
+ -HostName "www.fabrikam.com" `
218
+ -Path "/" `
219
+ -Interval 15 `
220
+ -Timeout 20 `
221
+ -UnhealthyThreshold 3
222
+
223
+ $probe = Get-AzApplicationGatewayProbeConfig `
224
+ -Name testprobe `
225
+ -ApplicationGateway $gw
226
+
227
+ ## Add the configuration to the HTTP Setting and don’t forget to set the “hostname” field
228
+ ## to the domain name of the server certificate as this will be set as the SNI header and
229
+ ## will be used to verify the backend server’s certificate. Note that SSL handshake will
230
+ ## fail otherwise and might lead to backend servers being deemed as Unhealthy by the probes
231
+
232
+ Add-AzApplicationGatewayBackendHttpSettings `
233
+ -ApplicationGateway $gw `
234
+ -Name testbackend `
235
+ -Port 443 `
236
+ -Protocol Https `
237
+ -Probe $probe `
238
+ -TrustedRootCertificate $trustedroot `
239
+ -CookieBasedAffinity Disabled `
240
+ -RequestTimeout 20 `
241
+ -HostName www.fabrikam.com
211
242
212
243
## Get the configuration and update the Application Gateway
213
244
214
- $backendhttp=Get-AzApplicationGatewayBackendHttpSettings -Name testbackend -ApplicationGateway $gw
215
-
216
- Add-AzApplicationGatewayRequestRoutingRule -ApplicationGateway $gw -Name testrule -RuleType Basic -BackendHttpSettings $backendhttp -HttpListener $listener -BackendAddressPool $bepool
245
+ $backendhttp = Get-AzApplicationGatewayBackendHttpSettings `
246
+ -Name testbackend `
247
+ -ApplicationGateway $gw
248
+
249
+ Add-AzApplicationGatewayRequestRoutingRule `
250
+ -ApplicationGateway $gw `
251
+ -Name testrule `
252
+ -RuleType Basic `
253
+ -BackendHttpSettings $backendhttp `
254
+ -HttpListener $listener `
255
+ -BackendAddressPool $bepool
217
256
218
257
Set-AzApplicationGateway -ApplicationGateway $gw
219
258
```
0 commit comments