Skip to content

Hub and spoke with Azure Firewall

The minimal hub plus a Basic Azure Firewall, its policy, and the route table that sends spoke traffic through it. Pick it when egress needs inspecting or a central rule set, and you want the classic hub you can later extend with a VPN or ExpressRoute gateway in the same virtual network.

Example: examples/connectivity/hub-spoke-firewall/.

Hub and spoke with Azure Firewall: the spoke peers with the hub VNet vnet-hub-weu, its route table rt-app-prod-weu sends 0.0.0.0/0 to the Basic firewall afw-hub-weu at 10.0.0.4, which carries the policy afwp-hub-weu and is the path to the internetHub and spoke with Azure Firewall: the spoke peers with the hub VNet vnet-hub-weu, its route table rt-app-prod-weu sends 0.0.0.0/0 to the Basic firewall afw-hub-weu at 10.0.0.4, which carries the policy afwp-hub-weu and is the path to the internet

What it deploys

Resource Module Version
rg-hub-weu Azure/avm-res-resources-resourcegroup/azurerm 0.4.0
vnet-hub-weu with AzureFirewallSubnet and AzureFirewallManagementSubnet, afw-hub-weu (Basic, one public IP, one management IP), afwp-hub-weu (Basic, DNS proxy on), the hub route tables, the private link DNS zones Azure/avm-ptn-alz-connectivity-hub-and-spoke-vnet/azurerm 0.18.1

Module docs

Links point at the pinned version. The module examples are applied by the module's own CI on every release.

Not deployed: Bastion, both gateways, the private DNS resolver, the DNS security policy, the NAT gateway, the DDoS plan.

Idle cost. Azure Firewall Basic about USD 290 a month, plus two public IPs at about USD 4 each. The ALZ accelerator's SMB scenario adds a VpnGw2AZ gateway at about USD 394; this example leaves the gateway off until a site needs it.

The tree you add

The same tree as the minimal hub. Only main.tf differs: the firewall and policy flags are on, with their blocks.

live/platform/connectivity/
├── subscription.hcl
├── env.hcl
└── westeurope/
    ├── region.hcl
    └── caf-connectivity-hub/
        ├── terragrunt.hcl
        └── main.tf

Decisions in the example

  • Basic SKU. No availability zones, no threat intelligence in Deny mode, no TLS inspection. It is the SMB tier. Moving to Standard re-creates the firewall, so decide before the spokes route through it.
  • Two /26 subnets. Basic requires the management subnet, and Azure fixes both at /26. The example carves them from the start of the hub space.
  • Empty policy. The firewall denies everything until a rule collection group allows it. Rules belong with the workload that needs them: the first workload PR adds its collection to this unit's firewall_policy.
  • DNS proxy on. Spokes that point their DNS at the firewall resolve the private link zones through it, which FQDN rules need.
  • Firewall private IP by convention. The firewall takes the first usable address of its subnet, 10.0.0.4 for the example's plan. Spoke route tables use that literal, so nothing reads the hub's state.

On the spoke side

Set route_table_enabled = true in the landing zone's network unit, keep the to_firewall route table the example already declares, and add route_table = { key_reference = "to_firewall" } to each subnet that must egress through the firewall. Both landing zone examples carry this as a comment.

Apply order

_foundation/landing-zones, this unit, then each landing zone's lz-vending and network. The first firewall apply takes ten to fifteen minutes.

What people get wrong

  • Delegated subnets behind the route table. App Service and Flex Consumption integration subnets need outbound through the firewall too, and a rule for the service's dependencies, or the app silently loses egress.
  • Forgetting the management subnet. Basic refuses to deploy without it.
  • Changing the hub address plan later. The firewall IP moves and every spoke route is wrong. Treat 10.0.0.0/16 and the two /26 as permanent.

About the cost figures

Fixed infrastructure only, list prices, one region, from the ALZ accelerator's scenario pages (US dollars, west US, 2026-04-02) and the Azure pricing pages. Data processing, log ingestion and DNS queries are on top and vary. The infracost gate on your pull request reports the figure for your region and currency before you apply.