Skip to content

Commit d29ce74

Browse files
authored
Merge pull request Azure#5022 from akshaysngupta/preview
[Network] EnableHttp2 flag in Application Gateway
2 parents 58c01c4 + b233c52 commit d29ce74

File tree

7 files changed

+3198
-1706
lines changed

7 files changed

+3198
-1706
lines changed

src/ResourceManager/Network/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
* Added -AsJob support for long-running Network cmdlets. Allows selected cmdlets to run in the background and return a job to track and control progress.
2626
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
2727
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription
28+
* Added EnableHttp2 flag to Application Gateway
29+
- Updated New-AzureRmApplicationGateway: Added optional parameter -EnableHttp2
2830

2931
## Version 5.0.0
3032
* NOTE: This is a breaking change release. Please see the migration guide (https://aka.ms/azps-migration-guide) for a full list of breaking changes introduced.

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/ApplicationGatewayTests.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ function Test-ApplicationGatewayCRUD2
415415
$sslPolicy = New-AzureRmApplicationGatewaySslPolicy -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"
416416

417417
# Create Application Gateway
418-
$appgw = New-AzureRmApplicationGateway -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
418+
$appgw = New-AzureRmApplicationGateway -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
419419

420420
# Check get/set/remove for RedirectConfiguration
421421
$redirect02 = Get-AzureRmApplicationGatewayRedirectConfiguration -ApplicationGateway $appgw -Name $redirect01Name
@@ -425,6 +425,9 @@ function Test-ApplicationGatewayCRUD2
425425
$getgw = Add-AzureRmApplicationGatewayRedirectConfiguration -ApplicationGateway $getgw -Name $redirect03Name -RedirectType Permanent -TargetListener $listener01 -IncludePath $true
426426
$getgw = Remove-AzureRmApplicationGatewayRedirectConfiguration -ApplicationGateway $getgw -Name $redirect03Name
427427

428+
# Check EnableHttp2 flag is true
429+
Assert-AreEqual $getgw.EnableHttp2 $true
430+
428431
# Get for SslPolicy
429432
$sslPolicy01 = Get-AzureRmApplicationGatewaySslPolicy -ApplicationGateway $getgw
430433
Assert-AreEqual $sslPolicy.MinProtocolVersion $sslPolicy01.MinProtocolVersion
@@ -452,8 +455,12 @@ function Test-ApplicationGatewayCRUD2
452455
$getgw = Add-AzureRmApplicationGatewaySslCertificate -ApplicationGateway $getgw -Name $sslCert02Name -CertificateFile $sslCert02Path -Password $pw02
453456

454457
# Modify existing application gateway with new configuration
458+
$getgw.EnableHttp2 = $false
455459
$getgw = Set-AzureRmApplicationGateway -ApplicationGateway $getgw
456460

461+
# Check EnableHttp2 flag is false
462+
Assert-AreEqual $getgw.EnableHttp2 $false
463+
457464
Assert-AreEqual "Running" $getgw.OperationalState
458465

459466
# Check SSLCertificates again

src/ResourceManager/Network/Commands.Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.ApplicationGatewayTests/TestApplicationGatewayCRUD2.json

Lines changed: 3154 additions & 1704 deletions
Large diffs are not rendered by default.

src/ResourceManager/Network/Commands.Network/ApplicationGateway/NewAzureApplicationGatewayCommand.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ public class NewAzureApplicationGatewayCommand : ApplicationGatewayBaseCmdlet
144144
HelpMessage = "Firewall configuration")]
145145
public virtual PSApplicationGatewayWebApplicationFirewallConfiguration WebApplicationFirewallConfiguration { get; set; }
146146

147+
[Parameter(
148+
Mandatory = false,
149+
HelpMessage = " Whether HTTP2 is enabled.")]
150+
public SwitchParameter EnableHttp2 { get; set; }
151+
147152
[Parameter(
148153
Mandatory = false,
149154
ValueFromPipelineByPropertyName = true,
@@ -256,6 +261,11 @@ private PSApplicationGateway CreateApplicationGateway()
256261
applicationGateway.WebApplicationFirewallConfiguration = this.WebApplicationFirewallConfiguration;
257262
}
258263

264+
if (this.EnableHttp2.IsPresent)
265+
{
266+
applicationGateway.EnableHttp2 = true;
267+
}
268+
259269
// Normalize the IDs
260270
ApplicationGatewayChildResourceHelper.NormalizeChildResourcesId(applicationGateway);
261271

src/ResourceManager/Network/Commands.Network/Models/PSApplicationGateway.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public class PSApplicationGateway : PSTopLevelResource
5050

5151
public PSApplicationGatewayWebApplicationFirewallConfiguration WebApplicationFirewallConfiguration { get; set; }
5252

53+
public bool? EnableHttp2 { get; set; }
54+
5355
public string OperationalState { get; private set; }
5456

5557
public string ProvisioningState { get; set; }

src/ResourceManager/Network/Commands.Network/help/New-AzureRmApplicationGateway.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ New-AzureRmApplicationGateway -Name <String> -ResourceGroupName <String> -Locati
2929
-RequestRoutingRules <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayRequestRoutingRule]>
3030
[-RedirectConfigurations <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayRedirectConfiguration]>]
3131
[-WebApplicationFirewallConfiguration <PSApplicationGatewayWebApplicationFirewallConfiguration>]
32-
[-Tag <Hashtable>] [-Force] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
32+
[-EnableHttp2] [-Tag <Hashtable>] [-Force] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
3333
[<CommonParameters>]
3434
```
3535

@@ -174,6 +174,21 @@ Accept pipeline input: False
174174
Accept wildcard characters: False
175175
```
176176
177+
### -EnableHttp2
178+
Whether HTTP2 is enabled.
179+
180+
```yaml
181+
Type: SwitchParameter
182+
Parameter Sets: (All)
183+
Aliases:
184+
185+
Required: False
186+
Position: Named
187+
Default value: None
188+
Accept pipeline input: True (ByPropertyName)
189+
Accept wildcard characters: False
190+
```
191+
177192
### -Force
178193
Forces the command to run without asking for user confirmation.
179194

src/ResourceManager/Network/Network.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Graph.RBAC"
5050
EndProject
5151
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Network", "..\..\Common\Commands.Common.Network\Commands.Common.Network.csproj", "{1338F7AE-7111-4ED3-8916-2D0FECC876F4}"
5252
EndProject
53+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Strategies", "..\Common\Commands.Common.Strategies\Commands.Common.Strategies.csproj", "{EEA69772-D41B-482A-9252-2B4595C59E53}"
54+
EndProject
5355
Global
5456
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5557
Debug|Any CPU = Debug|Any CPU
@@ -147,6 +149,10 @@ Global
147149
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
148150
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
149151
{1338F7AE-7111-4ED3-8916-2D0FECC876F4}.Release|Any CPU.Build.0 = Release|Any CPU
152+
{EEA69772-D41B-482A-9252-2B4595C59E53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
153+
{EEA69772-D41B-482A-9252-2B4595C59E53}.Debug|Any CPU.Build.0 = Debug|Any CPU
154+
{EEA69772-D41B-482A-9252-2B4595C59E53}.Release|Any CPU.ActiveCfg = Release|Any CPU
155+
{EEA69772-D41B-482A-9252-2B4595C59E53}.Release|Any CPU.Build.0 = Release|Any CPU
150156
EndGlobalSection
151157
GlobalSection(SolutionProperties) = preSolution
152158
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)