The Azure CLI 2.0 is Azure’s new command-line experience for managing Azure resources. You can use it in your browser with Azure Cloud Shell, or you can install it on macOS, Linux, and Windows and run it from the command line.

  • –vnet. Name of the VNet to be created.
  • -e or –address-space. VNet address space.
  • -i or -cidr. Network mask in CIDR format.
  • -n or –subnet-name. Name of the first subnet.
  • -p or –subnet-start-ip. Starting IP address for subnet, or subnet address space.
  • -r or –subnet-cidr. Network mask in CIDR format for subnet.
  • -l or –location. Azure region where the VNet will be created.
# Create a resource group
            az group create   --name $myResourceGroup   --location $location
# Create a VNET with single subnet
            azure network vnet create --vnet TestVNet -e 192.168.0.0 -i 16 -n FrontEnd -p 192.168.1.0 -r 24 -l "Central US"
# Create an additional subnet
            azure network vnet subnet create -t TestVNet -n BackEnd -a 192.168.2.0/24
# List VNET
            azure network vnet show
# Cleanup the deployment
            az group delete --name myResourceGroup

Related Posts

About Ajeet Chouksey

With a robust background spanning more than 18 years, I am an adept Azure and Azure DevOps architect and engineer, dedicated to crafting Azure-centric solutions that prioritize customer requirements and agile methodologies. My expertise encompasses steering extensive cloud migration initiatives and advocating for Azure best practices, all aimed at streamlining costs and steering multinational teams towards success. Fueled by a passion for technological innovation, I am committed to perpetual learning, constantly advancing my proficiency in Azure, AI, MLOps, and Product Management to stay at the forefront of the industry..