Application Gateway Architecture
Azure Application Gateway is a web traffic load balancer that enables you to manage traffic to your web applications. It offers various Layer 7 load balancing capabilities for applications. Understanding its architecture is crucial for designing scalable, secure, and highly available web solutions on Azure.
Core Components and Data Flow
Application Gateway consists of several key components that work together to route and manage incoming traffic:
- Frontend IP Configuration: The public or private IP address that clients connect to.
- Listeners: This component checks for incoming requests based on the configured IP address, port, and protocol (HTTP or HTTPS).
- Rules: The logic that directs how the application gateway routes traffic to the backend pools. This can be path-based routing or host-based routing.
- HTTP Settings: These settings define how Application Gateway forwards requests to the backend targets. This includes protocol (HTTP/HTTPS), port, and cookie-based session affinity.
- Backend Pools: A collection of servers (virtual machines, virtual machine scale sets, web apps, or IP addresses) that host your application.
- Health Probes: Custom probes that Application Gateway uses to monitor the health of backend instances.
- Backend Health: Application Gateway monitors the health of backend instances using health probes to ensure traffic is only sent to healthy servers.

Conceptual diagram of Azure Application Gateway data flow.
The data flow typically starts with a client request reaching the frontend IP address. The listener matches the request's protocol, port, and host. The routing rules then determine which backend pool the request should be sent to. HTTP settings are applied, and health probes ensure that the chosen backend instance is healthy before the request is forwarded.
Key Architectural Concepts
High Availability and Scalability
Application Gateway offers both high availability and scalability. You can configure it to run in an Active-Active mode, where traffic is distributed across multiple instances, providing redundancy. Scaling can be managed through:
- Manual Scaling: Manually adjust the instance count based on expected traffic.
- Autoscaling: Configure rules to automatically scale the number of instances up or down based on CPU or network traffic metrics.
Security Features
Application Gateway provides robust security features:
- Web Application Firewall (WAF): Protects your web applications from common web vulnerabilities and exploits.
- SSL/TLS Termination: Offloads SSL/TLS decryption from your backend servers, simplifying management and improving performance.
- End-to-End SSL/TLS Encryption: Ensures that traffic remains encrypted from the client all the way to the backend server.
Routing Capabilities
Application Gateway supports sophisticated routing mechanisms:
- Path-based Routing: Directs traffic to different backend pools based on the URL path of the request. For example,
/images/*
could go to one pool and/api/*
to another. - Host-based Routing: Allows you to route traffic to multiple web applications hosted on the same IP address based on the host header of the request (e.g.,
www.example.com
vs.blog.example.com
).
Deployment Models
Application Gateway can be deployed with:
- Public IP Address: For internet-facing applications.
- Private IP Address: For internal applications that are accessed only within your virtual network or via VPN/ExpressRoute.
By leveraging these architectural components and concepts, you can build resilient and performant web applications on Azure using Application Gateway.