Skip to main content

Virtual Network

An Azure Virtual Network (VNet) is your private, isolated network in Azure, with its own address space, subnets, and routing. VMs, App Service integrations, and databases use it to communicate with each other, the internet, and on-premises networks.

Virtual Network

A VNet is scoped to one region and one subscription, and defines address space in CIDR notation, which you divide into subnets. Resources in different VNets cannot talk by default, so you connect them with peering, a VPN, or ExpressRoute. NSGs, route tables, private endpoints, and service endpoints all operate at the subnet level inside a VNet.

What Lives Inside a VNet?

  • Address space: One or more CIDR blocks such as 10.20.0.0/16.
  • Subnets: Slices of that space where resources attach.
  • NSGs: Traffic filtering at the subnet or NIC.
  • Route tables: Custom routing, for example through a firewall.
  • Peering and gateways: Links to other VNets and on-premises networks.

Azure reserves 5 IP addresses in every subnet, so a /29 leaves only 3 usable addresses.

How Do You Create a VNet?

Bash
az network vnet create --resource-group mumbai-prod-rg \
--name mumbai-prod-vnet --address-prefix 10.20.0.0/16 \
--subnet-name app-subnet --subnet-prefix 10.20.1.0/24
flowchart TD V["mumbai-prod-vnet
10.20.0.0/16"]:::tool V -->|subnet| A["app-subnet
10.20.1.0/24"]:::cloud V -->|subnet| D["db-subnet
10.20.2.0/24"]:::cloud V -->|subnet| P["pe-subnet
10.20.5.0/24"]:::app classDef tool fill:#326CE5,color:#FFFFFF classDef cloud fill:#D1FAE5,color:#1E293B classDef app fill:#EDE9FE,color:#1E293B

Why It Matters in Production

A streaming company like Hotstar can run one VNet per environment with non-overlapping ranges, so peering them or linking to on-premises systems never causes address conflicts.

Common Mistake

Using overlapping CIDR ranges across VNets that may later peer or connect by VPN. Peering fails on overlap, and re-addressing a live network is disruptive, so plan one non-overlapping scheme for the whole organisation.

Remember

You can add address ranges to an existing VNet, but resizing or removing ranges that contain resources is disruptive, and peered networks must be resynchronised afterwards.

Frequently Asked Questions

Can resources in two VNets communicate?

Not by default. Connect them with VNet peering, a VPN gateway, or via a hub network, and make sure the address spaces do not overlap.

Is a VNet regional or global?

A VNet is regional. Global VNet peering lets VNets in different regions connect over the Microsoft backbone.

What is the difference between a VNet and a subnet?

The VNet is the whole private network and address space, and a subnet is a smaller range inside it. NSGs and routes are normally applied per subnet.

Found a mistake, an outdated step or a broken link?