Skip to main content

Making a summarised UDR take precedence: disable peering route propagation

Updated 3 min readMarkdown
Part of seriesblog

Intro

When operating a hub-and-spoke Azure platform, we usually need to maintain routing on the GatewaySubnet for each new spoke to ensure return traffic travels through the firewall. For other subnets, a default route (0.0.0.0/0) with next hop to the virtual appliance handles this — but that doesn’t work for the GatewaySubnet. This is unsupported on the gatewaySubnet because gateway management and control-plane connectivity depend on it.

Azure uses longest prefix match, meaning the most specific route takes precedence, so a broad route on the GatewaySubnet loses to the more specific system peering routes. Microsoft recently announced a preview setting to disable peering route propagation, ultimately removing this task for the operations team.

Why this problem exists

Azure automatically adds system routes to the GatewaySubnet for each peered spoke VNet’s address space. Because these are more specific than a summarised UDR and as mentioned Azure uses longest-prefix match, and return traffic goes straight to the spoke, skipping the firewall. To force it through the firewall, you add a per-spoke override that’s more specific on the GatewaySubnet route table.

The feature: disablePeeringRoute

Now in public preview, you can disable peering route propagation. This suppresses the system peering routes on subnets using that route table but doesn't alter the peering connections. The property disablePeeringRoute is set on the route table. With the peering routes suppressed, the summarised UDR on the GatewaySubnet takes precedence, and the per-spoke overrides are no longer needed.

It's important to understand that the property disablePeeringRoute doesn't change Azure's routing precedence rules, so we still use longest prefix match. However, by suppressing system-generated peering routes, we remove the more-specific routes that would otherwise take precedence over the summarised UDR.

Azapi configuration

resource "azapi_resource" "gateway_route_table" {
  type      = "Microsoft.Network/routeTables@2026-03-01" # must be >= 2025-07-01 for disablePeeringRoute
  name      = "rt-hub-gatewaysubnet"
  parent_id = azapi_resource.resourceGroup.id
  location  = var.location

  body = {
    properties = {
      disablePeeringRoute        = "All"   # suppresses system peering routes so the summarised UDR wins
      disableBgpRoutePropagation = false
      routes = [
        {
          name = "to-spokes-via-firewall"
          properties = {
            addressPrefix    = "10.0.0.0/8"   # summarised spoke range
            nextHopType      = "VirtualAppliance"
            nextHopIpAddress = "10.180.0.10"      # Example Azure Firewall private IP
          }
        }
      ]
    }
  }

  schema_validation_enabled = false
  response_export_values    = ["*"]
}

Caveats

Caveats

Preview features usually come with limitations and generally aren't recommended for production. Always refer to the official Microsoft documentation for any limitations. Beyond that, there are a few caveats to consider:

  • The next hop must be in the same VNet as the source NIC. For the GatewaySubnet scenario, this means the gateway and the firewall or NVA must reside in the same VNet — as they typically do in a standard hub.
  • AzAPI supports it, but AzureRM doesn't yet. You also need API version 2025-07-01 or later for the property to be available.
  • Make sure your UDR is in place before enabling this feature. It doesn't create replacement routes, so suppressing the peering routes without a working UDR could result in traffic being black-holed.

References

No comments yet. Be the first to comment.