You will deploy an Azure Virtual Network with tiered subnets and peer it to a second VNet. By the end you will have a segmented cloud network foundation that VMs and services can join.

Learning Objectives

  • Create a VNet with non-overlapping subnets.
  • Peer two VNets for private connectivity.
  • Verify routing between peered networks.
  • Time: ~2 hours · Difficulty: Intermediate · Prereqs: the Azure CLI configured.

Architecture Overview

Environment Setup

You will need: the Azure CLI authenticated with a default resource group set.

Before you begin: plan non-overlapping CIDR ranges; peered VNets cannot overlap.

Step-by-Step Execution

01
Create the VNet and subnets
az network vnet create -n vnet-a --address-prefixes 10.0.0.0/16 --subnet-name web --subnet-prefixes 10.0.1.0/24
02
Add a second subnet
az network vnet subnet create --vnet-name vnet-a -n app --address-prefixes 10.0.2.0/24
03
Peer two VNets
$ az network vnet peering create -n a-to-b --vnet-name vnet-a --remote-vnet vnet-b --allow-vnet-access
"peeringState": "Connected"

Progress So Far

Testing & Validation

az network vnet peering show -n a-to-b --vnet-name vnet-a --query peeringState -o tsv

You should see Connected. With both directions peered, resources in app and data subnets can reach each other privately.

Troubleshooting
  • Peering stuck at Initiated: create the peering in both directions; it requires a pair.
  • Overlapping address space: peered VNets must use non-overlapping CIDR ranges.
  • No connectivity despite peering: check NSGs and that --allow-vnet-access is set.

Extension Ideas

Key Results

  • Deployed a VNet with two non-overlapping subnets.
  • Connected two VNets via bidirectional peering.
  • Confirmed the peering reached the Connected state.
  • Built a segmented foundation for cloud workloads.