When to use this
Use this when a spoke VNet can't reach another spoke, a branch, or the internet through a Virtual WAN hub, or when traffic skips the firewall you expected it to go through. In Virtual WAN you don't manage route tables in the spoke. The hub router programs them for you, so you debug what the hub learned and what it pushed to each connection.
Keep three questions apart:
- Association. Which hub route table does the connection use to make forwarding decisions?
- Propagation. Which route tables and labels does the connection advertise its prefixes into?
- Routing intent. Has the hub taken over association and propagation so that Internet and/or private traffic goes to a firewall or NVA?
Most "it was working yesterday" tickets come down to one of these three changing.
Hub state first
A hub that's still provisioning its router will show partial or stale routes. Check the router state before you go further.
RG=rg-vwan
HUB=vhub-weu
az network vhub show -g $RG -n $HUB \
--query "{state:provisioningState, routing:routingState, pref:hubRoutingPreference, asn:virtualRouterAsn, ips:virtualRouterIps}" -o json
| Field | What you want | If not |
|---|---|---|
routingState | Provisioned | Provisioning means wait. Failed means reset the router from the hub's portal blade or open a case. |
hubRoutingPreference | Matches your design (ExpressRoute, VpnGateway, ASPath) | Branch prefixes learned over both ExpressRoute and VPN pick the "wrong" path |
virtualRouterIps | Two IPs | Needed if spokes BGP-peer with the hub router |
Route tables, associations and propagation
# Route tables in the hub (defaultRouteTable and noneRouteTable always exist)
az network vhub route-table list -g $RG --vhub-name $HUB \
--query "[].{name:name, labels:labels, routes:length(routes)}" -o table
# Per VNet connection: where it's associated and where it propagates
az network vhub connection list -g $RG --vhub-name $HUB \
--query "[].{name:name, assoc:routingConfiguration.associatedRouteTable.id, prop:routingConfiguration.propagatedRouteTables.ids[].id, labels:routingConfiguration.propagatedRouteTables.labels, inetSec:enableInternetSecurity}" -o json
How to read it:
- A connection that propagates only to
noneRouteTableis invisible to everything else. That's intentional for isolated VNets and a bug for anything else. - The
defaultlabel is applied to every hub'sdefaultRouteTable. If you propagate to thedefaultlabel, your prefixes reach the default tables of all hubs in the WAN. Propagating to thedefaultRouteTableID reaches only this hub. enableInternetSecurity: falsemeans the connection does not learn0.0.0.0/0from the hub. A spoke with this off goes out through its own default path even when the secured hub has a firewall. This is the usual cause of "internet traffic bypasses the firewall for one spoke only".
Effective routes: the source of truth
get-effective-routes shows what the hub router actually installed for a route table or connection. Use it before you trust anything in the portal.
SUB=$(az account show --query id -o tsv)
RT_ID="/subscriptions/$SUB/resourceGroups/$RG/providers/Microsoft.Network/virtualHubs/$HUB/hubRouteTables/defaultRouteTable"
az network vhub get-effective-routes -g $RG -n $HUB \
--resource-type RouteTable --resource-id "$RT_ID" \
--query "value[].{prefix:addressPrefixes[0], nextHopType:nextHopType, nextHop:nextHops[0], origin:routeOrigin, asPath:asPath}" -o table
You can also pass a connection instead of a route table. --resource-type accepts values such as HubVirtualNetworkConnection, VpnConnection, ExpressRouteConnection and P2SConnection. Names vary slightly by CLI version, so check az network vhub get-effective-routes --help.
Then compare with what a NIC in the spoke sees:
az network nic show-effective-route-table -g rg-spoke1 -n vm1-nic -o table
| Hub effective routes show | Spoke NIC shows | Meaning |
|---|---|---|
| Spoke 2 prefix, next hop = spoke 2 connection | No route to spoke 2 | Spoke 1's associated table isn't the one you checked, or spoke 1 has a UDR overriding the learned route |
0.0.0.0/0 to firewall | No 0.0.0.0/0 from VirtualNetworkGateway | enableInternetSecurity is false on that connection |
Branch prefix with long asPath via VPN, shorter via ER | Traffic goes the "wrong" way | Hub routing preference is overriding AS path; check hubRoutingPreference |
| Prefix missing entirely | Missing | Source connection isn't propagating to this table or label |
Tip
Effective routes are calculated asynchronously. After a change, wait for
routingStateto return toProvisionedand re-run the query before you decide the change didn't work.
Routing intent
Routing intent replaces manual association and propagation with two policies: Internet traffic and Private traffic. Each policy points to a next hop in the hub, such as Azure Firewall, a supported NVA or a SaaS security solution. The CLI command group for creating it has changed between versions. The safest way to read the current state is to query the resource directly:
az rest --method get \
--url "https://management.azure.com/subscriptions/$SUB/resourceGroups/$RG/providers/Microsoft.Network/virtualHubs/$HUB/routingIntent?api-version=2023-09-01" \
--query "value[].properties.routingPolicies[].{name:name, destinations:destinations, nextHop:nextHop}" -o json
What changes once routing intent is on:
- The hub manages associations and propagation for every connection. Hand-edited route tables, custom propagation and static routes on connections either stop applying or block the configuration. Check the current docs for which combinations are supported before you enable it on a hub that already has custom route tables.
- The Private traffic policy covers RFC 1918 ranges by default. If spokes or branches use public IP space or
100.64.0.0/10internally, add those ranges as additional private prefixes. If you don't, that traffic bypasses the firewall, or fails because it now goes out through the Internet policy. - Inter-hub traffic between two secured hubs goes through both firewalls. Allow the flow in both firewall policies, or you get one-way failures that look like asymmetric routing.
Warning
Enabling or changing routing intent reprograms every connection in the hub. Expect a short disruption while the router reconverges. Do it in a change window, and capture
get-effective-routesoutput for each route table first so you have something to roll back to.
Static routes on VNet connections (without routing intent)
Use a static route when an NVA in a spoke VNet must be the next hop for prefixes behind it (the "indirect spoke" pattern):
az network vhub connection show -g $RG --vhub-name $HUB -n conn-nva-spoke \
--query "routingConfiguration.{static:vnetRoutes.staticRoutes, override:vnetRoutes.staticRoutesConfig.vnetLocalRouteOverrideCriteria}" -o json
vnetLocalRouteOverrideCriteria controls whether a static route to a prefix inside the spoke's own address space overrides the VNet's local route. Set it to Equal when you need traffic within the NVA spoke to be inspected too. Leave it as Contains (the default) when you don't.
Branch-to-branch and ExpressRoute transit
az network vwan show -g $RG -n vwan-prod \
--query "{type:type, b2b:allowBranchToBranchTraffic}" -o json
allowBranchToBranchTraffic: falseblocks VPN-to-VPN and VPN-to-ER transit through the hub. Turning it on changes traffic flows for every site at once, so plan for that.- ExpressRoute-to-ExpressRoute transit through the hub isn't provided by default. Global Reach or routing intent with a firewall are the usual options. Check current support for your topology.
Quick symptom map
| Symptom | Likely cause | Fix |
|---|---|---|
| New spoke can't reach any other spoke | Connection propagates only to noneRouteTable or to a custom table nobody is associated with | Propagate to defaultRouteTable or the right label |
| Spoke-to-spoke works but skips the firewall | No routing intent, and no static routes pointing RFC 1918 at the firewall | Enable the Private traffic routing policy |
| One spoke reaches the internet directly | enableInternetSecurity false, or a spoke UDR with 0.0.0.0/0 to Internet | az network vhub connection update ... --set enableInternetSecurity=true, remove the UDR |
| Branch reaches hub A spokes but not hub B spokes | Propagating to the hub route table ID instead of the default label | Propagate to the label |
| Routes flap after on-prem change | Too many prefixes advertised, or the same prefix from ER and VPN with preference set to ExpressRoute | Summarise on-prem and check prefix limits in current docs |
Prevent it next time
- Store hub, route table and connection definitions in Bicep or Terraform. Diff
routingConfigurationin pull requests, because that's where the breaking changes hide. - After every network change, export
get-effective-routesfor each route table to a file in the change record. - Pick one model per hub: routing intent, or custom route tables. Mixing them is where the hardest-to-debug failures come from.
- Alert on
routingStateleavingProvisionedwith a scheduled Resource Graph query or Azure Monitor alert.
Get the weekly HubDatAI email
One email a week with everything new: posts, learning sessions and videos. Free, no spam, unsubscribe in one click. What you get