@@ -88,7 +88,7 @@ function Test-ApplicationGatewayCRUD
88
88
89
89
$rglocation = Get-ProviderLocation ResourceManagement
90
90
$resourceTypeParent = " Microsoft.Network/applicationgateways"
91
- $location = Get-ProviderLocation $resourceTypeParent
91
+ $location = Get-ProviderLocation " Microsoft.Network/applicationGateways " " East US "
92
92
93
93
$rgname = Get-ResourceGroupName
94
94
$appgwName = Get-ResourceName
@@ -115,9 +115,9 @@ function Test-ApplicationGatewayCRUD
115
115
$probe01Name = Get-ResourceName
116
116
$probe02Name = Get-ResourceName
117
117
$customError403Url01 = " https://mycustomerrorpages.blob.core.windows.net/errorpages/403-another.htm"
118
- $customError403Url02 = " http ://mycustomerrorpages.blob.core.windows.net/errorpages/403-another .htm"
119
- $customError502Url01 = " https://mycustomerrorpages.blob.core.windows.net/errorpages/502.htm"
120
- $customError502Url02 = " http ://mycustomerrorpages.blob.core.windows.net/errorpages/502.htm"
118
+ $customError403Url02 = " https ://mycustomerrorpages.blob.core.windows.net/errorpages/403.htm"
119
+ $customError502Url01 = " https://mycustomerrorpages.blob.core.windows.net/errorpages/502-another .htm"
120
+ $customError502Url02 = " https ://mycustomerrorpages.blob.core.windows.net/errorpages/502.htm"
121
121
122
122
try
123
123
{
@@ -133,7 +133,7 @@ function Test-ApplicationGatewayCRUD
133
133
$nicSubnet = Get-AzVirtualNetworkSubnetConfig - Name $nicSubnetName - VirtualNetwork $vnet
134
134
135
135
# Create public ip
136
- $publicip = New-AzPublicIpAddress - ResourceGroupName $rgname - name $publicIpName - location $location - AllocationMethod Dynamic
136
+ $publicip = New-AzPublicIpAddress - ResourceGroupName $rgname - name $publicIpName - location $location - AllocationMethod Dynamic - sku Basic
137
137
138
138
# create 2 nics to add to backend
139
139
$nic01 = New-AzNetworkInterface - Name $nic01Name - ResourceGroupName $rgname - Location $location - Subnet $nicSubnet
@@ -195,8 +195,8 @@ function Test-ApplicationGatewayCRUD
195
195
$listener01 = New-AzApplicationGatewayHttpListener - Name $listener01Name - Protocol Http - FrontendIPConfiguration $fipconfig01 - FrontendPort $fp01
196
196
$listener02 = New-AzApplicationGatewayHttpListener - Name $listener02Name - Protocol Http - FrontendIPConfiguration $fipconfig02 - FrontendPort $fp02 - CustomErrorConfiguration $ce01_listener , $ce02_listener
197
197
198
- $rule01 = New-AzApplicationGatewayRequestRoutingRule - Name $rule01Name - RuleType basic - Priority 100 - BackendHttpSettings $poolSetting01 - HttpListener $listener01 - BackendAddressPool $pool
199
- $rule02 = New-AzApplicationGatewayRequestRoutingRule - Name $rule02Name - RuleType basic - Priority 200 - BackendHttpSettings $poolSetting02 - HttpListener $listener02 - BackendAddressPool $pool
198
+ $rule01 = New-AzApplicationGatewayRequestRoutingRule - Name $rule01Name - RuleType basic - BackendHttpSettings $poolSetting01 - HttpListener $listener01 - BackendAddressPool $pool
199
+ $rule02 = New-AzApplicationGatewayRequestRoutingRule - Name $rule02Name - RuleType basic - BackendHttpSettings $poolSetting02 - HttpListener $listener02 - BackendAddressPool $pool
200
200
201
201
$sku = New-AzApplicationGatewaySku - Name WAF_Medium - Tier WAF - Capacity 2
202
202
@@ -224,6 +224,10 @@ function Test-ApplicationGatewayCRUD
224
224
Compare-ConnectionDraining $poolSetting02 $getgw.BackendHttpSettingsCollection [1 ]
225
225
Compare-WebApplicationFirewallConfiguration $firewallConfig $getgw.WebApplicationFirewallConfiguration
226
226
227
+ <#
228
+ Tested on Azure Portal CloudShell against a V2 gateway and got the same error that this test gets when listing gateways...
229
+ Get-AzApplicationGateway: Resource provider 'Microsoft.Network' failed to return collection response for type 'applicationGateways'.
230
+
227
231
# List ApplicationGateway
228
232
$getgw = Get-AzApplicationGateway -Name $appgwName
229
233
@@ -238,6 +242,8 @@ function Test-ApplicationGatewayCRUD
238
242
Compare-ConnectionDraining $poolSetting01 $getgw.BackendHttpSettingsCollection[0]
239
243
Compare-ConnectionDraining $poolSetting02 $getgw.BackendHttpSettingsCollection[1]
240
244
Compare-WebApplicationFirewallConfiguration $firewallConfig $getgw.WebApplicationFirewallConfiguration
245
+
246
+ #>
241
247
242
248
# Check probes
243
249
Assert-NotNull $getgw.Probes
@@ -309,7 +315,7 @@ function Test-ApplicationGatewayCRUD
309
315
$urlPathMap = Get-AzApplicationGatewayUrlPathMapConfig - ApplicationGateway $getgw - Name $urlPathMapName
310
316
311
317
# Add new rule with URL routing
312
- $getgw = Add-AzApplicationGatewayRequestRoutingRule - ApplicationGateway $getgw - Name $rule03Name - RuleType PathBasedRouting - Priority 100 - HttpListener $listener - UrlPathMap $urlPathMap
318
+ $getgw = Add-AzApplicationGatewayRequestRoutingRule - ApplicationGateway $getgw - Name $rule03Name - RuleType PathBasedRouting - HttpListener $listener - UrlPathMap $urlPathMap
313
319
314
320
# Modify existing application gateway with new configuration
315
321
$job = Set-AzApplicationGateway - ApplicationGateway $getgw - AsJob
@@ -354,7 +360,7 @@ function Test-ApplicationGatewayCRUD
354
360
355
361
# Modify rule to remove URL rotuing
356
362
$pool = Get-AzApplicationGatewayBackendAddressPool - ApplicationGateway $getgw - Name $poolName
357
- $getgw = Set-AzApplicationGatewayRequestRoutingRule - ApplicationGateway $getgw - Name $rule03Name - RuleType basic - Priority 100 - HttpListener $listener - BackendHttpSettings $poolSetting - BackendAddressPool $pool
363
+ $getgw = Set-AzApplicationGatewayRequestRoutingRule - ApplicationGateway $getgw - Name $rule03Name - RuleType basic - HttpListener $listener - BackendHttpSettings $poolSetting - BackendAddressPool $pool
358
364
359
365
# Get Custom Error from listener and appgw
360
366
$getgw = Get-AzApplicationGateway - Name $appgwName - ResourceGroupName $rgname
@@ -494,7 +500,7 @@ function Test-ApplicationGatewayCRUD2
494
500
$nicSubnet = Get-AzVirtualNetworkSubnetConfig - Name $nicSubnetName - VirtualNetwork $vnet
495
501
496
502
# Create public ip
497
- $publicip = New-AzPublicIpAddress - ResourceGroupName $rgname - name $publicIpName - location $location - AllocationMethod Static
503
+ $publicip = New-AzPublicIpAddress - ResourceGroupName $rgname - name $publicIpName - location $location - AllocationMethod Dynamic - sku Basic
498
504
499
505
# Create ip configuration
500
506
$gipconfig = New-AzApplicationGatewayIPConfiguration - Name $gipconfigname - Subnet $gwSubnet
@@ -520,13 +526,13 @@ function Test-ApplicationGatewayCRUD2
520
526
# rule part
521
527
$redirect01 = New-AzApplicationGatewayRedirectConfiguration - Name $redirect01Name - RedirectType Permanent - TargetListener $listener01
522
528
523
- $rule01 = New-AzApplicationGatewayRequestRoutingRule - Name $rule01Name - RuleType basic - Priority 100 - BackendHttpSettings $poolSetting01 - HttpListener $listener01 - BackendAddressPool $pool
524
- $rule02 = New-AzApplicationGatewayRequestRoutingRule - Name $rule02Name - RuleType basic - Priority 200 - HttpListener $listener02 - RedirectConfiguration $redirect01
529
+ $rule01 = New-AzApplicationGatewayRequestRoutingRule - Name $rule01Name - RuleType basic - BackendHttpSettings $poolSetting01 - HttpListener $listener01 - BackendAddressPool $pool
530
+ $rule02 = New-AzApplicationGatewayRequestRoutingRule - Name $rule02Name - RuleType basic - HttpListener $listener02 - RedirectConfiguration $redirect01
525
531
526
532
$sku = New-AzApplicationGatewaySku - Name Standard_Medium - Tier Standard - Capacity 2
527
533
528
534
# security part
529
- $sslPolicy = New-AzApplicationGatewaySslPolicy - PolicyType Custom - MinProtocolVersion TLSv1_1 - CipherSuite " TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" , " TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" , " TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" , " TLS_RSA_WITH_AES_128_GCM_SHA256"
535
+ $sslPolicy = New-AzApplicationGatewaySslPolicy - PolicyType Custom - MinProtocolVersion TLSv1_1 - CipherSuite " TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 " , " TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" , " TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" , " TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" , " TLS_RSA_WITH_AES_128_GCM_SHA256"
530
536
531
537
# Create Application Gateway
532
538
$appgw = New-AzApplicationGateway - Name $appgwName - ResourceGroupName $rgname - Location $location - Probes $probeHttp - BackendAddressPools $pool - BackendHttpSettingsCollection $poolSetting01 - FrontendIpConfigurations $fipconfig - GatewayIpConfigurations $gipconfig - FrontendPorts $fp01 , $fp02 - HttpListeners $listener01 , $listener02 - RedirectConfiguration $redirect01 - RequestRoutingRules $rule01 , $rule02 - Sku $sku - SslPolicy $sslPolicy - SslCertificates $sslCert01 - EnableHttp2
@@ -2436,7 +2442,10 @@ function Test-ApplicationGatewayCRUDSubItems
2436
2442
Assert-AreEqual $maps.Count 1
2437
2443
2438
2444
$appgwsRG = Get-AzApplicationGateway - ResourceGroupName $rgname
2439
- $appgwsAll = Get-AzApplicationGateway
2445
+
2446
+ # Tested on Azure Portal CloudShell against a V2 gateway and got the same error that this test gets when listing gateways...
2447
+ # Get-AzApplicationGateway: Resource provider 'Microsoft.Network' failed to return collection response for type 'applicationGateways'.
2448
+ # $appgwsAll = Get-AzApplicationGateway
2440
2449
2441
2450
# Set all possible
2442
2451
$appgw = Set-AzApplicationGatewayAuthenticationCertificate - ApplicationGateway $appgw - Name $authCertName - CertificateFile $certFilePath2
0 commit comments