When to use Azure Firewall vs. Network Security Groups and App Security Groups

There is often some confusion about when you should use an Azure Firewall versus Network Security Groups (NSG) or App Security Groups (ASG). A typical use for Azure Firewall is for protecting your enterprise network from incoming traffic with it positioned between your cloud network and the internet. ASGs are used to protect groups of servers with a common function, such as web servers or database servers.

An NSG works much like a firewall. While an Azure Firewall monitors traffic at more of a global level, an NSG is more defined and is applied to specific subnets and/or network interfaces. Both firewall and NSG allow you to apply rules based on IP addresses, port numbers, networks, and subnets.