Hub-and-spoke is the recommended network topology for most Azure enterprise deployments. The hub virtual network acts as a central point of connectivity, hosting shared services like firewalls, VPN gateways, and DNS. Spoke networks connect to the hub via peering and contain workload-specific resources.
In a hub-and-spoke architecture:
Here is a Bicep module for the hub virtual network with Azure Firewall and gateway subnets:
Each spoke VNET peers back to the hub and routes traffic through the firewall:
Deploy the hub first, then each spoke:
When organizing a multi-file Bicep project, use this structure:
This modular approach lets you add new spokes by calling the spoke module with different parameters. For a complete reference, see the Bicep documentation and the Entra ID Bicep templates announcement for identity resource management with Bicep.