Study guide

5.2 Azure Application Gateway Architecture & Routing

Designing and Implementing Microsoft Azure Networking Solutions AZ-700

Track your progress as you read

Finished sections get a check mark.

1 Introduction & AZ-700 Exam Overview

0.1 About the AZ-700 Exam: Format, Scoring & Skills Measured

2 Chapter 1: Azure Virtual Networks, Addressing & Subnet Architecture

1.1 VNet Planning, IP Addressing & Subnet Design 1.2 Virtual Network Peering & Global Peering 1.3 Azure NAT Gateway & Outbound Connectivity 1.4 Azure Virtual Network Manager (AVNM) & Network Groups 1.5 Public IP Addresses, Public IP Prefixes & Custom IP Prefixes (BYOIP)

3 Chapter 2: Azure Name Resolution & Core Routing

2.1 Azure DNS & Private DNS Zones 2.2 Azure Private DNS Resolver & Hybrid Name Resolution 2.3 System Routes & User-Defined Routes (UDR) 2.4 BGP & Custom Route Propagation 2.5 Azure Route Server & Dynamic NVA Route Exchange

4 Chapter 3: Hybrid Connectivity with Azure VPN Gateway

3.1 Azure VPN Gateway Architecture & SKUs 3.2 Site-to-Site (S2S) VPN & High Availability 3.3 Point-to-Site (P2S) VPN & Client Authentication 3.4 Azure Extended Network, Always On VPN & Azure Network Adapter

5 Chapter 4: Azure ExpressRoute & Virtual WAN

4.1 Azure ExpressRoute Architecture & Peering Models 4.2 ExpressRoute Routing, Resiliency & Global Reach 4.3 Azure Virtual WAN Architecture & Hub Routing 4.4 ExpressRoute BFD, Monitoring & Connection Troubleshooting

6 Chapter 5: Regional Load Balancing & Application Gateway

5.1 Azure Load Balancer Architecture & Rules 5.2 Azure Application Gateway Architecture & Routing 5.3 Web Application Firewall (WAF) on Application Gateway 5.4 Inbound NAT Rules, Port Forwarding & Health Probe Design

7 Chapter 6: Global Traffic Management & Azure Front Door

6.1 Azure Front Door Architecture & Routing 6.2 Azure Traffic Manager & DNS Load Balancing 6.3 Load Balancing Decision Matrix & Multi-Tier Design 6.4 Web Application Firewall on Azure Front Door

8 Chapter 7: Azure Private Link & Service Endpoints

7.1 Virtual Network Service Endpoints & Policies 7.2 Azure Private Endpoints & Private Link Architecture 7.3 Private Endpoint DNS Integration & Hybrid Resolution 7.4 Azure Private Link Service for Multi-Tenant Solutions

9 Chapter 8: Network Security Groups & Azure Bastion

8.1 Network Security Groups (NSGs) & Application Security Groups (ASGs) 8.2 Azure Bastion Architecture & Secure Remote Access 8.3 Azure Virtual Network Manager Security Admin Rules

10 Chapter 9: Azure Firewall & Security Policies

9.1 Azure Firewall Architecture & Rule Processing 9.2 Azure Firewall Manager & DDoS Protection

11 Chapter 10: Azure Network Observability & Troubleshooting

10.1 Network Watcher Diagnostic Tools 10.2 NSG Flow Logs, VNet Flow Logs & Traffic Analytics 10.3 Network Troubleshooting Scenarios & End-to-End Connectivity 10.4 Azure Monitor Network Insights & Defender for Cloud Network Posture

5.2 Azure Application Gateway Architecture & Routing

Key Takeaways Explain This Topic AI

Azure Application Gateway is a dedicated Layer 7 Application Delivery Controller (ADC) reverse proxy supporting HTTP, HTTPS, HTTP/2, and WebSocket traffic.

Application Gateway v2 (Standard_v2 and WAF_v2) supports autoscaling (0 to 125 Capacity Units), multi-Availability Zone redundancy, faster provisioning (6-7 minutes), and Key Vault integration for TLS certificates.

Listeners can be Basic (single domain/IP) or Multi-site (multiple hostnames via SNI/Host headers, including wildcards like *.contoso.com).

Routing rules evaluate traffic using Basic Routing (direct to backend pool) or Path-Based Routing (URL Path Maps evaluated with longest prefix / exact match priority, e.g., /images/* or /api/*).

End-to-End TLS requires TLS termination at the frontend listener with a server certificate and re-encryption to the backend with trusted public CAs or uploaded enterprise Root/Intermediate CA certificates.

Last updated: August 2026

Azure Application Gateway Architecture & Routing

Azure Application Gateway is a dedicated, fully managed Layer 7 (Application Layer) Application Delivery Controller (ADC) and reverse proxy. Unlike Azure Load Balancer which routes packets at Layer 4 without inspecting application data, Application Gateway terminates incoming client TCP connections, evaluates HTTP/HTTPS request headers, hostnames, and URI paths, and makes intelligent routing decisions before proxying requests to backend targets.

Application Gateway delivers enterprise application delivery capabilities including SSL/TLS termination , cookie-based session affinity , URL path-based routing , multi-site hosting , URL and header rewrites , and integrated Web Application Firewall (WAF) protection.

1. Application Gateway v2 SKU Architecture & Sizing

The modern standard for Application Gateway is the v2 SKU (available as Standard_v2 and WAF_v2 ). The legacy v1 SKU ( Standard and WAF ) has been deprecated.

Capability Application Gateway v2 ( Standard_v2 / WAF_v2 ) Legacy v1 SKU (Deprecated)

Autoscaling Supported: Dynamic scaling from 0 to 125 Capacity Units based on traffic Fixed instance count (1 to 32)

Zone Redundancy Multi-zone support: Instances span Zones 1, 2, and 3 automatically Not zone-redundant

Performance & Provisioning Fast provisioning (6–7 minutes); up to 5x higher TLS offload performance Slow provisioning (20–25 minutes)

Frontend IP Allocations Static Public IP only (Standard SKU Public IP) Dynamic or Static IP

TLS Certificate Storage Direct integration with Azure Key Vault (auto-renewal via Managed Identity) Manual PFX upload only

  • Header & URL Rewrite Supported natively in routing pipeline Not supported in v1
  • Mutual TLS (mTLS) Supported (Client Certificate Authentication) Not supported in v1
  • Subnet Requirements & Sizing Calculations

Application Gateway requires a dedicated subnet within your Virtual Network:

No other Azure compute resources (such as standard VMs, App Service environments, or Azure Bastion) can reside inside the Application Gateway subnet.

The subnet minimum size is /28 (16 total IP addresses, yielding 11 usable addresses).

Recommended Enterprise Sizing: Allocate a /26 (64 total IPs) or /24 (256 total IPs) subnet. When autoscaling is configured, Application Gateway provisions internal virtual machine instances to handle load surges. A /28 subnet restricts maximum autoscaling capacity units during peak traffic spikes.

Autoscaling Capacity Units (CU)

Application Gateway v2 scales automatically based on Capacity Units (CU) . A single Capacity Unit represents:

Compute Unit: Processing capability (CPU consumption per request/rule evaluation).

Persistent Connections: Up to 2,500 persistent connections per CU.

Throughput: Up to 2.22 Mbps of data transfer per CU.

TLS Offload: Up to 50 new SSL/TLS connections per second per CU (using RSA 2048-bit keys).

Loading diagram... Application Gateway v2 Request Flow: Listeners, URL Path Routing, and Backend Settings

2. Frontend IP Configurations & Listeners

Incoming traffic enters Application Gateway through a Frontend IP Configuration and is evaluated by one or more Listeners .

Frontend Configurations

Application Gateway v2 supports:

Public Frontend IP: Binds a static Standard Public IP address for Internet-facing web traffic.

Private Frontend IP: Binds a private IP address from the gateway subnet for internal Intranet traffic.

Dual Frontend: Concurrently binds both a Public IP and a Private IP to serve both external Internet users and internal corporate clients on distinct listeners.

Listener Types

A Listener checks for incoming connection requests matching a specific IP, port, protocol, and hostname: +-----------------------------------------------------------------------------+

  • | LISTENER ARCHITECTURE TYPES |
  • | |
  • | 1. BASIC LISTENER: |
  • | Frontend IP (52.183.40.10) + Port 443 |
  • | --> Accepts ALL incoming requests regardless of Host header |
  • | |
  • | 2. MULTI-SITE LISTENER (SNI & HOST HEADER ROUTING): |
  • | Frontend IP (52.183.40.10) + Port 443 |
  • | +---> Host: shop.contoso.com --> Uses SSL Cert A --> Shop Rule |
  • | +---> Host: blog.contoso.com --> Uses SSL Cert B --> Blog Rule |
  • | +---> Host: *.partner.com --> Wildcard Cert C --> Partner Rule |
  • +-----------------------------------------------------------------------------+

Basic Listener: Listens on a single port and IP. It accepts all incoming requests regardless of the HTTP host header. Typically used when Application Gateway hosts a single application or behind a dedicated load balancing domain.

Multi-Site Listener: Listens on a single public IP and port (e.g., 443) but routes traffic for multiple domain names (e.g., shop.contoso.com , finance.contoso.com , *.internal.contoso.com ).

Uses Server Name Indication (SNI) during the TLS handshake to present the correct SSL certificate corresponding to the requested hostname.

Evaluates the HTTP Host: header to associate the request with the appropriate routing rule.

Supports exact hostnames and wildcard hostnames (e.g., *.contoso.com ).

3. Routing Rules: Basic vs. Path-Based Routing

Routing rules bind a Listener to a Backend Pool and a set of Backend Settings (HTTP Settings) .

Basic Routing Rules

A Basic Routing Rule forwards all traffic arriving at the associated listener directly to a single designated backend pool without inspecting URI paths.

Path-Based Routing Rules (URL Path Maps)

A Path-Based Routing Rule evaluates the URL path of the incoming request and routes to different backend pools and backend settings:

Path Pattern Matching:

/images/* or /media/* → \rightarrow → Routes to Image Storage / CDN Backend Pool.

/api/* or /auth/* → \rightarrow → Routes to Microservices Container / VMSS Backend Pool.

/* (Default Path) → \rightarrow → Routes unmatched traffic to Default Web App Backend Pool.

Path Evaluation Precedence:

Exact String Matches (e.g., /api/v1/health ) are evaluated first.

Longest Prefix Wildcard Matches (e.g., /api/v1/* takes precedence over /api/* ).

Default Backend Pool handles all requests that do not match any path rule.

  • 4. Backend Pools & Backend Settings (HTTP Settings)
  • Supported Backend Pool Targets

A backend pool defines the collection of servers servicing incoming client requests. Application Gateway supports heterogeneous backend target types:

IPv4 / IPv6 IP Addresses: Virtual machines in the same VNet, peered VNets, or on-premises datacenters reachable via VPN or ExpressRoute.

Fully Qualified Domain Names (FQDN): Public or private domain endpoints.

Azure App Services: Multi-tenant Azure App Services and Azure Functions.

Virtual Machine Scale Sets (VMSS): Auto-registered VMSS network interfaces.

Backend Settings (HTTP Settings / Backend HTTP Configuration)

Backend settings control how Application Gateway proxies the connection from the gateway to the backend instances: +-----------------------------------------------------------------------------+

  • | BACKEND SETTINGS MECHANICS |
  • | |
  • | Client ====== (HTTPS 443) ======> [ Application Gateway ] |
  • | | |
  • | Backend Settings Parameters: | (Proxy Connection) |
  • | - Backend Protocol: HTTP or HTTPS | |
  • | - Cookie-Based Affinity: ARRAffinity | |
  • | - Connection Draining: 300 seconds v |
  • | - Request Timeout: 60 seconds [ Backend Target ] |
  • | - Pick Host Name from Backend Address (App Service FQDN matching) |
  • +-----------------------------------------------------------------------------+

Setting Parameter Function & Operational Rule

Backend Protocol & Port Specifies the protocol (HTTP or HTTPS) and port (e.g., 80, 443, 8080) used to communicate with the backend servers.

Cookie-Based Affinity When enabled, Application Gateway injects a gateway-managed cookie ( ARRAffinity or custom name) into the client response. Subsequent client requests containing this cookie are pinned to the same backend server instance.

Connection Draining Allows backend instances undergoing maintenance or scale-in events to be gracefully deregistered. In-flight requests are allowed to complete until the draining timeout expires (Configurable from 1 to 3,600 seconds ; Default: 0 / Disabled).

Request Timeout The maximum time Application Gateway waits for a response from the backend target before returning an HTTP 504 Gateway Timeout error (Default: 20 seconds ; Range: 1 to 86,400 seconds).

Host Name Override Modifies the HTTP Host: header sent to the backend. Crucial when routing to Azure App Service ( Pick host name from backend address ) to prevent 404 Site Not Found errors.

Custom Health Probe Association Binds an active custom health probe to validate backend reachability.

5. TLS Termination & End-to-End TLS Encryption

Application Gateway provides enterprise SSL/TLS offloading and full cryptographic compliance across its proxy architecture. +-----------------------------------------------------------------------------+

  • | TLS TERMINATION vs. END-TO-END TLS ENCRYPTION |
  • | |
  • | 1. TLS TERMINATION (SSL Offloading): |
  • | Client === (HTTPS / Encrypted) ===> [ App Gateway ] === (HTTP / Plain) ===> [ Backend VMs ]
  • | (Reduces CPU overhead on backend VMs; unencrypted inside VNet) |
  • | |
  • | 2. END-TO-END TLS ENCRYPTION: |
  • | Client === (HTTPS / Encrypted) ===> [ App Gateway ] === (HTTPS / Encrypted) ===> [ Backend VMs ]
  • | (Gateway decrypts for WAF/routing inspection, then re-encrypts) |
  • +-----------------------------------------------------------------------------+
  • 1. TLS Termination (SSL Offload)

Client sends HTTPS traffic to Application Gateway.

Application Gateway decrypts the traffic using its frontend SSL certificate.

The gateway routes the decrypted plaintext HTTP traffic to backend servers over private VNet subnets.

Advantage: Eliminates cryptographic overhead on backend compute instances.

2. End-to-End TLS Encryption

Required for stringent regulatory standards (PCI-DSS, HIPAA, FedRAMP) where plaintext transmission inside the cloud perimeter is prohibited.

Application Gateway terminates the initial client TLS session, performs Layer 7 inspection and WAF rule processing, and then establishes a second, independent TLS session to the backend instance.

Certificate Management in Application Gateway v2

Frontend Certificates: Stored securely in Azure Key Vault . Application Gateway uses a User-Assigned Managed Identity to poll Key Vault for certificate updates, enabling automatic SSL certificate renewal without downtime.

Backend Authentication Certificates:

If the backend uses certificates signed by well-known public Certificate Authorities (CAs) (e.g., DigiCert, Let's Encrypt), no certificate upload to Application Gateway is required.

If the backend uses certificates signed by an internal Enterprise Private CA , the public Root CA or Intermediate CA certificate ( .cer format) must be uploaded to the Backend Settings as a Trusted Root Certificate .

SNI / Host Header Validation: The Common Name (CN) or Subject Alternative Name (SAN) on the backend certificate must match the host name configured in the Backend Setting (or overridden via Pick host name from backend address ).

6. URL Rewrite & HTTP Header Modifications

Application Gateway v2 can dynamically rewrite HTTP request and response headers, as well as rewrite URI paths and query strings, before packets reach the client or backend.

Common Rewrite Use Cases

Security Header Injection: Automatically inject security response headers such as Strict-Transport-Security (HSTS), X-Content-Type-Options: nosniff , X-Frame-Options: DENY , and Content-Security-Policy .

Sensitive Header Stripping: Remove backend information headers such as Server: Microsoft-IIS/10.0 or X-Powered-By: ASP.NET to prevent server fingerprinting.

URL Path Manipulation: Transparently rewrite legacy client URLs (e.g., /v1/products?id=42 ) to modern microservice endpoints (e.g., /api/v2/catalog/42 ) without issuing an HTTP 301/302 redirect.

Client IP Identification: Inject or preserve headers such as X-Forwarded-For , X-Forwarded-Proto , and X-Forwarded-Port so backend services identify the true client public IP.