Azure Application Gateway

The Azure Application Gateway is a web traffic load balancer that enables you to manage traffic to your web applications. It operates at the application layer (OSI layer 7) and provides features such as SSL termination, cookie-based session affinity, URL‑based routing, and a web application firewall (WAF).

Key Features

  • Layer‑7 Load Balancing: Route traffic based on URL paths and host headers.
  • SSL Termination: Offload SSL decryption to the gateway.
  • Web Application Firewall: Protect against OWASP Top 10 vulnerabilities.
  • Autoscaling: Scale instances automatically based on traffic.
  • Redirection & Rewrite: Implement HTTP to HTTPS redirects and URL rewrites.

Getting Started

Follow these steps to create an Application Gateway via the Azure portal.

  1. Navigate to Create a resource → Networking → Application Gateway.
  2. Configure the basic settings: name, region, and resource group.
  3. Select the SKU (Standard_v2 or WAF_v2) and set the instance count.
  4. Create a virtual network or select an existing one for the gateway subnet.
  5. Configure front‑end IP (public or private) and listeners (HTTPS/HTTP).
  6. Define backend pools, health probes, and routing rules.
  7. Review and create the gateway.

{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [ { "type": "Microsoft.Network/applicationGateways", "apiVersion": "2022-05-01", "name": "myAppGateway", "location": "eastus", "properties": { "sku": { "name": "WAF_v2", "tier": "WAF", "capacity": 2 }, "gatewayIPConfigurations": [ { "name": "appGatewayIpConfig", "properties": { "subnet": { "id": "[variables('subnetRef')]" } } } ], "frontendIPConfigurations": [ { "name": "appGatewayFrontendIP", "properties": { "publicIPAddress": { "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIpName'))]" } } } ], "frontendPorts": [{ "name": "port80", "properties": { "port": 80 } }], "backendAddressPools": [{ "name": "appGatewayBackendPool", "properties": { "backendAddresses": [{ "ipAddress": "10.0.1.4" }, { "ipAddress": "10.0.1.5" }] } }], "backendHttpSettingsCollection": [{ "name": "appGatewayBackendHttpSettings", "properties": { "port": 80, "protocol": "Http", "cookieBasedAffinity": "Disabled" } }], "httpListeners": [{ "name": "appGatewayHttpListener", "properties": { "frontendIPConfiguration": { "id": "[concat(resourceId('Microsoft.Network/applicationGateways', 'myAppGateway'), '/frontendIPConfigurations/appGatewayFrontendIP')]" }, "frontendPort": { "id": "[concat(resourceId('Microsoft.Network/applicationGateways', 'myAppGateway'), '/frontendPorts/port80')]" }, "protocol": "Http" } }], "requestRoutingRules": [{ "name": "rule1", "properties": { "ruleType": "Basic", "httpListener": { "id": "[concat(resourceId('Microsoft.Network/applicationGateways', 'myAppGateway'), '/httpListeners/appGatewayHttpListener')]" }, "backendAddressPool": { "id": "[concat(resourceId('Microsoft.Network/applicationGateways', 'myAppGateway'), '/backendAddressPools/appGatewayBackendPool')]" }, "backendHttpSettings": { "id": "[concat(resourceId('Microsoft.Network/applicationGateways', 'myAppGateway'), '/backendHttpSettingsCollection/appGatewayBackendHttpSettings')]" } } }] } } ] }

SKUTierBase Rate (per hour)Features
Standard_v2Standard$0.025Autoscaling, Zone redundancy
WAF_v2WAF$0.037All Standard features + WAF

Further Reading