Creating a VNet using the Azure CLI is really simple, as it only requires you to provide its name and resource group:
$ az network vnet create -g "azureadministrator-euw-rg" -n "vnetforsubnets"
Once you are ready, we can start adding new subnets to it. Of course, it is possible to create a subnet during the creation of a VNet. All you need to do is use additional parameters:
$ az network vnet create -g "azureadministrator-euw-rg" -n "vnetforsubnetswithsubnet" --subnet-name "FirstSubnet" --subnet-prefix "10.0.0.0/29"
In the preceding command, we used the following parameters:
- -g: Resource group name
- -n: VNet name
- --subnet-name: Name of the subnet created
- --subnet-prefix: Available address space for a subnet
Remember that in Azure, all the subnets use CIDR to declare the available address space. In the preceding example, we declared that our subnet will contain eight available addresses using the ...