Configuring Azure VNet Peering
AZ-104 notes: Configuring Azure VNet Peering. Covers key concepts for the Azure Administrator Associate exam.
This lesson explains how to connect isolated virtual networks using:
Azure Virtual Network VNet Peering
1️⃣ What Is VNet Peering?
By default:
- VNets are isolated
- No communication between them
- Even within same subscription
VNet Peering enables:
- ✔ Private IP communication ✔ High-speed backbone connectivity ✔ Cross-region connectivity ✔ Cross-subscription connectivity ✔ Cross-tenant connectivity
2️⃣ Requirements for VNet Peering
✔ Non-overlapping IP address space
- If CIDR overlaps → Peering fails
Example:
- VNet-A → 172.16.0.0/24
- VNet-B → 10.0.0.0/16
- This works.
- VNet-A → 172.16.0.0/24
- VNet-B → 172.16.0.0/16
- This fails (overlapping).
3️⃣ Key Characteristics
🔹 Private connectivity only
Traffic flows over Azure backbone.
🔹 Not encrypted by default
Unlike VPN (IPsec), peering is not encrypted unless VNet encryption is enabled.
🔹 Non-transitive
Very important concept:
If:
- VNet-A ↔ VNet-Hub
- VNet-B ↔ VNet-Hub
- VNet-A ❌ cannot talk to VNet-B automatically.
- Each pair requires its own peering.
4️⃣ Types of VNet Peering
✔ Regional Peering
Same Azure region
✔ Global Peering
Across regions
✔ Cross-Subscription Peering
Different subscriptions
✔ Cross-Tenant Peering
Different Azure AD tenants
5️⃣ Demonstration Summary
Environment:
- VNet-Prod-01 → 172.16.0.0/24
- VM: 172.16.0.4
- VNet-Prod-02 → 10.0.0.0/16
- VM: 10.0.0.4
Before peering:
- Ping 10.0.0.4 → ❌ Failed
After peering:
- Ping 10.0.0.4 → ✅ Success
6️⃣ How Peering Is Created
Peering must be:
- ✔ Configured on both VNets ✔ Azure portal creates both sides automatically
Each side has:
- Peering name
- Remote VNet
- Allow forwarded traffic option
- Gateway usage options
7️⃣ Important Peering Options Explained
8️⃣ Gateway Transit Scenario (Hub-Spoke)
Example:
- Hub VNet → Has VPN Gateway
- Spoke VNet → Uses remote gateway
Configuration:
- Hub: ✔ Allow gateway transit
- Spoke: ✔ Use remote gateway
- This allows spokes to use hub’s gateway.
9️⃣ VNet Peering vs VPN
🔟 Routing with Peering
When peering is created:
Azure automatically:
- ✔ Adds system routes ✔ Updates effective routes ✔ Enables private communication
- No manual route table required.
11️⃣ Security Considerations
Peering enables connectivity, but:
- NSGs still apply
- Route tables still apply
- Firewall rules still apply
- Peering ≠ unrestricted access.
12️⃣ Common Exam Concepts (AZ-104 / AZ-700)
🚩 Peering is transitive → False 🚩 Peering requires same region → False 🚩 Peering requires non-overlapping CIDR → True 🚩 Peering traffic is encrypted by default → False 🚩 Peering works across subscriptions → True
13️⃣ Hub-and-Spoke Architecture Example
- Hub
- / \
- Spoke1 Spoke2
- Spoke1 ↔ Hub Spoke2 ↔ Hub
- Spoke1 ❌ Spoke2 (unless directly peered)
14️⃣ Troubleshooting Checklist
If peering not working:
- Check IP ranges overlap?
- Confirm peering status = Connected
- Check NSGs blocking traffic
- Check UDRs overriding routes
- Verify gateway transit settings
15️⃣ Reference Documentation
- VNet Peering Overview
- Global VNet Peering
- Hub-Spoke Architecture
- Effective Routes
Final Conceptual Summary
VNet Peering:
- Connects isolated VNets
- Uses Azure backbone
- Requires non-overlapping IPs
- Is non-transitive
- Not encrypted by default
- Supports cross-region & cross-subscription
It is the foundational building block of:
- ✔ Hub-spoke designs ✔ Enterprise multi-VNet environments ✔ Partner connectivity ✔ Mergers & acquisitions scenarios
If you'd like next:
- 🧠 25 VNet peering scenario-based exam questions
- 📊 Hub-spoke visual breakdown
- 🏗 Peering + Gateway Transit deep dive
- 📄 Complete AZ-104 networking recap sheet
- Tell me your target exam (AZ-104, AZ-700, AZ-305?).
Hands-on: Peer Two VNets
Goal: Connect two VNets over the Azure backbone and validate private IP connectivity.
- Create VNet
az104-vnet-awith address space10.60.0.0/16. - Create VNet
az104-vnet-bwith address space10.61.0.0/16. - Deploy one test VM in each VNet.
- Open
az104-vnet-a > Peerings > Add. - Name the local peering
a-to-band remote peeringb-to-a. - Select
az104-vnet-bas the remote VNet. - Enable traffic to the remote virtual network.
- Create the peering.
- Confirm both peering objects show Connected.
- Allow ICMP or a test TCP port in both VM NSGs.
- Test private IP connectivity between VMs.
Hands-on: Validate Non-Transitive Peering
- Create a third VNet
az104-vnet-c. - Peer A to B and B to C.
- Do not peer A to C.
- Try reaching C from A.
- Confirm traffic does not automatically transit through B.
- Use this result to remember the exam point: VNet peering is non-transitive unless you introduce routing appliances or hub-spoke services.
