Virtual networks, subnets and peering — sizing, reserved addresses, special subnets, delegation, private subnets and peering rules

The rules a VNet design must satisfy — address spaces and the five reserved addresses per subnet, subnet size limits, the subnets services require (gateway, firewall, Bastion, App Service, Container Apps), delegation and what blocks a subnet change, private subnets for API versions after March 31, 2026, service versus private endpoints, and peering rules.

markdownreferencev1W40P-G895stage: designtrust: officialservice: networkinginterface: iacinterface: clivirtual network address spacesubnet reserved addresses fivesmallest subnet /29largest subnet /2IPv6 subnet /64GatewaySubnet /27AzureFirewallSubnet /26AzureBastionSubnet /26subnet delegationMicrosoft.Web/serverFarms delegationMicrosoft.App/environments delegationserviceAssociationLinksdefaultOutboundAccess falseprivate subnetdefault outbound access retirementservice endpoint vs private endpointVNet peering Initiated Connected Disconnectedpeering not transitiveallowForwardedTrafficuseRemoteGatewaysoverlapping address spacespeered VNet name resolutionMicrosoft.Network/virtualNetworks@2026-01-01

Created 21 Oct 2026 · Modified 23 Oct 2026 · 1 version

Virtual networks, subnets and peering

Addresses

  • Five addresses per subnet are reserved: the network address, the default gateway (.1), two for Azure DNS mapping (.2, .3) and the broadcast address. A /29 gives 3 usable addresses.
  • Subnet sizes: IPv4 from /29 to /2; IPv6 subnets are exactly /64. Subnets in one VNet can't overlap, and peered VNets can't overlap either: plan address space across every VNet that may ever peer, and on-premises ranges.
  • Subnet size is hard to change once services are in it (App Service and Container Apps say it can't change). Size for scale-out plus platform upgrades.

Subnets with required names or sizes

SubnetRequirement
GatewaySubnet (VPN, ExpressRoute)That exact name; /27 suits most configurations, coexistence needs more (reference/networking/vpn-and-expressroute.md)
AzureFirewallSubnetThat name, /26 or larger; forced tunnelling also needs AzureFirewallManagementSubnet (reference/networking/firewall-and-ddos.md)
AzureBastionSubnetThat name, /26 or larger (since November 2, 2021), with required NSG rules (reference/networking/bastion.md)
App Service / Functions VNet integrationUnused, /28 or larger (/26 when several plans share it), delegated to Microsoft.Web/serverFarms (reference/app-service/configuration-and-networking.md)
Container Apps, workload profiles/27 or larger, delegated to Microsoft.App/environments (reference/container-apps/apps-ingress-and-scale.md)
App Service Environment v3Empty, delegated to Microsoft.Web/hostingEnvironments, /24 recommended (reference/app-service/app-service-environment.md)
Private endpointsAny subnet that isn't delegated

Delegation hands a subnet to one service, which then creates resources there and adds a service association link. Those links, NICs, private endpoints and network profiles are what stop a subnet from being deleted or re-delegated. List them in one call:

az network vnet subnet show -g <rg> --vnet-name <vnet> -n <subnet> \
  --query "{prefix:addressPrefix, delegations:delegations[].serviceName, ipConfigs:ipConfigurations[].id, privateEndpoints:privateEndpoints[].id, links:serviceAssociationLinks[].linkedResourceType}"

Private subnets (default outbound access)

  • For network API versions released after March 31, 2026, subnets in new virtual networks have defaultOutboundAccess: false (the portal already does this). VMs in them get no implicit internet egress: no package downloads, Windows activation or Windows Update until you add a NAT gateway, a firewall route, a public IP or Standard load balancer outbound rules.
  • Existing virtual networks don't change, and templates on older API versions keep the old default. The spec doesn't state a default, so set defaultOutboundAccess explicitly on every subnet.
  • Implicit default outbound IPs belong to Microsoft, can change, and don't support fragmented packets or ICMP. Making an existing subnet private takes effect for a VM after it's deallocated. Egress options: reference/networking/outbound-connectivity.md.

Service endpoints or private endpoints

Service endpointPrivate endpoint
What it isA subnet setting (Microsoft.Storage, Microsoft.KeyVault, …)A NIC with a private IP in your subnet for one resource and sub-resource
Address the client usesThe service's public endpoint; the service sees your subnetThe private IP, through private DNS
Firewall rule on the serviceVNet rule naming the subnetNone needed; public access can be disabled
Clients in other VNets or on-premisesEnable it on each client subnet; on-premises can't use it (allow its public NAT IPs instead)Yes, with DNS
Cost and setupNo extra charge; no DNSCharged per endpoint; a private DNS zone per service

Private endpoints and DNS: reference/networking/private-endpoints-and-dns.md.

Peering

  • Create the peering on both VNets. The first side shows Initiated; the link works only when both show Connected. Disconnected means one link was deleted, or an address space changed without a sync: re-create the missing link, or run az network vnet peering sync.
  • Peering isn't transitive. VNet1–VNet2 and VNet2–VNet3 give no VNet1–VNet3 path; peer them directly or route through a hub NVA or firewall (UDRs plus allowForwardedTraffic). Using the hub's VPN or ExpressRoute gateway needs allowGatewayTransit on the hub and useRemoteGateways on the spoke.
  • Default Azure name resolution doesn't cross peerings. Use Azure Private DNS zones linked to each VNet, or a DNS server or Private Resolver.
  • Address space changes on a peered VNet need the peering re-synced (az network vnet peering sync).

Errors: reference/networking/errors.md. Many VNets with managed hubs or policy-driven peering: reference/networking/virtual-wan-and-network-manager.md.

Read this document as markdown — the same bytes an agent receives.