Home › Studies › AZ-104 › Virtual Networking › VNets & Subnets

VNets & Subnets

address space · subnets · reserved IPs · DNS · delegation · default outbound access

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

Virtual network basics

Subnets and addresses

ItemValue
Smallest / largest IPv4 subnet/29 / /2
IPv6 subnet sizeExactly /64
Reserved addresses per subnet5: the first four and the last
Example for 192.168.1.0/24.0 network address, .1 default gateway, .2 and .3 Azure DNS mapping, .255 broadcast
Usable addresses in a /293
Virtual networks per subscription (per region)1,000
Subnets per virtual network3,000
Private IP addresses per virtual network65,536
DNS servers per virtual network20

Subnet ranges must sit inside the vnet address space and can't overlap each other. Classic subnetting removes 2 addresses; Azure removes 5.

Changing a virtual network

DNS

Subnet delegation

Default outbound access

CLI and PowerShell

TaskAzure CLIPowerShell
Create vnetaz network vnet create -g myRG -n myVNet (default space 10.0.0.0/16)New-AzVirtualNetwork -ResourceGroupName myRG -Name myVNet -Location eastus -AddressPrefix 10.0.0.0/16
Create vnet with first subnetaz network vnet create ... --address-prefix 10.0.0.0/16 --subnet-name subnet-1 --subnet-prefix 10.0.0.0/24New-AzVirtualNetworkSubnetConfig, then New-AzVirtualNetwork -Subnet
Replace address spaceaz network vnet update -g myRG -n myVNet --address-prefixes 10.1.0.0/16 (replaces any previous ranges)Edit $vnet.AddressSpace.AddressPrefixes, then Set-AzVirtualNetwork
Set custom DNSaz network vnet update ... --dns-servers 10.0.0.10$vnet.DhcpOptions.DnsServers.Add("10.0.0.10"), then Set-AzVirtualNetwork
Delegate a subnetaz network vnet subnet update -g rg --vnet-name vnet-1 -n subnet-1 --delegations Microsoft.Sql/managedInstancesAdd-AzDelegation, then Set-AzVirtualNetwork
Remove delegationaz network vnet subnet update ... --remove delegationsRemove-AzDelegation, then Set-AzVirtualNetwork
Make subnet privateaz network vnet subnet update --resource-group rgname --name subnetname --vnet-name vnetname --default-outbound falseSet $subnet.DefaultOutboundAccess = $false, then Set-AzVirtualNetwork
Delete vnetaz network vnet deleteRemove-AzVirtualNetwork

Exam Tips

Tick each tip once you can answer it without looking.

“Smallest subnet you can create” → /29 (IPv4). Trap: /30 or /32. Azure's minimum is /29, and 5 of its 8 addresses are reserved.

“Usable IP addresses in a /28 subnet” → 11 (16 minus 5 reserved). Trap: 14, from classic subnetting that removes only 2.

“Which address in a subnet is the default gateway” → The first host address (.1). Trap: Assuming the gateway is .254. The last address is reserved as broadcast, and .2 and .3 map Azure DNS.

“Rename an existing virtual network or subnet” → Not possible: names can't change after creation. Trap: Looking for an edit-name option in the portal Properties.

“Add 10.1.0.0/16 to a vnet that already has a subnet in 10.0.0.0/16” → Add a second address range to the address space. Trap: Recreating the vnet. Nothing needs to be deleted.

“Can't delete an address range from the vnet” → A subnet still exists in that range: delete the subnets (and their resources) first. Trap: Dissociating the NSG. The subnet is what blocks the deletion.

“Add 168.63.129.16/32 or 169.254.0.0/16 as a vnet range” → Not allowed. Trap: Thinking it's allowed because it's a private-looking address.

“NIC of a VM must attach to a vnet in a different region” → Impossible: connected resources must be in the vnet's region and subscription. Trap: Peering lets a NIC use the remote vnet.

“VMs in two vnets must resolve each other's names with Azure-provided DNS” → Not supported: use a custom DNS server or an Azure Private DNS zone. Trap: Assuming peering gives built-in name resolution.

“Changed the vnet's custom DNS, but VMs still use the old servers” → Restart the VMs (or other resources). Trap: Waiting for DHCP to refresh it. The page documents only a restart.

“Two custom DNS servers are listed; the first one is broken” → Clients still try them in listed order, not round-robin. Trap: Assuming automatic failover to the second server.

“Deploy SQL Managed Instance into an existing subnet” → Delegate the subnet to Microsoft.Sql/managedInstances. Trap: Enabling a service endpoint. An endpoint only changes how traffic reaches a PaaS service.

“Delegate a subnet that someone else created” → Microsoft.Network/virtualNetworks/subnets/write (in Network Contributor). Trap: Looking for a role on the service. The permission needed is on the subnet.

“Run a DHCP server or multicast application in a vnet” → Not supported: multicast and broadcast are blocked, unicast only. Trap: Looking for a multicast setting on the vnet.

“New vnet created with an API version after March 31, 2026; VM can't reach the internet” → Subnets are private by default: add an explicit outbound method (NAT gateway is recommended). Trap: Waiting for Azure to assign a default outbound IP, or adding an outbound NSG rule.

“Turn an existing subnet private” → Set Default outbound access to Disabled, then stop and deallocate the VMs. Trap: Restarting the VMs. They must be stopped and deallocated.

“Best outbound method for most scenarios” → NAT gateway on the subnet. Trap: Relying on the default outbound IP, which Microsoft owns and can change without notice.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Virtual Networking overviewVNet Peering →