Azure VNET provisioning using CLI
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
- IaC - 101 - VNET
- Azure SQL provisionig using CLI
- Design VM Scale Sets - 1
- Design solutions using virtual machines - 2
- Design solutions using virtual machines - 1
About Ajeet Chouksey

Ajeet Chouksey
Subscribe via Email
Recent Posts
- Getting the Most from GitHub Copilot and AI Models - Boost Productivity While Managing Costs
- The Evolving Role of the Product Owner in the Age of AI
- Supercharging Code Reviews with AI for Strategic Impact
- Branch Protection as Code Enforce GitHub Security at Scale
- Governance Layer Best Practices in GitHub
- Deploy and Configure SonarQube
- Azure Bastion
- DevOps Attitude