πŸ”₯ Mastering Azure Firewall: A Complete Guide for Cloud Architects

🌐 Introduction

In today’s cloud-first world, securing your network perimeter is no longer optionalβ€”it’s critical. As workloads migrate to the cloud, the traditional security perimeter dissolves. You now need tools that offer deep visibility, intelligent filtering, and seamless integration with your hybrid and multi-cloud environments.

Azure Firewall is Microsoft’s answer to this challenge: a cloud-native, intelligent, scalable firewall-as-a-service (FWaaS) that helps protect your Azure infrastructure with advanced features like TLS inspection, threat intelligence, FQDN filtering, and network traffic logging.

In this post, we’ll go beyond the basics to explore how Azure Firewall works, when to use it, how to configure it securely, and common mistakes to avoid.


🧱 What is Azure Firewall?

Azure Firewall is a stateful, managed, high-availability network security service that enables you to control and log all traffic flows using policies based on:

  • Application rules (e.g., block access to *.socialmedia.com)

  • Network rules (e.g., allow TCP port 443 to specific IPs)

  • DNAT rules (e.g., forward external requests to internal apps)

Unlike Azure Network Security Groups (NSGs), which work at the VM or subnet level and only filter based on Layer 3 & 4, Azure Firewall adds:

  • Layer 7 (application layer) filtering

  • Full stateful inspection

  • TLS decryption

  • Logging and analytics

  • Centralized rule management across regions


πŸ”Ž Why Azure Firewall? – Key Use Cases

Use CaseDescription
πŸ”’ Perimeter ProtectionEnforce rules for inbound, outbound, and inter-VNET traffic
🧠 Threat IntelligenceBlock traffic to/from known malicious IPs/domains
🌐 Outbound FQDN FilteringAllow outbound internet access only to trusted domains
πŸ” TLS InspectionInspect encrypted traffic for malware or leaks (Premium SKU)
πŸ“ˆ Network VisibilitySend logs to Sentinel for security event analysis
🌍 Multi-region GovernanceCentralize policy enforcement using Azure Firewall Manager

πŸ†š Azure Firewall vs NSG vs NVA

FeatureNSGNVA (3rd-party)Azure Firewall
Layer 7 (App Rules)βŒβœ…βœ…
TLS InspectionβŒβœ…βœ… (Premium only)
Threat Intelligence❌Dependsβœ…
Auto Scaling❌Manualβœ…
Central Policy Management❌Manualβœ… (with Firewall Manager)
High AvailabilityZonal, ManualNeeds configBuilt-in
CostLowHighMedium–High

🧩 Azure Firewall SKUs – Standard vs Premium

FeatureStandardPremium
Stateful Firewallβœ…βœ…
Application/Network Rulesβœ…βœ…
Threat Intelligenceβœ… (Alert/Deny)βœ…
FQDN Filteringβœ…βœ…
TLS Inspection (SSL)βŒβœ…
Intrusion Detection & PreventionβŒβœ…
URL Filtering (Web Categories)βŒβœ…
Ideal ForMost common use casesRegulated, sensitive workloads

🧠 Architecture Patterns

πŸ” Hub-and-Spoke with Azure Firewall

The Hub-and-Spoke model is the most common architecture for Azure Firewall. Here's how it works:

  1. Azure Firewall is deployed in the Hub VNET.

  2. Spoke VNETs host applications or workloads.

  3. All traffic (inbound/outbound/inter-VNET) is routed through the firewall using UDRs (User-Defined Routes).

  4. You can optionally peer the hub with on-premises networks via VPN or ExpressRoute.

πŸ“Œ Tip: Azure Firewall requires a dedicated subnet called AzureFirewallSubnet.

πŸ–Ό Diagram Overview

graphqlCopyEdit        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ On-Premises  β”‚
        β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚ VPN/ER
        β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
        β”‚  Hub VNET   β”‚
        β”‚ Azure FW    β”‚
        β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β–Ό          β–Ό             β–Ό
Spoke 1    Spoke 2       Spoke 3
(App)      (DB)          (Mgmt)

πŸš€ How to Deploy Azure Firewall

πŸŒ€ Option 1: Azure Portal

Ideal for quick tests or proof of concept.

🧱 Option 2: ARM/Bicep

Best for enterprise deployments with declarative infrastructure.

🌍 Option 3: Terraform

Here's a Terraform snippet for provisioning Azure Firewall:

hclCopyEditresource "azurerm_firewall" "fw" {
  name                = "azure-fw"
  location            = var.location
  resource_group_name = azurerm_resource_group.rg.name
  sku_name            = "AZFW_VNet"
  sku_tier            = "Premium"

  ip_configuration {
    name                 = "ipconfig"
    subnet_id            = azurerm_subnet.firewall_subnet.id
    public_ip_address_id = azurerm_public_ip.fw_pip.id
  }
}

πŸ›  How to Configure Rules

Azure Firewall allows three rule types, organized into Rule Collections.

1. Network Rules

Layer 4 filtering based on:

  • Protocol (TCP, UDP)

  • Source IP / Destination IP

  • Ports

2. Application Rules

Layer 7 filtering based on:

  • FQDNs (e.g., *.microsoft.com)

  • Protocols (HTTP, HTTPS)

  • TLS Inspection (Premium only)

3. NAT Rules

Used to forward external traffic to internal services (DNAT).

Example: Block Social Media Access

jsonCopyEdit{
  "name": "block-social",
  "rules": [
    {
      "ruleType": "ApplicationRule",
      "name": "deny-facebook",
      "protocols": [{ "protocolType": "Https" }],
      "sourceAddresses": ["*"],
      "targetFqdns": ["*.facebook.com"],
      "action": "Deny"
    }
  ]
}

πŸ”Ž Monitoring & Diagnostics

Azure Firewall integrates with:

  • Log Analytics – Track rule hits, dropped packets

  • Azure Monitor – Visualize traffic

  • Microsoft Sentinel – SIEM for threat hunting

  • Storage/Event Hub – Export logs

Enable Diagnostic Settings

Make sure to log:

  • Application rule logs

  • Network rule logs

  • Threat intelligence logs

  • Firewall health metrics


βœ… Best Practices

  • 🎯 Always use Firewall Manager for multi-region governance

  • 🌍 Deploy in all availability zones for HA

  • πŸ” Enable TLS Inspection for outbound HTTPS traffic

  • πŸ“¦ Log everything and review regularly

  • πŸ“ Use rule groups for better organization

  • 🚫 Place a deny-all rule at the bottom

  • 🧩 Combine with NSGs & ASGs for defense-in-depth

  • πŸ’‘ Avoid wildcard FQDNs unless necessary


⚠ Common Pitfalls to Avoid

MistakeImpact
❌ Missing UDRs to route trafficTraffic bypasses the firewall
❌ Forgetting to configure DNSFQDN-based rules won’t work
❌ Using Standard SKU for sensitive dataNo TLS inspection
❌ No logging or diagnosticsNo visibility into traffic patterns
❌ NAT misconfigurationInbound access broken or exposed

πŸ’Έ Cost Breakdown

Azure Firewall charges for:

  • Deployment (per hour)

  • Data processing (per GB)

Example Estimate

Cost ComponentAmount
Base hourly rate~$1.25–$1.75/hr
Data processing~$0.016/GB
TLS Inspection (Premium)Adds to hourly rate

πŸ‘‰ Use Azure Pricing Calculator to simulate cost.


πŸ” Real-World Case Study

In a global retail company, Azure Firewall Premium was deployed across 3 Azure regions. With centralized policy enforcement, the security team could:

  • Detect and block outbound data exfiltration attempts using TLS inspection.

  • Automatically update rules via CI/CD pipelines using Bicep templates.

  • Reduce attack surface by 35% through FQDN allow lists.

Using Log Analytics and Sentinel, over 2,000 anomalous connections were flagged and investigated in the first month.


🏁 Conclusion

Azure Firewall is more than a traditional firewall in the cloudβ€”it's a scalable, intelligent security engine that fits seamlessly into Azure-native and hybrid architectures.

From application-layer filtering to TLS inspection and threat intelligence, it’s your cloud perimeter guardian. When deployed correctly, it offers deep visibility and protection, especially in regulated industries like finance, healthcare, and government.

If you’re building a zero-trust environment, Azure Firewall should be at the core of your network security strategy.


πŸ“š Resources

0
Subscribe to my newsletter

Read articles from Mostafa Elkattan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Mostafa Elkattan
Mostafa Elkattan

Multi Cloud & AI Architect with 18+ years of experience Cloud Solution Architecture (AWS, Google, Azure), DevOps, Disaster Recovery. Forefront of driving cloud innovation. From architecting scalable infrastructures to optimizing. Providing solutions with a great customer experience.