An Azure virtual network is a private IP address space for Azure resources. Subnets divide it into policy and routing boundaries. Network security groups filter traffic, route tables influence paths, DNS resolves names, NAT Gateway provides stable outbound connectivity, peering joins VNets, and private endpoints give supported services private IP addresses.
Lab: 45 minutes · Cost: VNet/subnet/NSG are generally not separately charged; NAT Gateway, public IPs, peering traffic, Private Link, firewall, and gateways can be billable · Cleanup: delete the lab resource group.
Start with non-overlapping RFC 1918 ranges and leave room for growth. Example:
Azure reserves addresses in every subnet. Some services require dedicated or delegated subnets and minimum sizes. Check current product guidance before finalizing an enterprise IP plan.
Ways to build
Choose the Azure tool you want to use. The underlying resource stays the same.
NSGs contain prioritized allow/deny rules for inbound and outbound traffic. Azure evaluates lower priority numbers first. Default rules exist. Associate NSGs with subnets for consistent policy and, when required, network interfaces for additional precision.
Do not add 0.0.0.0/0 SSH or RDP rules for convenience. Use Bastion, a private connection, or time-bound controlled access.
Azure supplies system routes. A user-defined route can send traffic through a firewall or appliance. NAT Gateway gives supported subnets scalable outbound internet access with stable public IPs; it does not accept unsolicited inbound connections. Service endpoints keep service traffic on the Azure backbone but the service still has a public endpoint. Private endpoints place a network interface with a private IP in your VNet.
Applications still use the service's normal hostname. Private DNS must resolve that hostname to the private endpoint IP inside the network. A private endpoint without correct DNS often produces confusing timeouts or sends clients to the public endpoint.
Link the service-specific private DNS zone to each VNet that must resolve it. Hybrid networks need DNS forwarding or Azure DNS Private Resolver design.
Bicep:
Terraform uses azurerm_virtual_network, azurerm_subnet, azurerm_network_security_group, and explicit association resources. Production modules should validate CIDRs, expose only intentional inputs, and avoid implicit dependencies.
The VNet lab is inside the resource group. Delete the group after all dependent labs, or remove only its network resources when safe.