<link href="https://fonts.googleapis.com/css?family=Roboto:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic&amp;display=swap" rel="stylesheet"/>
2 minutes reading time (499 words)

Create Windows 10 Virtual Machine using Azure CLI

How to create a Windows 10 Virtual Machine using Azure CLI

In this example we are creating a Windows 10 Enterprise 21H1 VM in a resource group with an existing VNet

Resource group: prod-ukw-core-rg
VNet: prod-ukw-core-vnet
Subnet: subnet01

az vm create options

Private IP address
Because we are not specifying a private IP using the --private-ip-address option, the VM will use dynamic IP addressing.

Public IP address
To create a VM without a public IP address, you can specify an empty variable for Public IP.
--public-ip-address ""

Network Security Group (NSG)
We are not creating a Network Security Group (NSG) for the VM because we already have an NSG attached to the VNet subnet. Again using an empty variable for nsg will create the VM without one.
--nsg ""

VNet and subnet
You can specify the Vnet name and subnet using the --vnet-name and --subnet options

Don't wait for commands to finish
If you add the --no-wait parameter Azure CLI will not wait for a command to finish running before accepting another command.
Using --no-wait allows you to execute multiple commands in a row. Azure CLI will continue running the command operations in the background, making it faster to deploy multiple virtual machines simultaneously.

Storage SKU options

  • Standard_LRS creates a standard hdd
  • StandardSSD_LRS creates a standard ssd
  • Premium_LRS creates a premium ssd 

Create a VM using Azure CLI

# define vm variables
vmName=prod-ukw-winx01
rgName=prod-ukw-core-rg
image=MicrosoftWindowsDesktop:Windows-10:21h1-ent:latest
adminuser=cfadmin 
adminpass="PASSWORD"
vnetName=prod-ukw-core-vnet
subnet=subnet01
storageSku=StandardSSD_LRS 
size=Standard_D1_v2

az vm create \
--name $vmName \
--resource-group $rgName  \
--image $image \
--admin-username $adminuser \
--admin-password $adminpass \
--vnet-name $vnetName \
--subnet $subnet \
--storage-sku $storageSku \
--size $size \
--public-ip-address "" \
--nsg "" \
--no-wait
 

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Friday, 03 October 2025
You can help support this website by buying me a coffee!
Buy Me A Coffee