Networking

Azure Route Server: validate a route map before filtering production BGP routes

A production runbook for qualifying Azure Route Server route-map direction, rule order, prefix matching, BGP attributes, canary scope and rollback before filtering live routes.

08 Nov 2026 azureroute-serverroute-mapsbgpnvaexpressroutevpnroutingeffective-routesobservabilityautomationrunbookrollbackproduction

A connectivity team wants to stop a lab prefix from propagating through an Azure hub. The proposed Azure Route Server route map looks narrow: match 10.90.0.0/16, drop it, and leave production prefixes unchanged. After attachment, one spoke loses 10.80.12.0/24 even though both NVA BGP peerings remain connected.

A green BGP session does not prove that the map is attached in the intended direction, that its rules stopped at the expected point, or that Contains matched only the prefix the author had in mind. A route map changes the control plane before any NSG or application log can explain the outage.

This runbook uses an inbound map on an NVA peering as the running case. The same discipline applies to supported ExpressRoute and VPN connections. The decision is explicit: promote the filter, correct a bounded rule, keep it on the canary connection, or detach it and restore the previous advertisements.

Freeze the route contract

Record the exact connection, direction, prefixes and BGP attributes. “Filter branch routes” is not a testable contract.

yaml 01-route-map-change-contract.yml
change: CHG-RTMAP-184
route_server: ars-hub-prod
candidate: rm-inbound-nva-branches-v1
direction: inbound
connection: nva-branch-a
intent:
drop: [10.90.0.0/16]
preserve: [10.80.0.0/16, 10.80.12.0/24, 0.0.0.0/0]
controls: [10.70.0.0/16]
expected_attributes:
production_community: "65010:100"
next_hop_role: branch-nva
rollback:
action: detach-route-map
deadline_utc: 2026-11-08T21:30:00Z

An inbound map changes what Route Server receives before best-path selection. An outbound map changes what Route Server advertises after path selection; it does not change Route Server’s own best path. Only one map can be applied per direction on a connection, so preserve any existing association instead of treating the candidate as additive.

Capture the baseline and associations

Export Route Server, peerings, learned and advertised routes. Capture effective routes on a critical workload and a healthy control.

bash 02-capture-route-baseline.sh
RG="rg-connectivity-prod"
RS="ars-hub-prod"
PEER="nva-branch-a"

az network routeserver show -g "$RG" -n "$RS" -o json > route-server-before.json
az network routeserver peering show -g "$RG" --routeserver "$RS" -n "$PEER" -o json > peering-before.json
az network routeserver peering list-learned-routes -g "$RG" --routeserver "$RS" -n "$PEER" -o json > learned-before.json
az network routeserver peering list-advertised-routes -g "$RG" --routeserver "$RS" -n "$PEER" -o json > advertised-before.json
az network nic show-effective-route-table -g rg-orders-prod -n nic-orders-02 -o json > effective-orders-before.json

Export route maps and their connection associations too. Route-map PowerShell commands use the virtual hub API, so the Route Server name is supplied as VirtualHubName.

powershell 03-export-route-maps.ps1
$Rg = "rg-connectivity-prod"
$RouteServer = "ars-hub-prod"

Get-AzRouteMap -ResourceGroupName $Rg -VirtualHubName $RouteServer |
ConvertTo-Json -Depth 20 |
Out-File route-maps-before.json

The first map created on a Route Server triggers a one-time service upgrade that can take about 30 minutes. Include it in the change window. An unchanged route table during the upgrade is not proof that the policy is safe, and another routing change must not be stacked while provisioning is incomplete.

Review rules as executable policy

A route map is ordered. Review the match property, criterion, action and next step for every rule.

  • Equals matches only the listed prefixes.
  • Contains also includes more-specific prefixes.
  • Continue passes the route to later rules.
  • Terminate stops processing after the matched rule.
  • A rule without match conditions can match every route from the connection.
  • Multiple modifications on one matching rule are all applied.
text 04-rule-review-matrix.txt
ORDER  MATCH                    ACTION       NEXT       EXPECTED
10     Equals 10.90.0.0/16     Drop         Terminate  Lab summary removed
20     Equals 10.80.0.0/16     Modify       Continue   Add community 65010:100
30     Contains 10.80.0.0/16   Modify       Terminate  Preserve production specifics

NEGATIVE CONTROLS
10.80.12.0/24 remains present
10.70.0.0/16 remains unchanged
0.0.0.0/0 keeps its previous state
No empty-condition Drop rule exists

If the broad Contains rule were a Drop, every production subnet below the /16 would disappear. If an earlier rule terminated processing, later exceptions would never run. Do not remove Azure BGP communities or use reserved ASNs in AS-path modifications.

Build a versioned candidate and canary it

powershell 05-create-route-map-candidate.ps1
$Criterion = New-AzRouteMapRuleCriterion -MatchCondition "Equals" -RoutePrefix @("10.90.0.0/16")
$Action = New-AzRouteMapRuleAction -Type "Drop"
$Rule = New-AzRouteMapRule -Name "drop-lab-summary" -MatchCriteria @($Criterion) -RouteMapRuleAction @($Action) -NextStepIfMatched "Terminate"

New-AzRouteMap -ResourceGroupName "rg-connectivity-prod" -VirtualHubName "ars-hub-prod" -Name "rm-inbound-nva-branches-v1" -RouteMapRule @($Rule)

This minimal example proves the object shape; it does not justify attachment to every production connection. Use a canary BGP peering or gateway connection that carries representative routes without being the only path for a critical workload. Without a credible canary, hold attachment for a maintenance window with explicit rollback authority.

Apply the map through the portal or the supported InboundConnection or OutboundConnection parameters. Verify resource IDs, not display names. Inbound attachment to the wrong NVA can change best-path selection; outbound attachment changes what the downstream network receives.

Prove the result through to the workload

Wait for Succeeded, then use the Route Map dashboard to compare routes, AS paths and communities before and after processing. Continue through the control plane: expected connection, Route Server path, consuming VNet, workload effective route, then a bounded bidirectional probe.

bash 06-validate-route-map.sh
RG="rg-connectivity-prod"
RS="ars-hub-prod"
PEER="nva-branch-a"

az network routeserver peering list-learned-routes -g "$RG" --routeserver "$RS" -n "$PEER" -o json > learned-after.json
az network nic show-effective-route-table -g rg-orders-prod -n nic-orders-02 -o json > effective-orders-after.json

jq -r '.value[]
| select(.addressPrefix[]? == "10.80.12.0/24"
      or .addressPrefix[]? == "10.90.0.0/16"
      or .addressPrefix[]? == "10.70.0.0/16")
| {source,state,addressPrefix,nextHopType,nextHopIpAddress}' effective-orders-after.json

Route counts are an alarm, not a validation. Aggregation can intentionally reduce the count; an unchanged count can hide one lost production prefix replaced by an unexpected route. Compare named prefixes and attributes. Monitor BGP peer availability and learned-route counts, but keep application probes because Route Server exchanges routes rather than forwarding packets.

Diagnose before adding another rule

  • Present before the map but absent after inbound processing: inspect match, order and action.
  • Present in Route Server but absent from a spoke: inspect propagation, peering consumption and competing prefixes.
  • Present on the workload NIC but traffic fails: inspect NVA policy, next hop and return path.
  • Inbound unchanged but downstream advertisement differs: inspect the outbound map and association.
  • No effect after first creation: check the one-time upgrade, provisioning, direction and connection.

Do not compensate with a UDR while the map effect is unexplained. That creates a second policy layer and can leave asymmetric routing after the map is corrected.

Decide, validate and roll back

text 07-route-map-decision.txt
PROMOTE
Correct connection and direction
Dropped prefixes exactly match the contract
Preserved and control prefixes keep expected paths and attributes
Critical effective routes and bidirectional probes are healthy

HOLD ON CANARY
First-map upgrade or provisioning is incomplete
A connection cannot be reconciled with the baseline
No representative negative control was tested

CORRECT A BOUNDED RULE
One criterion, action, next step or rule order explains the delta
The correction receives a new policy version
The full matrix is replayed before wider attachment

ROLL BACK
Detach the candidate from the affected connection
Restore the previous association, if one existed
Wait for BGP convergence
Re-read learned, advertised and workload effective routes
Prove critical and control flows before closure

Detach before deleting. Keeping the failed map object temporarily preserves the rules for comparison while the previous association converges. Delete it only after baseline routes and functional probes are restored.

Conclusion

An Azure Route Server route map is production routing policy, not a cosmetic filter. Direction, connection, prefix criterion, rule order and stop behavior determine which routes participate in path selection or leave the hub.

Freeze the contract, account for the first-map upgrade, canary on a representative connection and validate named prefixes through to workload effective routes. Promote only when preserved routes are as explicit as dropped routes. If evidence diverges, detach the map and restore the previous association before adding any compensating route.