- Knowledge Base
- Microsoft Azure
- Application Gateway
- Enable HTTP/2 Support for Application Gateways
Ensure that HTTP/2 support is enabled for Microsoft Azure Application Gateways in order to benefit from the performance enhancements introduced by the HTTP/2 protocol. In Azure Application Gateway, HTTP/2 is available to clients that connect to gateway listeners only. The communication to backend server pools is done over HTTP/1.1.
efficiency
Enabling HTTP/2 protocol support for Azure Application Gateways improves performance by reducing latency, enabling multiplexed streams over a single connection, and allowing for faster data transfer. It also provides better resource efficiency, as multiple requests can be handled simultaneously over the same connection, reducing connection overhead.
Audit
To determine if HTTP/2 support is enabled for your Microsoft Azure Application Gateways, perform the following operations:
Using Azure Portal
01 Sign in to the Microsoft Azure Portal.
02 Navigate to All resources blade available at https://portal.azure.com/#browse/all to access all your Microsoft Azure cloud resources.
03 Choose the Azure subscription that you want to access from the Subscription equals all filter box and choose Apply.
04 From the Type equals all filter box, select Type for Filter, Equals for Operator, and Application gateway for Value, then choose Apply to list the Azure Application Gateways available in the selected subscription.
05 Click on the name (link) of the Azure Application Gateway that you want to examine.
06 In the resource navigation panel, under Settings, select Configuration to access the general configuration settings available for the selected Application Gateway.
07 Check the HTTP2 setting status to determine if the support for HTTP/2 protocol is enabled for the selected resource. If HTTP2 is set to Disabled, HTTP/2 protocol support is not enabled for the selected Microsoft Azure Application Gateway.
08 Repeat steps no. 5 – 7 for each Azure Application Gateway available in the selected subscription.
09 Repeat steps no. 3 – 8 for each subscription created in your Microsoft Azure cloud account.
Using Azure CLI
01 Run account list command (Windows/macOS/Linux) with custom output filters to list the IDs of the cloud subscriptions available in your Azure cloud account:
az account list --query '[*].id'
02 The command output should return the requested subscription identifiers (IDs):
[ "abcdabcd-1234-abcd-1234-abcdabcdabcd", "abcd1234-abcd-1234-abcd-abcd1234abcd" ]
03 Run account set command (Windows/macOS/Linux) with the ID of the Azure cloud subscription that you want to examine as the identifier parameter to set the selected subscription to be the current active subscription (the command does not produce an output):
az account set --subscription abcdabcd-1234-abcd-1234-abcdabcdabcd
04 Run network application-gateway list command (Windows/macOS/Linux) with custom output filters to list the ID of each Azure Application Gateway available in the selected subscription:
az network application-gateway list --query '[*].id'
05 The command output should return the requested Application Gateway IDs:
[ "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/applicationGateways/cc-project5-application-gateway", "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/applicationGateways/cc-prod-stack-application-gateway" ]
06 Run network application-gateway show command (Windows/macOS/Linux) with the name of the Azure Application Gateway that you want to examine as the identifier parameter and custom output filters to determine if the support for HTTP/2 protocol is enabled for the selected Application Gateway:
az network application-gateway show --ids "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/applicationGateways/cc-project5-application-gateway" --query 'enableHttp2'
07 The command output should return the HTTP/2 feature status (true for enabled, false for disabled):
false
If the network application-gateway show command output returns false, as shown in the example above, HTTP/2 protocol support is not enabled for the selected Microsoft Azure Application Gateway.
08 Repeat steps no. 6 and 7 for each Azure Application Gateway deployed in the selected Azure subscription.
09 Repeat steps no. 3 – 8 for each subscription created in your Microsoft Azure cloud account.
Remediation / Resolution
To ensure that HTTP/2 support is enabled for your Microsoft Azure Application Gateways, perform the following operations:
Using Azure Portal
01 Sign in to the Microsoft Azure Portal.
02 Navigate to All resources blade available at https://portal.azure.com/#browse/all to access all your Microsoft Azure cloud resources.
03 Choose the Azure subscription that you want to access from the Subscription equals all filter box and choose Apply.
04 From the Type equals all filter box, select Type for Filter, Equals for Operator, and Application gateway for Value, then choose Apply to list the Azure Application Gateways available in the selected subscription.
05 Click on the name (link) of the Azure Application Gateway that you want to configure.
06 In the resource navigation panel, under Settings, select Configuration to access the general configuration settings available for the selected Application Gateway.
07 On the Configuration page, select Enabled under HTTP2 to enable HTTP/2 protocol support for the selected Azure Application Gateway. Choose Save to apply the changes.
08 Repeat steps no. 5 – 7 for each Azure Application Gateway that you want to configure, available within the selected Azure subscription.
09 Repeat steps no. 3 – 8 for each subscription created in your Microsoft Azure cloud account.
Using Azure CLI
01 Run account list command (Windows/macOS/Linux) with custom output filters to list the IDs of the cloud subscriptions available in your Azure cloud account:
az account list --query '[*].id'
02 The command output should return the requested subscription identifiers (IDs):
[ "abcdabcd-1234-abcd-1234-abcdabcdabcd", "abcd1234-abcd-1234-abcd-abcd1234abcd" ]
03 Run account set command (Windows/macOS/Linux) with the ID of the Azure cloud subscription that you want to examine as the identifier parameter to set the selected subscription to be the current active subscription (the command does not produce an output):
az account set --subscription abcdabcd-1234-abcd-1234-abcdabcdabcd
04 Run network application-gateway update command (Windows/macOS/Linux) to enable HTTP/2 protocol support for the selected Azure Application Gateway:
az network application-gateway update --ids "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/applicationGateways/cc-project5-application-gateway" --http2 Enabled
05 The command output should return the configuration information available for the updated Application Gateway:
{
"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/applicationGateways/cc-project5-application-gateway",
"location": "westeurope",
"name": "cc-project5-application-gateway",
"operationalState": "Running",
"probes": [],
"provisioningState": "Succeeded",
"redirectConfigurations": [],
"enableHttp2": true,
"requestRoutingRules": [
{
"backendAddressPool": {
"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/applicationGateways/cc-project5-application-gateway/backendAddressPools/cc-project5-backend",
"resourceGroup": "cloud-shell-storage-westeurope"
},
"backendHttpSettings": {
"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/applicationGateways/cc-project5-application-gateway/backendHttpSettingsCollection/cc-backend-settings",
"resourceGroup": "cloud-shell-storage-westeurope"
},
"httpListener": {
"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/applicationGateways/cc-project5-application-gateway/httpListeners/cc-http-listener",
"resourceGroup": "cloud-shell-storage-westeurope"
},
"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Network/applicationGateways/cc-project5-application-gateway/requestRoutingRules/cc-main-routing-rule",
"name": "cc-main-routing-rule",
"priority": 1,
"provisioningState": "Succeeded",
"resourceGroup": "cloud-shell-storage-westeurope",
"ruleType": "Basic",
"type": "Microsoft.Network/applicationGateways/requestRoutingRules"
}
],
"resourceGroup": "cloud-shell-storage-westeurope",
"resourceGuid": "abcd1234-abcd-1234-abcd-abcd1234abcd",
"rewriteRuleSets": [],
"sku": {
"capacity": 1,
"family": "Generation_1",
"name": "Basic",
"tier": "Basic"
},
"sslCertificates": [],
"tags": {},
"trustedRootCertificates": [],
"type": "Microsoft.Network/applicationGateways",
"urlPathMaps": [],
"zones": [
"1",
"2",
"3"
]
}
06 Repeat steps no. 4 and 5 for each Azure Application Gateway account that you want to configure, available within the selected subscription.
07 Repeat steps no. 3 – 6 for each Azure subscription created within your Microsoft Azure cloud account.
References
- Azure Official Documentation
- Azure Application Gateway features
- Application gateway components
- Azure Command Line Interface (CLI) Documentation
- az account list
- az account set
- az network application-gateway list
- az network application-gateway show
- az network application-gateway update