What is a Virtual Network (VNet)?
A Virtual Network (VNet) is the fundamental building block of Azure networking.
It’s like a private, isolated network in the cloud that lets your Azure resources securely communicate with each other, the internet, and on-premises networks.
-
VNets are similar to traditional networks in a datacenter but with the scalability of Azure.
-
You define the IP address space (using private IP ranges).
-
VNets can be connected together using peering or to on-premises using VPN Gateway/ExpressRoute.
Subnets
A Subnet is a logical division of a VNet.
-
Helps organize and isolate workloads.
-
Each subnet gets a portion of the VNet’s IP address space.
-
Security rules (via NSGs) can be applied at the subnet level.
Example:
-
VNet address space: 10.0.0.0/16
-
Subnet1: 10.0.1.0/24 (for web servers)
-
Subnet2: 10.0.2.0/24 (for databases)
Key Features of VNets
-
Isolation: VNets are private by default.
-
Communication: Resources in the same VNet can talk to each other.
-
Peering: Connect two VNets (even across regions) so resources communicate as if they are in the same network.
-
Hybrid connectivity: Use VPN Gateway or ExpressRoute to connect VNet to on-premises networks.
Confusion Buster 🚨
-
VNet vs Subnet
-
VNet = entire network boundary.
-
Subnet = smaller division inside the VNet.
-
-
NSG vs Azure Firewall
-
NSG filters traffic at the subnet/NIC level.
-
Firewall is a centralized service for traffic control across VNets.
-
Exam trick: If the requirement says “divide workloads inside a network”, answer is usually Subnet. If it says “connect two networks”, answer is VNet Peering.
Simple Example
A company sets up a VNet (10.1.0.0/16).
-
Subnet A (10.1.1.0/24) → hosts web servers.
-
Subnet B (10.1.2.0/24) → hosts database servers.
An NSG is applied on Subnet B to block direct internet traffic, allowing only traffic from Subnet A.
Exam Tip
-
If you see the word “isolation”, think VNet.
-
If you see “segmentation of workloads”, think Subnet.
-
If the scenario involves cross-region communication, the solution is VNet Peering.
What to Expect in the Exam
-
Direct Q: “What is the fundamental unit of Azure networking?” → Virtual Network.
-
Scenario: “Web tier must communicate with DB tier but DB tier must not be internet-facing.” → Use Subnets + NSGs.
-
Trick Q: “Two VNets in different regions cannot be connected.” (False — VNet Peering allows it).