How to find Azure Windows 10 Image details: Publisher, Offer, SKU and Version for creating Virtual Machines using Azure CLI.
To deploy a Windows virtual machine using Azure CLI, we first need to find the Publisher, Offer, SKU and Version of the VM image.
Image Uniform Resource Name (URN)
Example URN: Windows 10 Enterprise 21H1 latest version
Publisher: MicrosoftWindowsDesktop, Offer: Windows-10, SKU: 21h1-ent, Version: latest
MicrosoftWindowsDesktop:Windows-10:21h1-ent:latest
Example URN: Windows 10 Pro 21H1 OS build 19043.1469
Publisher: MicrosoftWindowsDesktop, Offer: Windows-10, SKU: 21h1-pro, Version: 19043.1469.220116MicrosoftWindowsDesktop:Windows-10:21h1-pro:19043.1469.220116
For the lazy admins... you just want a list of Windows 10 images that you can use with Azure CLI, right?
# Example: Windows 10 Enterprise 21H1 # define variables for location, publisher, offer and sku Location=ukwest Publisher=MicrosoftWindowsDesktop Offer="Windows-10" Sku="21h1-ent" # list vm image versions for a sku az vm image list --all -l $Location -p $Publisher -f $Offer -s $Sku --output table # Windows 10 Enterprise 21H1 URNs MicrosoftWindowsDesktop:Windows-10:21h1-ent:latest MicrosoftWindowsDesktop:Windows-10:21h1-ent:latest MicrosoftWindowsDesktop:Windows-10:21h1-ent-g2:latest MicrosoftWindowsDesktop:Windows-10:21h1-ent-g2:latest MicrosoftWindowsDesktop:Windows-10:21h1-entn:latest MicrosoftWindowsDesktop:Windows-10:21h1-entn:latest MicrosoftWindowsDesktop:Windows-10:21h1-entn-g2:latest MicrosoftWindowsDesktop:Windows-10:21h1-entn-g2:latest # Example: Windows 10 Pro 21H1 # define variables for location, publisher, offer and sku Location=ukwest Publisher=MicrosoftWindowsDesktop Offer="Windows-10" Sku="21h1-pro" # list vm image versions for a sku az vm image list --all -l $Location -p $Publisher -f $Offer -s $Sku --output table # Windows 10 Pro 21H1 URNs MicrosoftWindowsDesktop:Windows-10:21h1-pro:latest MicrosoftWindowsDesktop:Windows-10:21h1-pro:latest MicrosoftWindowsDesktop:Windows-10:21h1-pro-g2:latest MicrosoftWindowsDesktop:Windows-10:21h1-pro-g2:latest MicrosoftWindowsDesktop:Windows-10:21h1-pro-zh-cn:latest MicrosoftWindowsDesktop:Windows-10:21h1-pro-zh-cn:latest MicrosoftWindowsDesktop:Windows-10:21h1-pro-zh-cn-g2:latest MicrosoftWindowsDesktop:Windows-10:21h1-pro-zh-cn-g2:latest MicrosoftWindowsDesktop:Windows-10:21h1-pron:latest MicrosoftWindowsDesktop:Windows-10:21h1-pron:latest MicrosoftWindowsDesktop:Windows-10:21h1-pron-g2:latest MicrosoftWindowsDesktop:Windows-10:21h1-pron-g2:latest
https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cli-ps-findimage
A Marketplace image in Azure has the following attributes:
The VM image Uniform Resource Name (URN) is a combination of publisher, offer, sku and version and is used to specify the Windows image when creating VMs using Azure CLI.
In this guide, we will go through the steps to find the Publisher, Offer, SKU and Version for Windows 10, which will give us the URN we need to use to create Windows VM using Azure CLI.
Example: Windows 10 Enterprise 21H1 URN
publisher:offer:sku:version
MicrosoftWindowsDesktop:Windows-10:21h1-ent:19043.1469.220116
# define variable for location Location=ukwest # list all available publishers for an Azure region az vm image list-publishers -l $Location --output table # list publishers starting with MicrosoftWindows az vm image list-publishers -l $Location --query "[?starts_with(name, 'MicrosoftWindows')]" --output table
# define variable for location and publisher Location=ukwest Publisher=MicrosoftWindowsDesktop # list vm image offers for publisher az vm image list-offers -l $Location -p $Publisher --output table
List VM Image SKUs for Windows 10
# define variables for location, publisher and offer Location=ukwest Publisher=MicrosoftWindowsDesktop Offer=Windows-10 # list vm image skus for an offer az vm image list-skus -l $Location -p $Publisher -f $Offer --output table
What do the different Windows 10 image SKU names mean?
# list vm image skus starting with 21h1 az vm image list-skus -l $Location -p $Publisher -f $Offer --query "[?starts_with(name, '21h1')]" --output table
# define variables for location, publisher, offer and sku Location=ukwest Publisher=MicrosoftWindowsDesktop Offer="Windows-10" Sku="21h1-ent" # list vm image versions for a sku az vm image list --all -l $Location -p $Publisher -f $Offer -s $Sku --output table
Windows 10 Image URN
Combine the values for Publisher, Offer, SKU, and version together to get the image URN.
Example URN: Windows 10 Enterprise 21H1 latest version
MicrosoftWindowsDesktop:Windows-10:21h1-ent:latest
Example URN: Windows 10 Pro 21H1 OS build 19043.1469
MicrosoftWindowsDesktop:Windows-10:21h1-pro:19043.1469.220116
Reference:
Azure CLI az vm image list
by Author
https://docs.microsoft.com/en-us/cli/azure/vm/image?view=azure-cli-latest#az-vm-image-list
Comments