Understanding Azure Application Gateway

Azure Application Gateway is a managed web traffic load balancer that enables you to manage traffic to your web applications. It provides Layer 7 load balancing capabilities, allowing for more sophisticated routing decisions based on attributes like request headers, URI paths, and query strings.

What is it?

Application Gateway is a cloud-native service that offers features such as SSL termination, cookie-based session affinity, Web Application Firewall (WAF), and multi-site hosting.

Key Features

Common Use Cases

Securing Web Applications

Utilize the WAF feature to protect against OWASP top 10 vulnerabilities like SQL injection and cross-site scripting (XSS).

Distributing Traffic for Scalability

Efficiently distribute incoming traffic across multiple instances of your web application for high availability and performance.

Managing Multiple Websites

Host several distinct websites or domains using a single Application Gateway instance, simplifying network management.

Architecture Overview

Application Gateway consists of the following components:

Important Note

Application Gateway operates at Layer 7 (the application layer), unlike Azure Load Balancer which operates at Layer 4 (the transport layer).

Configuration Basics

Configuring an Application Gateway typically involves defining:

  1. Frontend IP: Choose between a public or private IP address.
  2. Listeners: Set up HTTP or HTTPS listeners, specifying ports and hostnames for multi-site hosting.
  3. Backend Pools: Define the IP addresses or FQDNs of your backend servers (e.g., Virtual Machines, App Services).
  4. HTTP Settings: Configure protocol settings, port, cookie-based affinity, and health probe configurations.
  5. Rules: Create rules to associate listeners with backend pools and HTTP settings.

Example: Basic Routing Rule


# Conceptual example of routing based on URL path
Listener: MyHttpListener (Port 80, Host '*' )
Rule: BasicRule
  If Request Path contains '/images/*'
  Then Route to Backend Pool: ImageServers
  Else Route to Backend Pool: DefaultWebServers
            

Pricing

Azure Application Gateway pricing is based on several factors, including the SKU chosen (Standard, WAF, WAF V2), data transfer, and the number of hours the gateway is provisioned. WAF V2 offers enhanced features and autoscaling capabilities.

For detailed pricing information, please refer to the official Azure Application Gateway pricing page.