How to create VNet with Subnet using Azure CLI

An Azure Virtual Network (VNet) is a representation of your own network in the cloud. It is a logical isolation of the Azure cloud dedicated to your subscription.Each VNet you create has its own CIDR block and can be linked to other VNets and on-premises networks.

Following Azure CLI command creates a VNet named test-vnet with CIDR block and a subnet named mySubnet with CIDR block


az network vnet create \
    --resource-group myResourceGroup \
    --name test-vnet \
    --address-prefixes \
    --subnet-name mySubnet \


Follow US on Twitter: