Azure Application Gateway Client Requests Routing

Sathish Mugite 20 Reputation points
2025-03-14T11:02:46.85+00:00

For Azure Application Gateway with WAF enabled, does client requests filtered on WAF or NSG first?

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,172 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sai Prasanna Sinde 5,240 Reputation points Microsoft External Staff
    2025-03-17T06:51:18.63+00:00

    Hi @Sathish Mugite  

    NSGs operate at Layers 3 and 4 of the OSI model. They control network traffic based on IP addresses and ports. Therefore, NSGs filter traffic first. They determine whether network traffic is allowed to reach the Application Gateway's subnet in the first place. Please refer the document.

    The WAF operates at Layer 7. It inspects the HTTP/HTTPS traffic for web application vulnerabilities. Therefore, the WAF processes traffic after it has been allowed by the NSGs. The WAF examines the content of the web requests.

    NSGs act as the first line of defense, controlling network access and the WAF then provides deeper application-level inspection, protecting against web-based attacks. Please refer the document.

    when an Azure Application Gateway has both the WAF and a NSG enabled, client requests are first filtered by the NSG associated with the Application Gateway's subnet, and subsequently by the WAF.

    This order of processing is fundamental to how security is enforced for web applications deployed on Azure. The NSG acts as a network-level firewall, controlling access based on IP addresses, ports, and protocols, while the WAF provides application-level protection by inspecting the content of HTTP/HTTPS requests for common web exploits and vulnerabilities.


    If the above has been helpful, please take a moment to click 'Accept answer'

    If you still have questions, please let us know what is needed in the comments so the question can be answered.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.