Azure Documentation

Configuring Azure Application Gateway

This document provides a comprehensive guide to configuring Azure Application Gateway. You'll learn about the various components and settings available to customize its behavior and optimize your application delivery.

Key Configuration Components

Azure Application Gateway offers a rich set of configuration options to manage traffic flow, security, and performance for your web applications. The primary components include:

Frontend IP Configuration

This defines the IP addresses that the Application Gateway will listen on. You can configure it with a public IP address for internet-facing applications or a private IP address for internal applications.

Listeners

Listeners are the crucial elements that accept incoming traffic. They associate a frontend IP configuration, port, protocol, and host name with a routing rule.

Backend Pools

A backend pool is a collection of virtual machines, virtual machine scale sets, or web apps that will receive traffic from the Application Gateway.

HTTP Settings

HTTP settings define how the Application Gateway forwards requests to the backend pool. This includes settings for cookies, connection draining, and probe configurations.

Routing Rules

Routing rules connect a listener to a backend pool and an HTTP setting. They determine where incoming traffic should be directed.

Example Configuration Snippet (ARM Template)

Here's a simplified example of how you might define an Application Gateway configuration using an Azure Resource Manager (ARM) template:

            
            {
                "type": "Microsoft.Network/applicationGateways",
                "apiVersion": "2020-11-01",
                "name": "myApplicationGateway",
                "location": "[resourceGroup().location]",
                "properties": {
                    "sku": {
                        "name": "Standard_V2",
                        "tier": "Standard_V2"
                    },
                    "gatewayIPConfigurations": [
                        {
                            "name": "appGatewayIpConfig",
                            "properties": {
                                "subnet": {
                                    "id": "[variables('subnetRef')]"
                                }
                            }
                        }
                    ],
                    "frontendIPConfigurations": [
                        {
                            "name": "appGatewayFrontendIp",
                            "properties": {
                                "publicIPAddress": {
                                    "id": "[variables('publicIpAddressId')]"
                                }
                            }
                        }
                    ],
                    "backendAddressPools": [
                        {
                            "name": "myBackendPool",
                            "properties": {
                                "backendAddresses": [
                                    {
                                        "ipAddress": "10.0.0.4"
                                    },
                                    {
                                        "ipAddress": "10.0.0.5"
                                    }
                                ]
                            }
                        }
                    ],
                    "httpListeners": [
                        {
                            "name": "myHttpListener",
                            "properties": {
                                "frontendIPConfiguration": {
                                    "id": "[resourceId('Microsoft.Network/applicationGateways/frontendIPConfigurations', parameters('applicationGatewayName'), 'appGatewayFrontendIp')]"
                                },
                                "frontendPort": {
                                    "id": "[resourceId('Microsoft.Network/applicationGateways/frontendPorts', parameters('applicationGatewayName'), 'port_80')]"
                                },
                                "protocol": "Http",
                                "hostName": "www.example.com"
                            }
                        }
                    ],
                    "requestRoutingRules": [
                        {
                            "name": "myRequestRoutingRule",
                            "properties": {
                                "ruleType": "Basic",
                                "httpListener": {
                                    "id": "[resourceId('Microsoft.Network/applicationGateways/httpListeners', parameters('applicationGatewayName'), 'myHttpListener')]"
                                },
                                "backendAddressPool": {
                                    "id": "[resourceId('Microsoft.Network/applicationGateways/backendAddressPools', parameters('applicationGatewayName'), 'myBackendPool')]"
                                },
                                "httpSettings": {
                                    "id": "[resourceId('Microsoft.Network/applicationGateways/httpSettings', parameters('applicationGatewayName'), 'myHttpSettings')]"
                                }
                            }
                        }
                    ],
                    "httpSettings": [
                        {
                            "name": "myHttpSettings",
                            "properties": {
                                "protocol": "Http",
                                "port": 80,
                                "cookieBasedAffinity": "Disabled",
                                "requestTimeout": 20
                            }
                        }
                    ]
                }
            }
            
            

Note: Always refer to the official Azure documentation for the most up-to-date configuration parameters and best practices.

Next Steps

Explore detailed guides on specific configurations like SSL termination, Web Application Firewall (WAF), and autoscaling to enhance your Application Gateway deployment.