Home › Studies › AZ-104 › Virtual Networking › VNet Peering

VNet Peering

regional · global · both directions · forwarded traffic · gateway transit · address space changes

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

How peering works

Peering settings (set per direction)

Setting (portal label)CLI flagPortal defaultWhat it does
Allow access to remote virtual network--allow-vnet-accessOnVMs in this vnet can reach the remote vnet
Allow forwarded traffic--allow-forwarded-trafficOffAccepts traffic that didn't originate in the peer. It doesn't create UDRs or NVAs
Allow gateway / route server in this vnet to forward traffic to the peer--allow-gateway-transitOffThis vnet's gateway can serve the peer. Needs a gateway or route server
Use the remote vnet's gateway / route server--use-remote-gatewaysOffThis vnet uses the peer's gateway

In the CLI reference all four flags show a default of False, while the portal pre-selects Allow access. The CLI example always passes --allow-vnet-access.

Gateway transit rules

Configure and operate

CLI and PowerShell

TaskAzure CLIPowerShell
Create one direction (run for each direction)az network vnet peering create -n vnet-1-to-vnet-2 --vnet-name vnet-1 --remote-vnet vnet-2 -g test-rg --allow-vnet-access --allow-forwarded-trafficAdd-AzVirtualNetworkPeering -Name vnet-1-to-vnet-2 -VirtualNetwork $vnet1 -RemoteVirtualNetworkId $vnet2.Id
List / showaz network vnet peering list, az network vnet peering showGet-AzVirtualNetworkPeering
Change a settingaz network vnet peering update ... --set allowForwardedTraffic=falseSet $peering.AllowForwardedTraffic, then Set-AzVirtualNetworkPeering
Sync after an address space changeaz network vnet peering sync -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1Sync from the portal or PowerShell
Deleteaz network vnet peering deleteRemove-AzVirtualNetworkPeering

Exam Tips

Tick each tip once you can answer it without looking.

“Peering status shows Initiated” → The reverse peering isn't created yet: create it from the remote vnet. Trap: Waiting for propagation, or deleting and recreating.

“Hub peered to spoke A and spoke B; A can't reach B” → Peering isn't transitive: add a direct A-B peering, or route through an NVA in the hub. Trap: Enabling gateway transit. It shares a gateway; it doesn't make peering transitive.

“Create a peering with the Azure CLI” → Run az network vnet peering create once from each vnet. Trap: Expecting one command to create both directions. Only the portal wizard does.

“Two vnets both use 10.0.0.0/16” → They can't be peered: address spaces must not overlap. Trap: Assuming peering works if the subnets differ.

“Spokes need to use the hub's VPN gateway” → Hub peering: allow gateway transit. Spoke peering: use remote gateways. Trap: Setting use remote gateways on the hub side.

“Spoke has its own VPN gateway; you enable use remote gateways” → Not possible: a vnet that has a gateway can't use a remote gateway. Trap: Thinking both gateways can coexist.

“Temporarily stop traffic between peered vnets” → Clear "Allow traffic to remote virtual network" on the peering. Trap: Deleting the vnet or its subnets.

“Move a peered vnet to another subscription” → Delete the peering, move the vnet, recreate the peering. Trap: Using Move directly.

“Client can't reach an internal Basic load balancer frontend in a globally peered vnet” → Basic front ends aren't reachable over global peering: use a Standard load balancer. Trap: Adding an NSG rule.

“VMs in peered vnets can't resolve each other's names” → Default Azure DNS doesn't resolve across vnets: use Azure Private DNS or a custom DNS server. Trap: Enabling "Allow forwarded traffic".

“Add address space to a peered vnet” → Allowed without downtime; then sync the peering. Trap: Deleting and recreating the peering.

“Confirm peering at the NIC level” → Effective routes show next hop type Virtual network peering. Trap: Looking at effective security rules.

“Delete the peering from vnet A” → The peering on vnet B is removed too. Trap: Expecting B's peering to be left behind.

“Role needed to create a peering” → Network Contributor (virtualNetworkPeerings/write). Trap: Granting Reader only. The role needs the peering write action.

“Peer vnets in different Microsoft Entra tenants” → Supported: add a guest user from each tenant in the other when using resource IDs. Trap: Believing peering doesn't work across tenants.

“Peer a public-cloud vnet with a 21Vianet vnet” → Not supported: peering can't cross clouds. Trap: Using global peering.

“CLI peering created with no flags; VMs still can't talk” → Add --allow-vnet-access on both peerings (the CLI reference default is False). Trap: Assuming the CLI default matches the portal's, which is on.

“Address space of a peered vnet was changed” → Run az network vnet peering sync (or sync in the portal or PowerShell). Trap: Deleting and recreating the peering.

Sources

Checked against Microsoft Learn on November 13, 2026.

← VNets & SubnetsPublic IP Addresses →