Detect traffic anomalies and auto-mitigate spikes with Azure WAF on Microsoft Azure Front Door
Introduction
Azure WAF on Microsoft Azure Front Door provides a centralized protection solution for your web applications. WAF includes built-in rules to defend against common exploits and vulnerabilities, and custom rules so you can tailor the protection to your specific needs.
Challenge
A popular use-case for custom rules is to rate limit Front Door traffic based on the Country or IP address range. However, configuring the rate limit threshold can sometimes be tricky due to varying traffic patterns based on the time of the day or the day of the week. For example, a rate limit rule created to protect against traffic spikes on a weekend (when the traffic volume is lower) may not fire on a weekday because what's a spike on a weekend might be the usual traffic volume for a weekday.
Solution
It involves two main steps:
- Detect anomalous spikes in traffic
- Automatically add Azure WAF rules to filter out the traffic causing the spike
In the deep-dive video that follows, we do a step-by-step walkthrough of how to perform these steps. The video is structured as follows:
- Introduction
- What anomaly detection is.
- What anomaly detection tools are available in Azure.
- Defining the problem statement
- An overview of the challenge and issue we are trying to solve.
- Exploring the architecture diagram
- An overview of the various components of the system and how they come together to solve the problem.
- Seeing it in action
- Setup:
- Create a WAF policy
- Create a Microsoft Azure Front Door
- Link it to the WAF policy we created in Step (1)
- Define a dynamic threshold alert on the Azure Front Door endpoint
- Create an Azure Function that would run when the alert fires
- Demo:
- Simulate a DDOS (distributed denial of service) attack
- Demonstrate that the attack has started
- Wait for the alert to fire
- Demonstrate that Azure WAF rules to mitigate the attack get auto-generated
- Demonstrate the attack is mitigated after the Azure WAF rules are deployed to the edge
You can find the reference code here.
Published on:
Learn moreRelated posts
Azure Developer CLI (azd): Run and test AI agents locally with azd
New azd ai agent run and invoke commands let you start and test AI agents from your terminal—locally or in the cloud. The post Azure Developer...
Microsoft Purview compliance portal: Endpoint DLP classification support for Azure RMS–protected Office documents
Microsoft Purview Endpoint DLP will soon classify Azure RMS–protected Office documents, enabling consistent DLP policy enforcement on encrypte...
Introducing the Azure Cosmos DB Plugin for Cursor
We’re excited to announce the Cursor plugin for Azure Cosmos DB bringing AI-powered database expertise, best practices guidance, and liv...
Azure DevOps Remote MCP Server (public preview)
When we released the local Azure DevOps MCP Server, it gave customers a way to connect Azure DevOps data with tools like Visual Studio and Vis...
Azure Cosmos DB at FOSSASIA Summit 2026: Sessions, Conversations, and Community
The FOSSASIA Summit 2026 was an incredible gathering of developers, open-source contributors, startups, and technology enthusiasts from across...
Dataverse: Avoid Concurrency issues by using Azure Service Bus Queue and Azure Functions
Another blog post to handle the concurrency issue. Previously, I shared how to do concurrency via a plugin in this blog post and also how to f...
March Patches for Azure DevOps Server
We are releasing patches for our self‑hosted product, Azure DevOps Server. We strongly recommend that all customers stay on the latest, most s...
Azure Developer CLI (azd): Debug hosted AI agents from your terminal
New azd ai agent show and monitor commands help you diagnose hosted AI agent failures directly from the CLI. The post Azure Developer CLI (azd...
A Look Ahead at Azure Cosmos DB Conf 2026: From AI Agents to Global Scale
Join us for Azure Cosmos DB Conf 2026, a free global, virtual developer event focused on building modern applications with Azure Cosmos DB. Da...