Task 01: Virtual Network & Subnets
DOCUMENT CATEGORY: Runbook
SCOPE: Virtual network deployment
PURPOSE: Create management VNet and subnets
MASTER REFERENCE: Microsoft Learn - Virtual Networks
Status: Active
Overview
This task creates the management Virtual Network (VNet) and all required subnets for Azure Local infrastructure. This VNet hosts management VMs (Domain Controllers, Utility Server, NDM Server, Lighthouse Server) and provides connectivity to on-premises via VPN.
Execution Target: Azure-Only (control-plane API operation) Tab Profile: 3 tabs — Azure Portal · PowerShell · Azure CLI
Module: azurelocal-toolkit
File: network.tf
Mode: Management
Components Created
| Resource | Name Pattern | Purpose |
|---|---|---|
| Virtual Network | vnet-azrl-{env}-{region}-01 | Management address space |
| GatewaySubnet | GatewaySubnet | VPN Gateway (required name) |
| Management Subnet | snet-azrl-{env}-{region}-01 | Management VMs |
| Bastion Subnet | AzureBastionSubnet | Azure Bastion (required name, /26 min) |
| Endpoints Subnet | snet-endpoints-{env}-{region}-01 | Private Endpoints |
Default Subnet Layout
| Subnet | Default CIDR | Notes |
|---|---|---|
GatewaySubnet | 10.x.x.0/27 | Required name, no NSG |
snet-azrl-* | 10.x.x.32/27 | DCs, Utility, NDM, Lighthouse |
AzureBastionSubnet | 10.x.x.64/26 | Required name, /26 minimum |
snet-endpoints-* | 10.x.x.128/27 | Key Vault, Storage endpoints |
Prerequisites
- Phase 01: Landing Zones completed — subscription and resource groups exist
- Phase 03: RBAC Permissions completed — deployment identity has Network Contributor role
- Network IP address ranges documented and confirmed (no conflicts with on-prem)
- Landing zone model confirmed (Single Subscription or CAF/WAF)
Values from infrastructure.yml
The script reads these keys from infrastructure.yml (schema 5). Each key, with its type, default and example, is in the variables reference.
azure.tenant_id, azure.location, tags
landing_zone.subscriptions[].name, .id the subscription of each network
landing_zone.networks[].name, .subscription, .resource_group, .location, .address_space, .dns_servers, .peer_with
landing_zone.networks[].subnets[].name, .prefix, .network_security_group, .route_table
landing_zone.networks[].allow_forwarded_traffic, .allow_gateway_transit, .use_remote_gateways the peering options (schema 5.6.23)
Peering options
Deploy-VirtualNetworks.ps1 peers each network with the networks of its peer_with. A peering is made in both directions, and each direction uses the options of the network it starts in (Microsoft Learn: Virtual network peering).
| Key | Default | What it is |
|---|---|---|
landing_zone.networks[].allow_forwarded_traffic | true | Whether the peerings that start in this network accept traffic that was sent by a machine outside the peered network. |
landing_zone.networks[].allow_gateway_transit | false | Whether the peerings that start in this network let the peer use the VPN or ExpressRoute gateway of this network. Set it on the hub that has the gateway. Cannot be true together with use_remote_gateways on the same network. |
landing_zone.networks[].use_remote_gateways | false | Whether the peerings that start in this network use the gateway of the peer. Set it on the spokes. The peer must set allow_gateway_transit to true and have a gateway. |
landing_zone:
networks:
- name: vnet-iic-hub-01
allow_gateway_transit: true # the hub has the VPN gateway
- name: vnet-iic-mgmt-01
peer_with: ["vnet-iic-hub-01"]
use_remote_gateways: true # the spoke uses the hub's gateway
Single Subscription Model
In the single subscription model, all management infrastructure is deployed to a single subscription under one resource group.
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Customer subscription | landing_zone.subscriptions[].id |
| Resource Group | rg-azrlmgmt-{env}-{region}-01 | landing_zone.networks[].resource_group |
| VNet Name | vnet-azrl-{env}-{region}-01 | landing_zone.networks[].name |
| Location | Azure region | landing_zone.networks[].location |
| Address Space | 10.x.x.0/24 | landing_zone.networks[].address_space |
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
When to use: Learning Azure Local, single deployment, prefer visual interface
Procedure
- Navigate to Virtual Networks:
- In Azure Portal, search for Virtual networks
- Click + Create
-
Basics tab: | Field | Value | Source | |-------|-------|--------| | Subscription | Your subscription |
landing_zone.subscriptions[].id| | Resource group |rg-azrlmgmt-{env}-{region}-01|landing_zone.networks[].resource_group| | Virtual network name |vnet-azrl-{env}-{region}-01|landing_zone.networks[].name| | Region | Your region |landing_zone.networks[].location| -
IP Addresses tab:
- Set IPv4 address space to value from
landing_zone.networks[].address_space - Add subnets:
| Subnet Name | Address Range | Source |
|---|---|---|
GatewaySubnet | /27 range | landing_zone.networks[].subnets[].prefix |
| Management subnet | /27 range | landing_zone.networks[].subnets[].prefix |
AzureBastionSubnet | /26 range | landing_zone.networks[].subnets[].prefix |
| Endpoints subnet | /27 range | landing_zone.networks[].subnets[].prefix |
-
Security tab: Leave defaults (no Bastion/Firewall/DDoS at this stage)
-
Tags tab: Apply standard tags per
tags.*config paths -
Review + create: Verify settings → Click Create
Validation
- VNet created successfully in the correct resource group
- All four subnets visible under the VNet
- Address space matches
landing_zone.networks[].address_space - GatewaySubnet has no NSG attached
Links
PowerShell
When to use: Run the task from a management workstation or a pipeline. The script reads
infrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-01-virtual-network/powershell/Deploy-VirtualNetworks.ps1 | Creates the virtual networks of the landing zone, their subnets and their peerings, from infrastructure.yml. Supports -WhatIf. |
Requires: PowerShell 7.
Run
./Deploy-VirtualNetworks.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
Azure CLI
When to use: Run the task from a host that has the Azure CLI and not the Az PowerShell modules. The script is PowerShell 7 that calls
az; it readsinfrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-01-virtual-network/azurecli/Deploy-VirtualNetworks.azcli.ps1 | Creates the virtual networks of the landing zone, their subnets and their peerings, from infrastructure.yml, with the Azure CLI. Supports -WhatIf. |
Requires: PowerShell 7 and the Azure CLI, signed in with az login --tenant <azure.tenant_id>.
Additive: a network that exists is not recreated, a subnet the file lists and the network lacks is added, and a network security group or route table the file names is attached once it exists. Any other difference is reported and left as it is. Attaching a security group or route table changes only that reference, so the subnet keeps its service endpoints, delegations and address prefixes. A peering is found by its name or by the remote network: a peering to the same remote network under another name is left alone, and its result row says exists as '<name>'. A peering name longer than 80 characters is cut to 71 and ends with - and the first 8 hex digits of the full name's SHA-256, so it stays valid and unique. An entry of landing_zone.networks, landing_zone.networks[].subnets or landing_zone.subscriptions that is not a map stops the script with exit 2. These rules apply to both the PowerShell and the Azure CLI script. Run Task 06 first so the subnets get their security groups. You need Network Contributor (or Contributor) on each resource group, and on the other network for a peering across subscriptions.
Run
./Deploy-VirtualNetworks.azcli.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
./Deploy-VirtualNetworks.azcli.ps1 -InfrastructureFile ./infrastructure.yml
Validation
- VNet created in the correct resource group
- All four subnets present with correct CIDRs
- GatewaySubnet has no NSG attached
- Address space does not conflict with on-premises networks
CAF/WAF Landing Zone Model
In the CAF/WAF model, networking resources are deployed to the Connectivity subscription under the Connectivity management group, separate from management and identity resources.
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Connectivity subscription | landing_zone.subscriptions[].id |
| Resource Group | rg-azrlconn-{env}-{region}-01 | landing_zone.networks[].resource_group |
| VNet Name | vnet-azrl-{env}-{region}-01 | landing_zone.networks[].name |
| Location | Azure region | landing_zone.networks[].location |
| Address Space | 10.x.x.0/24 | landing_zone.networks[].address_space |
In CAF/WAF, this VNet is created in the Connectivity subscription — not the same subscription as management VMs. VNet peering or cross-subscription subnet references may be required for VM NICs.
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
When to use: Learning Azure Local, single deployment, prefer visual interface
Procedure
- Navigate to Virtual Networks:
- In Azure Portal, search for Virtual networks
- Click + Create
-
Basics tab: | Field | Value | Source | |-------|-------|--------| | Subscription | Connectivity subscription |
landing_zone.subscriptions[].id| | Resource group |rg-azrlconn-{env}-{region}-01|landing_zone.networks[].resource_group| | Virtual network name |vnet-azrl-{env}-{region}-01|landing_zone.networks[].name| | Region | Your region |landing_zone.networks[].location| -
IP Addresses tab:
- Set IPv4 address space to value from
landing_zone.networks[].address_space - Add subnets identical to Single Subscription model (same names, same CIDRs)
-
Security tab: Leave defaults
-
Tags tab: Apply standard tags per
tags.*config paths -
Review + create: Verify settings → Click Create
Validation
- VNet created in the Connectivity subscription and resource group
- All four subnets visible under the VNet
- Address space matches config
- GatewaySubnet has no NSG attached
Links
PowerShell
The same script runs for this landing zone model. Only the values in infrastructure.yml differ. See the first PowerShell tab above.
Azure CLI
The same Azure CLI script runs for this landing zone model. Only the values in infrastructure.yml differ. See the first Azure CLI tab above.
Validation
- VNet created in the Connectivity subscription resource group
- All four subnets present with correct CIDRs
- Address space does not conflict with on-premises or other VNets
- GatewaySubnet has no NSG attached
Troubleshooting
| Issue | Root Cause | Remediation |
|---|---|---|
| Address space overlaps | Conflict with existing VNet or on-prem range | Choose non-overlapping CIDR from Planning & Discovery |
| Subnet creation fails | Address prefix outside VNet address space | Verify subnet CIDRs fit within VNet CIDR |
| GatewaySubnet too small | Less than /27 | Use /27 minimum for VPN Gateway |
| AzureBastionSubnet too small | Less than /26 | Use /26 minimum for Azure Bastion |
| Permission denied | Missing Network Contributor role | Verify RBAC from Phase 03 |
Alternatives
The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.
Navigation
| Previous | Up | Next |
|---|---|---|
| Manual Deployment Index | Manual Deployment Index | Task 02: VPN Gateway |
Version Control
- Created: 2025-09-15 by Hybrid Cloud Solutions
- Last Updated: 2026-03-03 by Hybrid Cloud Solutions
- Version: 4.0.0
- Tags: azure-local, virtual-network, subnets, networking, management-infrastructure
- Keywords: virtual network, VNet, subnets, GatewaySubnet, AzureBastionSubnet, IP addressing
- Author: Hybrid Cloud Solutions
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2025-03-25 | Azure Local Cloud | Initial release |