Firewall vs NSG
| Feature | NSG | Azure Firewall |
|---|---|---|
| Type | Layer 4 allow/deny rules | Full stateful Layer 4 + Layer 7 firewall |
| FQDN filtering | No — IP/port only | Yes — filter by domain names |
| Application rules | No | Yes — HTTP/S, SQL, etc. |
| Threat intelligence | No | Yes — known malicious IPs/domains |
| Centralised policy | Per-VNet/subnet | Single policy across all VNets |
| Logging | NSG Flow Logs | Structured logs in Azure Monitor |
| Cost | Free | ~₹55,000+/month |
| Best for | Basic subnet/NIC filtering | Centralised enterprise firewall |
Azure Firewall SKUs
| SKU | Key Features | Best For |
|---|---|---|
| Basic | Basic L3-L7 filtering, threat intel (alert only), limited throughput | SMBs, non-critical workloads |
| Standard | Full L3-L7, threat intel (alert+deny), Firewall Manager | Enterprise production workloads |
| Premium | Standard + TLS inspection, IDPS, URL filtering, web categories | Highly sensitive environments, compliance |
Rule Types
Azure Firewall processes rules in this order: NAT rules → Network rules → Application rules. First matching rule wins.
NAT Rules (DNAT)
Translate and forward inbound internet traffic to specific backend resources. Example: forward port 3389 from your firewall's public IP to a specific VM.
Network Rules
Allow/deny traffic based on source IP, destination IP, protocol, and port — similar to NSG rules but processed centrally. Used for non-HTTP protocols and cross-VNet traffic.
Application Rules
Allow/deny outbound HTTP/HTTPS traffic based on FQDNs (domain names), URLs, or web categories. Example: allow VMs to access *.microsoft.com but block all other internet browsing.
Allow Rule:
Source: 10.0.0.0/16 (VNet)
Protocol: HTTPS:443
Target FQDNs: *.microsoft.com, *.azure.com, *.windows.net
Deny Rule (implicit — everything else blocked)
FQDN Filtering
One of Azure Firewall's most powerful features — filtering by Fully Qualified Domain Names instead of IP addresses. This matters because:
- Cloud services use dynamic IPs — you can't rely on IP-based rules
- FQDNs can represent CDNs with thousands of IPs
- Azure Firewall resolves FQDNs to IPs and keeps the filter updated automatically
FQDN Tags
Pre-defined groups of FQDNs for common Microsoft services — WindowsUpdate, Office365, AzureBackup. Use these to allow common services without listing every URL.
Threat Intelligence
Azure Firewall can alert on or block traffic to/from known malicious IP addresses and domains — automatically updated by Microsoft's threat intelligence feed. In Premium SKU, it also includes IDPS (Intrusion Detection and Prevention System).
| Mode | Action |
|---|---|
| Off | Threat intel disabled |
| Alert only | Logs known malicious traffic but allows it |
| Alert and deny | Blocks known malicious traffic + logs it |
Azure Firewall Manager
Centralised security management for Azure Firewall across multiple VNets and subscriptions. Instead of managing firewall policies individually on each firewall, Firewall Manager lets you define a single Firewall Policy and apply it to all firewalls in your environment.
Firewall in Hub-Spoke
Azure Firewall is deployed in the hub VNet's dedicated subnet (AzureFirewallSubnet, minimum /26). User Defined Routes (UDRs) in each spoke subnet direct traffic through the firewall:
- All internet-bound traffic (0.0.0.0/0) → Azure Firewall's private IP
- All cross-spoke traffic → Azure Firewall's private IP
This gives you centralised inspection of all traffic — East-West and North-South.
Deploying Azure Firewall
# Create AzureFirewallSubnet
az network vnet subnet create \
--name AzureFirewallSubnet \
--resource-group myRG \
--vnet-name hubVNet \
--address-prefix 10.0.0.0/26
# Create public IP for firewall
az network public-ip create \
--name fw-pip \
--resource-group myRG \
--sku Standard \
--allocation-method Static
# Deploy Azure Firewall
az network firewall create \
--name myFirewall \
--resource-group myRG \
--location centralindia \
--vnet-name hubVNet \
--public-ip myFirewallPublicIP \
--sku AZFW_VNet \
--tier Standard