Azure Web Application Firewall (WAF) protects web applications from common attacks like SQL injection and cross-site scripting. The first architectural decision is selecting the hosting model based on network topology and traffic patterns. Application Gateway WAF provides regional, dedicated protection within a specific Azure region, making it suitable for applications that need low-latency inspection close to the backend. Front Door WAF operates at the global edge, inspecting traffic closer to the attacker before it reaches the origin, which is ideal for multi-region deployments and global user bases. A CDN with WAF combines content acceleration with security at edge locations, benefiting static content delivery while applying the same rule sets. Evaluate expected latency, geographic distribution of users, and whether the application is regional or global to match the right model.
A system architecture diagram contrasting Azure Front Door WAF, which inspects traffic at the global edge before it reaches the origin, with Application Gateway WAF, which provides regional protection close to backend resources within a virtual network.
WAF uses managed rule sets like OWASP to provide prebuilt protections against common web exploits. You can configure custom rules for application-specific scenarios such as rate limiting to prevent denial-of-service floods, geo-filtering to allow or block traffic by region, and bot mitigation to block unwanted bots or malicious IP addresses. When fine-tuning, you add or exclude rule IDs and adjust thresholds through a validation process to reduce false positives. Key configuration areas include selecting OWASP versions for baseline threat detection, defining custom rule sets for application-specific patterns, setting rate limits to control request volumes, and applying geo-filtering rules to restrict traffic by geographic location.
When deploying a WAF policy, you choose between Detection mode and Prevention mode. In Detection mode, the WAF monitors traffic and logs threats without blocking them, which is useful for initial deployment to avoid false positives. After reviewing logs and tuning rules, you switch to Prevention mode to actively block threats. Policy changes propagate within approximately 20 minutes globally on Front Door and regionally on Application Gateway. Consistent configuration across all edge locations ensures predictable behavior, so the same rule set applies regardless of where the request enters the network.
Selecting the correct WAF SKU supports capacity planning and performance. Application Gateway WAF V2 and Front Door Premium SKUs offer autoscaling throughput and TLS offloading for encrypted traffic inspection. Evaluate expected connection rates, request volumes, and throughput requirements to avoid bottlenecks. The autoscaling capability adjusts capacity based on load, but you must ensure the initial SKU selection matches the anticipated traffic patterns. TLS offloading allows the WAF to inspect encrypted traffic without burdening backend servers.
Effective tuning relies on diagnostic logs and metrics streamed to Azure Monitor, Log Analytics, or Event Hubs. By analyzing WAF logs, you identify false positives and adjust rules or exclusions in an iterative process. Set up alerts on key metrics such as blocked requests and rule match rates for real-time incident response. Ongoing monitoring keeps the WAF policy optimally tuned against evolving threats, ensuring that rule adjustments reflect actual traffic patterns and attack trends rather than static configurations.
Are you a guardian of your domain? Lean how to leverage your aptitude in security to protect Microsoft Azure technologies, with a goal of earning the Microsoft Certified: Azure Security Engineer Associate certification!
Prepare and test your skills

Prepare and test your skills

Application Gateway WAF provides regional, dedicated protection within a specific Azure region, making it suitable for applications needing low-latency inspection close to the backend. Front Door WAF operates at the global edge, inspecting traffic closer to the attacker before it reaches the origin, which is ideal for multi-region deployments and global user bases.
In Detection mode, the WAF monitors traffic and logs threats without blocking them, useful for initial deployment to avoid false positives. After reviewing logs and tuning rules, you switch to Prevention mode to actively block threats.
Policy changes propagate within approximately 20 minutes globally on Front Door and regionally on Application Gateway.
Custom rules can be configured for application-specific scenarios such as rate limiting to prevent denial-of-service floods, geo-filtering to allow or block traffic by region, and bot mitigation to block unwanted bots or malicious IP addresses.