Skip to content

Commit 86f4bfc

Browse files
committedJul 2, 2019
align code, bigger image
1 parent 9ed4e60 commit 86f4bfc

File tree

2 files changed

+56
-17
lines changed

2 files changed

+56
-17
lines changed
 
Loading

‎articles/application-gateway/self-signed-certificates.md

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Create your root CA certificate using OpenSSL.
6767

6868
## Create a server certificate
6969

70-
Next you'll create a server certificate using OpenSSL.
70+
Next, you'll create a server certificate using OpenSSL.
7171

7272
### Create the certificate’s key
7373

@@ -191,29 +191,68 @@ Or, you can use Azure CLI or Azure PowerShell to upload the root certificate. Th
191191
192192
$gw=Get-AzApplicationGateway -Name appgwv2 -ResourceGroupName rgOne
193193
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"
195198
196-
$trustedroot=Get-AzApplicationGatewayTrustedRootCertificate -Name CustomCARoot -ApplicationGateway $gw
199+
$trustedroot = Get-AzApplicationGatewayTrustedRootCertificate `
200+
-Name CustomCARoot `
201+
-ApplicationGateway $gw
197202
198203
## Get the listener, backend pool and probe
199204
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
211242
212243
## Get the configuration and update the Application Gateway
213244
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
217256
218257
Set-AzApplicationGateway -ApplicationGateway $gw
219258
```

0 commit comments

Comments
 (0)
Please sign in to comment.