Beginner · Foundations · 1 of 15

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
  1. List every virtual network in the resource group as a table.

    az network vnet list -g rg-lab -o table
    What's this?

    Shows virtual networks: their address space and subnets.

    • -g the resource group the resources live in
    • -g rg-lab the resource group to look in (short for --resource-group)
    • -o table print a table instead of JSON (short for --output)
  2. 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.addressPrefixes
    What's this?

    Shows virtual networks: their address space and subnets.

    • -g the resource group the resources live in
    • --name the name of the thing to look at or change
    • --name vnet-app which virtual network
    • --query a JMESPath expression that filters the output
  3. 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.

    • -g the resource group the resources live in
    • --name the name of the thing to look at or change
  4. 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
  • NICVM 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.
Resource grouprg-labvnet-app: tap to inspectVirtual networkvnet-app10.1.0.0/16subnet-web: tap to inspectsubnet-web10.1.1.0/24 · 251 usablevm-web 10.1.1.4: tap to inspectNICvm-web10.1.1.4subnet-db: tap to inspectsubnet-db10.1.2.0/24 · 251 usable
Goals 0/3
Cloud Shell · bashVMsrg-lab · eastus2
cloudshell:~$