Networking Virtual networking verified field-manual operator-field-manual

VNet peering

VNet peering is how you connect two Azure virtual networks without sending traffic over the public internet. After both sides are peered, VMs, private endpoints, databases, and applications can talk across the networks using private IP addresses, subject to routes, NSGs, DNS, and service rules. It is commonly used for hub-and-spoke networks, shared services, cross-region designs, and migrations. Peering is not magic transitive networking: if VNet A peers with B and B peers with C, A still cannot reach C unless you add routing through a hub or another explicit connection.

Aliases
virtual network peering, Azure VNet peering, peered virtual networks, hub-spoke peering
Difficulty
fundamentals
CLI mappings
5
Last verified
2026-05-29

Microsoft Learn

VNet peering connects two Azure virtual networks so resources can communicate privately over the Microsoft backbone, within a region or across regions. Each side has a peering object, and routing, DNS, security rules, and gateway settings still require design securely.

Microsoft Learn: Virtual network peering2026-05-29

Technical context

Technically, VNet peering creates Microsoft.Network/virtualNetworks/virtualNetworkPeerings child resources under each participating virtual network. The connection can be local or global, can span subscriptions or tenants with proper permissions, and requires nonoverlapping address spaces. Options such as allowVirtualNetworkAccess, allowForwardedTraffic, allowGatewayTransit, and useRemoteGateways affect routing behavior. Peering sits in the network control plane but changes data-plane reachability for workloads. It does not automatically merge DNS, bypass NSGs, create UDRs, or make hub routing transitive. Operators must validate both peering directions and the effective routes seen by resources.

Why it matters

VNet peering matters because most Azure estates outgrow a single virtual network quickly. Shared firewalls, private DNS, identity services, jump hosts, data platforms, and application environments often live in separate VNets for ownership or blast-radius reasons. Peering lets those networks communicate with low latency and private addressing, but a small mistake can open lateral movement, break name resolution, or create expensive cross-region data flow. It also influences migration sequencing: teams can connect old and new landing zones while services move. Good peering design makes connectivity explicit, monitored, and owned instead of becoming an invisible mesh no one can safely change.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

In the Virtual network Peerings blade, each VNet shows its peering name, remote virtual network, peering status, traffic access, and gateway options. before operators approve private connectivity.

Signal 02

In Azure CLI output, peering properties expose allowForwardedTraffic, allowGatewayTransit, useRemoteGateways, remoteVirtualNetwork ID, and provisioning state for both directions. during change review before production cutover approval.

Signal 03

In connectivity troubleshooting, effective routes and Network Watcher tests reveal whether traffic crosses peering directly, follows a UDR, or misses a required peer. during incident triage.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Connect application spokes to a shared-services hub that hosts firewalls, DNS, identity, or management tools.
  • Bridge old and new VNets during migration without exposing private workloads through public endpoints.
  • Enable cross-region private connectivity where replication or active-active application components need direct VNet paths.
  • Use gateway transit so a spoke can reach on-premises through a controlled hub gateway design.
  • Troubleshoot private connectivity by proving whether both peering directions, routes, and DNS are aligned.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

SaaS hub-and-spoke onboarding without public endpoints

SaaS hub-and-spoke onboarding without public endpoints: VNet peering is powerful when it creates intentional hub connectivity without turning a segmented platform into an accidental mesh.

Scenario

A B2B SaaS provider needed to onboard twelve customer-specific application spokes to a shared platform hub. Early teams used public endpoints for shared logging and identity services because every spoke was isolated.

Business/Technical Objectives
  • Move shared service access to private IP paths.
  • Keep customer spokes segmented from each other.
  • Route egress inspection through the hub firewall.
  • Onboard new spokes with repeatable network evidence.
Solution Using VNet peering

The network team standardized VNet peering from each spoke to the hub and enabled forwarded traffic only where the approved firewall path required it. They avoided spoke-to-spoke peerings, published private DNS zones from the hub pattern, and used Azure CLI to create both peering directions with explicit VNet resource IDs. Effective route checks were added to the onboarding pipeline so each spoke proved it reached logging and identity endpoints through the expected private route. Security reviewed NSG rules to prevent the VirtualNetwork service tag from becoming an overly broad trust boundary.

Results & Business Impact
  • Public endpoints for three shared services were retired within one quarter.
  • New customer spoke onboarding dropped from eight hours of manual setup to 47 minutes.
  • No customer spoke gained direct private connectivity to another customer spoke.
  • Firewall logs provided full evidence for regulated customer network reviews.
Key Takeaway for Glossary Readers

VNet peering is powerful when it creates intentional hub connectivity without turning a segmented platform into an accidental mesh.

Case study 02

Architecture firm migration bridge across subscriptions

Architecture firm migration bridge across subscriptions: A temporary VNet peering can be a safe migration bridge when creation, tagging, validation, and removal are all scripted.

Scenario

An architecture firm moved a document-management system from a legacy subscription into a governed landing zone. The application and database had to run in parallel for six weeks while teams migrated project archives.

Business/Technical Objectives
  • Keep legacy and landing-zone workloads connected privately.
  • Avoid readdressing the legacy network during migration.
  • Remove the temporary connection after cutover.
  • Give auditors proof that access was time-bound.
Solution Using VNet peering

Cloud engineers created cross-subscription VNet peering using the full remote VNet resource IDs and nonoverlapping address spaces. They added narrowly scoped NSG rules for the archive application, created a private DNS forwarding plan, and tagged the peerings with an expiration date. Azure CLI inventory ran weekly to prove the peerings still matched the migration ticket and did not enable gateway transit or broad forwarded traffic. After cutover, the same script identified and deleted both peering directions, then Network Watcher tests confirmed the legacy subnet could no longer reach the new database.

Results & Business Impact
  • Archive synchronization finished with zero public firewall exceptions.
  • Migration traffic averaged 42% lower latency than the previous VPN workaround.
  • The temporary peerings were removed two days after cutover instead of lingering for months.
  • Audit review accepted the exported peering inventory as decommissioning evidence.
Key Takeaway for Glossary Readers

A temporary VNet peering can be a safe migration bridge when creation, tagging, validation, and removal are all scripted.

Case study 03

Online learning platform avoids transitive routing outage

Online learning platform avoids transitive routing outage: VNet peering connects two networks, but reliable hub-and-spoke architecture still requires explicit routing and DNS design.

Scenario

A global online learning platform added a new analytics VNet and assumed it could reach classroom services through an existing peered hub. The launch rehearsal failed because VNet peering did not provide transitive connectivity.

Business/Technical Objectives
  • Restore analytics access before the semester launch.
  • Avoid emergency full-mesh peering across all VNets.
  • Keep traffic inspection in the central hub.
  • Document the correct routing model for future teams.
Solution Using VNet peering

Architects corrected the design by adding the analytics VNet as a proper spoke, enabling only approved hub peering options, and creating UDRs that sent analytics traffic through the firewall NVA. They did not create direct peerings to every classroom VNet. Azure CLI checks showed peering state, forwarded-traffic flags, remote VNet IDs, and effective routes from analytics test VMs. The platform team updated diagrams and added a deployment gate that rejects new spokes unless the hub route table and peering flags are validated together. Private DNS records were tested from analytics subnets before launch.

Results & Business Impact
  • The rehearsal connectivity failure was fixed in one afternoon without redesigning classroom VNets.
  • Analytics ingestion met the launch SLO with P95 network latency under 18 milliseconds regionally.
  • Future spoke onboarding incidents dropped by 75% over the next two terms.
  • Security preserved central firewall inspection instead of approving uncontrolled mesh connectivity.
Key Takeaway for Glossary Readers

VNet peering connects two networks, but reliable hub-and-spoke architecture still requires explicit routing and DNS design.

Why use Azure CLI for this?

I use Azure CLI for VNet peering because peering is two-sided and easy to misread in the portal. CLI can show every peering on both VNets, the remote VNet ID, connection state, gateway flags, forwarded-traffic setting, and whether a sync is needed after address-space changes. It also makes cross-subscription work practical because engineers can paste exact resource IDs rather than relying on portal visibility. In production, I want peering creation and updates in scripts or pipelines so reviewers can see which routes and gateway-transit behaviors are being enabled. CLI evidence is much faster than screenshots during connectivity incidents. every time.

CLI use cases

  • List all peerings for a VNet and confirm remote network IDs and connection states.
  • Create both directions of a peering using explicit resource IDs for cross-subscription networks.
  • Update allow-forwarded-traffic or gateway-transit settings after architecture approval.
  • Sync a peering after remote address-space changes so routes reflect the current prefixes.
  • Export peering inventory across subscriptions for security review and stale-connection cleanup.

Before you run CLI

  • Confirm tenant, subscription, resource groups, VNet names, remote VNet resource ID, and whether address spaces overlap.
  • Check Network Contributor or custom peering permissions on both VNets, especially across tenants or subscriptions.
  • Decide whether forwarded traffic, gateway transit, or remote gateway usage is approved for this topology.
  • Review cost and blast radius before creating cross-region or production-to-nonproduction peerings.
  • Use JSON output and explicit IDs because friendly VNet names often repeat across environments.

What output tells you

  • Peering state tells you whether Azure considers each side Initiated, Connected, Updating, or disconnected.
  • Remote VNet ID proves exactly which network is connected, which matters across subscriptions and tenants.
  • Gateway and forwarded-traffic flags explain whether hub routing, on-premises transit, or NVA paths are allowed.
  • Provisioning state and sync information help identify address-space changes or incomplete updates.
  • Effective route tests show whether workload traffic follows the peering, a firewall hop, or an unexpected route.

Mapped Azure CLI commands

VNet peering CLI commands

direct
az network vnet peering list --resource-group <resource-group> --vnet-name <vnet-name> --output table
az network vnet peeringdiscoverNetworking
az network vnet peering show --resource-group <resource-group> --vnet-name <vnet-name> --name <peering-name>
az network vnet peeringdiscoverNetworking
az network vnet peering create --resource-group <resource-group> --vnet-name <local-vnet> --name <peering-name> --remote-vnet <remote-vnet-id> --allow-vnet-access
az network vnet peeringprovisionNetworking
az network vnet peering update --resource-group <resource-group> --vnet-name <vnet-name> --name <peering-name> --allow-forwarded-traffic true
az network vnet peeringsecureNetworking
az network vnet peering sync --resource-group <resource-group> --vnet-name <vnet-name> --name <peering-name>
az network vnet peeringoperateNetworking

Architecture context

Architecturally, VNet peering is the connective tissue of hub-and-spoke and segmented Azure networks. It should be designed with address management, route tables, firewalls, private DNS, subscription ownership, and environment boundaries. I avoid casual full-mesh peering unless the scale is small and governance is strong; hub-and-spoke patterns usually make inspection and shared services clearer. Gateway transit is a specific design choice, not a default, because it affects on-premises reachability and route propagation. Every diagram should show which VNets are peered, which direction allows forwarded traffic, where DNS resolves private names, and whether traffic is expected to pass through an NVA, firewall, VPN gateway, or directly between workloads.

Security

Security impact is direct because peering expands private reachability. NSGs still apply, but the VirtualNetwork service tag can include peered address space when access is allowed, which may broaden rules more than expected. Peering does not encrypt traffic beyond Azure's platform protections, and it does not inspect traffic by itself. Use route tables, Azure Firewall, NVAs, NSGs, and private DNS governance where inspection or segmentation is required. Limit who can create or delete peerings, especially across subscriptions and tenants. Security reviews should flag overlapping address plans, unnecessary forwarded traffic, accidental gateway transit, and peerings that connect production networks to weakly governed dev environments.

Cost

VNet peering has cost impact through ingress and egress data transfer, especially across regions or high-volume hub-and-spoke designs. The peering object itself is simple, but chatty services, backup flows, analytics pipelines, and cross-region replication can create large recurring network charges. Peering can also reduce cost by avoiding unnecessary VPN gateways or public data paths for private Azure-to-Azure communication. FinOps teams should tag network owners, monitor bandwidth across peered boundaries, and challenge designs where a workload frequently crosses regions for data it could consume locally. Good cost design uses peering deliberately, not as a free substitute for data locality.

Reliability

Reliability improves when services can use stable private paths instead of public endpoints or fragile tunnels, but peering changes can also create outages. Deleting one peering breaks the connection, address-space changes may require sync, and gateway-transit settings can affect on-premises routes. Because peering is not transitive, missing explicit paths often surface during failover or migration testing. Reliable designs document both sides of the peering, automate creation, reserve nonoverlapping CIDR ranges, monitor connection state, and validate effective routes from representative subnets. Before major changes, operators should know which applications, private endpoints, DNS zones, and firewall paths depend on the peering. later.

Performance

Performance is one of the main reasons to use VNet peering. Traffic stays on the Microsoft backbone and generally has low latency and high bandwidth compared with internet-routed paths. However, performance still depends on VM size limits, appliance hops, UDRs, firewall inspection, region distance, DNS behavior, and application protocol design. Forced hairpinning through a hub firewall may be correct for security but adds latency. Global peering can be fast, but it cannot erase geography. Operators should test actual application paths, inspect effective routes, and compare direct peered traffic with inspected routes before blaming the application or scaling compute. under load.

Operations

Operators inspect VNet peering when a workload cannot reach a private IP, when a hub firewall path changes, or when a new spoke is onboarded. The usual checks are peering state on both sides, remote VNet ID, gateway transit flags, forwarded-traffic flags, address-space sync status, NSGs, UDRs, and DNS resolution. Changes should be made with resource IDs and reviewed in source control because display names are easy to confuse across subscriptions. Operations teams also keep an inventory of peerings by environment and owner, remove stale migration peerings, and test connectivity from real subnets instead of only checking that the peering status says Connected.

Common mistakes

  • Creating only one side of a peering and assuming traffic will flow before the remote side is connected.
  • Forgetting that VNet peering is not transitive unless routing through a hub or appliance is explicitly designed.
  • Using broad NSG rules with the VirtualNetwork service tag and accidentally trusting peered address spaces.
  • Enabling gateway transit or forwarded traffic without understanding on-premises reachability and inspection paths.
  • Peering networks with poorly planned or overlapping address spaces, which blocks the connection or future expansion.