Searching VM Images in Azure (2025)

The Azure Portal provides search capability allowing quick review and selection of a desired VM image. But when deploying via the Azure CLI or template you must know some parameters to specify the image to be deployed. This post provides a few examples showing how to search the image listing via the Azure CLI.

Examples below were created using the Azure Cloud Shell but can be run on any Linux system with the Azure CLI installed. Full documentation referenced for this post can be found in the Azure Docs.

Images in Azure are specified by a Publisher, Offer, SKU, and a Version. These can be specified as individual CLI arguments, or joined by a colon (‘:’) to form a URN. Finding the right image starts with knowing the Publisher, which is typically the company name though you may still need to list providers to find the correct representation. For example, if we’re interested in Ubuntu images we probably want to look for ‘Canonical’:

ed@Azure:~$ az vm image list-publishers -l eastus2 | grep -i canonical "id": "/Subscriptions/{removed}/Providers/Microsoft.Compute/Locations/eastus2/Publishers/Canonical", "name": "Canonical",ed@Azure:~$

The default output of Azure CLI is JSON. Other output formats are available (use the -h argument to see available types). The table type is fairly human-readable in this case. Also, I have piped the output to the Linux command grep but the Azure CLI offers a more powerful and flexible way to filter the output: JMESPath. I may blog more on this later as it can filter and transform the output, but for now we’ll stick to some simple filters:

ed@Azure:~$ az vm image list-publishers -l eastus2 --query "[?contains(name, 'anonical')]"[ { "id": "/Subscriptions/{removed}/Providers/Microsoft.Compute/Locations/eastus2/Publishers/Canonical", "location": "eastus2", "name": "Canonical", "tags": null }]ed@Azure:~$

Maybe Canonical was too straight-forward. Let’s look for images published by F5 Networks, since we may not know how they are represented when the name includes a space.

ed@Azure:~$ az vm image list-publishers -l eastus2 --query "[?contains(name, 'f5')]"[ { "id": "/Subscriptions/{removed}/Providers/Microsoft.Compute/Locations/eastus2/Publishers/f5-networks", "location": "eastus2", "name": "f5-networks", "tags": null }]ed@Azure:~$

Now that we have the right Publisher, let’s look at their Offers. Use table output for readability.

ed@Azure:~$ az vm image list-offers -l eastus2 -p canonical -o tableLocation Name---------- -----------------------eastus2 Ubuntu15.04Snappyeastus2 Ubuntu15.04SnappyDockereastus2 UbunturollingSnappyeastus2 UbuntuServereastus2 Ubuntu_Coreed@Azure:~$

Each Offer may have a number of SKUs available. Let’s look at the SKUs for UbuntuServer.

ed@Azure:~$ az vm image list-skus -l eastus2 -p canonical -f ubuntuserver -o tableLocation Name---------- -----------------{some output removed}eastus2 17.10-DAILYeastus2 18.04-DAILY-LTSeastus2 18.04-LTSeastus2 18.10eastus2 18.10-DAILYeastus2 19.04-DAILYed@Azure:~$

Finally you can list versions by using the ​--all argument:

ed@Azure:~$ az vm image list --all -p canonical -f ubuntuserver -s 18.04-lts -o tableOffer Publisher Sku Urn Version------------ ----------- --------- ------------------------------------------------ ---------------{some output removed}UbuntuServer Canonical 18.04-LTS Canonical:UbuntuServer:18.04-LTS:18.04.201810030 18.04.201810030UbuntuServer Canonical 18.04-LTS Canonical:UbuntuServer:18.04-LTS:18.04.201810240 18.04.201810240UbuntuServer Canonical 18.04-LTS Canonical:UbuntuServer:18.04-LTS:18.04.201810290 18.04.201810290UbuntuServer Canonical 18.04-LTS Canonical:UbuntuServer:18.04-LTS:18.04.201811010 18.04.201811010ed@Azure:~$

When deploying an image you can use the keyword latest to deploy the latest version. I’m not certain of the difference between image versions – perhaps later versions incorporate package updates limiting the amount of updating required post-deployment. Notice the column for URN in the version list. It’s a fully-specified image by combining Publisher, Offer, SKU, and Version into one string. View the latest version of the Ubuntu Server 18.04-LTS image as an example.

ed@Azure:~$ az vm image show -l eastus2 --urn canonical:ubuntuserver:18.04-lts:latest{"automaticOsUpgradeProperties": {"automaticOsUpgradeSupported": false},"dataDiskImages": [],"id": "/Subscriptions/{removed}/Providers/Microsoft.Compute/Locations/eastus2/Publishers/canonical/ArtifactTypes/age/ Offers/ubuntuserver/Skus/18.04-lts/Versions/18.04.201811010","location": "eastus2","name": "18.04.2018110","osDiskImage": {"operatingSystem": "Linux"},"pn": null,"tags": null}ed@Azure:~$

By using the image listing functions in the Azure CLI you can find the right parameters to fully specify an image for your CLI or template deployment.

Searching VM Images in Azure (2025)

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Aron Pacocha

Last Updated:

Views: 6394

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.