Explore a virtual network
Your tasks
- List the virtual networks in rg-lab
- Show vnet-app's settings
You've just joined the cloud team and inherited a virtual network called vnet-app. It lives in rg-lab, a resource group (a folder that holds related Azure resources). Before you change anything, get to know it: list the virtual networks, look at vnet-app's address space, and count its subnets (the smaller sections a VNet is split into).
You'll learn
What a virtual network is
List every virtual network in the resource group as a table.
az network vnet list -g rg-lab -o tableWhat's this?
Shows virtual networks: their address space and subnets.
-gthe resource group the resources live in
-g rg-labthe resource group to look in (short for --resource-group)-o tableprint a table instead of JSON (short for --output)
Show just the address space of vnet-app. --query picks one field out of the JSON.
az network vnet show -g rg-lab --name vnet-app --query addressSpace.addressPrefixesWhat's this?
Shows virtual networks: their address space and subnets.
-gthe resource group the resources live in--namethe name of the thing to look at or change
--name vnet-appwhich virtual network--querya JMESPath expression that filters the output
List the names of vnet-app's subnets.
az network vnet show -g rg-lab --name vnet-app --query "subnets[].name"What's this?
Shows virtual networks: their address space and subnets.
-gthe resource group the resources live in--namethe name of the thing to look at or change
Count the subnet names from step 3, then answer below.
Sources on Microsoft Learn (3)
0/0 changes
Network map
?
- Resource group, the outer dashed frame
- Virtual network, with its address space top right
- Subnet, with range and usable IPs (5 reserved)
- Network security group. A small shield on a VM's NIC means the NIC has one too
- Route table on the subnet
- VM Appliance Private endpoint
- Peering Connected Initiated or access off
- Goal working Goal broken, X marks where it stops
- Private DNS zone, dotted lines go to linked VNets
- Orange pulse: what your last command changed. Drag to pan, Ctrl and scroll to zoom.
Goals 0/3
Cloud Shell · bashVMsrg-lab · eastus2
cloudshell:~$