Azure Application Gateway Backend Pools

Azure Application Gateway is a web traffic load balancer that enables you to manage traffic to your web applications. A key component of the Application Gateway is the backend pool, which defines the set of backend servers that will receive the traffic. This documentation explains how to configure and manage backend pools.

What is a Backend Pool?

A backend pool contains the IP addresses or Fully Qualified Domain Names (FQDNs) of the virtual machines, virtual machine scale sets, or app services that host your web application. When Application Gateway receives a request, it forwards it to one of the healthy targets within the configured backend pool based on the routing rules.

Configuring Backend Pools

You can configure backend pools using the Azure portal, Azure CLI, Azure PowerShell, or ARM templates.

Using the Azure Portal

  1. Navigate to your Application Gateway resource.
  2. Under "Settings", click on "Backend pools".
  3. Click "+ Add" to create a new backend pool.
  4. Provide a name for the backend pool.
  5. For "Target type", choose the resource type of your backend servers (e.g., IP address, FQDN, App Service).
  6. Add the IP addresses or FQDNs of your backend targets.
  7. For backend health probes, you can associate an existing probe or create a new one.
  8. Click "Add" to save the backend pool.

You can also add or remove backend targets from an existing pool by clicking on the pool name and then clicking "Add to backend pool" or by selecting targets and clicking "Remove".

Using Azure CLI

To create a backend pool using Azure CLI:


az network application-gateway backend-pool create \
  --resource-group myResourceGroup \
  --gateway-name myAppGateway \
  --name myBackendPool \
  --addresses 10.0.0.1 10.0.0.2
            

To add an existing IP configuration to a backend pool:


az network application-gateway backend-pool update \
  --resource-group myResourceGroup \
  --gateway-name myAppGateway \
  --name myBackendPool \
  --add backendAddresses <(echo '{"ipAddress": "10.0.0.3"}')
            

Backend Targets

The following types of targets can be added to a backend pool:

Tip: When using FQDNs for backend targets, ensure that DNS resolution within the Application Gateway's VNet is correctly configured.

Backend Health

Application Gateway continuously monitors the health of backend targets using health probes. When a target is deemed unhealthy, Application Gateway stops sending traffic to it until it becomes healthy again. Backend health is crucial for ensuring application availability and resilience.

You can configure health probes to check specific URLs, ports, and protocols. The default health probe checks for a successful HTTP response (status code 200-299) on the configured backend port.