liveBook · Manning

Subnetwork

As explained in Microsoft Azure in Action

A subnet is a subdivision of a virtual network with its own address range and network configuration.

A subnet is a logical division of an Azure virtual network (VNet). It receives part of the VNet’s local IP address range, and its range cannot overlap another subnet’s. Think of the VNet as a city’s roads and each subnet as the roads in one suburb: separate areas, still part of the same network. section 4.2

Divide a VNet when the separation has a purpose:

  • Group resources by project or department, or separate services with different security requirements. Network security groups can apply traffic rules to a subnet. section 4.2.2 section 4.6
  • Reserve a subnet for a service that requires delegation, such as an Azure SQL managed instance. section 4.2.2
  • Leave room to grow. Adding resources later is common, while reallocating VNet addresses is hard work. section 4.2.2

Create and delegate a subnet

In Az PowerShell, retrieve the VNet with Get-AzVirtualNetwork, add a subnet with Add-AzVirtualNetworkSubnetConfig and an address prefix such as 10.0.1.0/24, then save the VNet with Set-AzVirtualNetwork. To delegate that subnet to Azure SQL managed instances, retrieve its configuration, call Add-AzDelegation with Microsoft.Sql/managedInstances, and save the VNet again. section 4.2 section 4.2.2

Listing 4.1 Delegating a subnet inside a VNet
PS C:\> $vnet = Get-AzVirtualNetwork -Name "AlpacaVNet" 
-ResourceGroupName "AlpacaRG"    #1

PS C:\> $subnet = Get-AzVirtualNetworkSubnetConfig 
-Name "hairstyleSubnet" -VirtualNetwork $vnet    #2

PS C:\> Add-AzDelegation -Name "hairstyleDelegation" 
-ServiceName "Microsoft.Sql/managedInstances" -Subnet $subnet    #3

PS C:\> Set-AzVirtualNetwork -VirtualNetwork $vnet    #4

Follow the PowerShell listing to see how the VNet and subnet are retrieved, the delegation is added, and the VNet is saved. section 4.2.2

How Microsoft Azure in Action covers it

How deep it goes
Defines nonoverlapping address ranges, explains sizing trade-offs, and demonstrates PowerShell creation and delegation without detailing security-rule configuration.
Examples
Uses a city-and-suburb analogy, a 10.0.1.0/24 address prefix, and PowerShell commands delegating a subnet to Azure SQL.
What it assumes
Requires a VNet address range; introduces local IP addressing and subnet boundaries through a road-network analogy.
What you can do after
Operate/configure it with Az PowerShell by adding a subnet, saving its VNet, and optionally delegating it to Azure SQL.
How it connects
Connects VNets, private IP address ranges, CIDR notation, network security groups, and Azure SQL managed instances.

Also explained in

Compare how 5 books explain subnetwork →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microsoft Azure in Action. The section links point to the parts of the book it draws on.