Azure Application GatewayNetworking
Azure Application Gateway: Overview and Configuration Example.
Azure Application Gateway is a Layer 7 (HTTP/HTTPS) load balancer that provides advanced application delivery and load balancing services. It is designed to optimize and secure the delivery of web applications. Here's a detailed overview of Azure Application Gateway along with a configuration example:
Features of Azure Application Gateway
- HTTP/HTTPS Load Balancing
- Load balances HTTP and HTTPS traffic at the application layer, directing traffic based on HTTP request attributes like URI path and host headers.
- SSL Termination
- Supports SSL/TLS termination, offloading compute-intensive encryption and decryption from backend servers to the Application Gateway, and supports end-to-end SSL encryption.
- Web Application Firewall (WAF)
- Integrates natively with Azure Web Application Firewall (WAF v2) based on OWASP Core Rule Sets (CRS) for centralized protection against common web vulnerabilities, SQL injection, and cross-site scripting.
- Session Affinity
- Supports cookie-based session affinity to ensure client requests during a session are consistently routed to the same backend server instance.
- Rewrite and Redirect Rules
- Enables advanced rewriting of HTTP request/response headers and URL paths, as well as automatic HTTP-to-HTTPS redirects.
- Multi-Site Hosting
- Enables hosting and routing for multiple distinct domain names or websites on the same Application Gateway infrastructure.
- Health Probes
- Continuously monitors backend server health using customizable HTTP/HTTPS probes, automatically taking unhealthy instances out of rotation.
- URL-Based Routing
- Routes requests to different backend pools based on URL paths (e.g., routing
/images/*to a storage pool and/api/*to an application pool). - Azure Monitor Integration
- Provides comprehensive metrics, access logs, performance counters, and diagnostic data through Azure Monitor.
Configuration Example
Let's configure an Azure Application Gateway for a sample web application:
| # | Step | What to do |
|---|---|---|
| 1 | Login to Azure Portal | Navigate to the Azure Portal. |
| 2 | Create an Azure Application Gateway | Click on "Create a resource" and search for "Application Gateway." Click "Create" to start the Azure Application Gateway creation wizard. |
| 3 | Configure Application Gateway Settings | Specify details such as subscription, resource group, application gateway name, region, and SKU (Standard v2 or WAF v2). |
| 4 | Configure Frontend IP Configuration | Set up frontend IP configuration, including public or private IP, and port (80/443). |
| 5 | Configure Backend Pools | Create backend pools and add virtual machines, VM scale sets, App Services, or external IP addresses to distribute traffic. |
| 6 | Configure HTTP Settings | Specify HTTP/HTTPS settings, including port, protocol, cookie-based affinity, connection draining, and custom probe association. |
| 7 | Configure Health Probe | Set up a health probe to monitor the health of backend instances. Specify the protocol, host, port, path, probe interval, and unhealthy threshold. |
| 8 | Configure Routing Rules | Create routing rules to bind frontend listeners, backend pools, and HTTP settings based on basic routing or path-based URL mapping. |
| 9 | Enable SSL Termination (Optional) | If needed, upload a TLS/SSL certificate or link one from Azure Key Vault for offloading SSL decryption. |
| 10 | Configure Web Application Firewall (Optional) | If security is required, enable Azure Web Application Firewall (WAF) and configure detection or prevention modes. |
| 11 | Review and Create | Review the configured settings, validation summary, and click "Create" to deploy the Azure Application Gateway. |
| 12 | Monitor Application Gateway Performance | Use Azure Monitor to track throughput, response latency, failed requests, backend health status, and diagnostic access logs. |
| 13 | Scale Resources (Optional) | Configure autoscaling parameters (minimum and maximum capacity units) to adjust automatically to traffic demand. |
| 14 | Clean Up Resources (Optional) | Once testing is completed, clean up resources by deleting the Azure Application Gateway or resource group as needed. |