Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Find and use Azure Marketplace VM images with Azure PowerShell

You can use this write up to find Azure Virtual Machine images available on the Azure Marketplace using PowerShell Module Az (Azure) commands. Before proceeding you need to know a few jargon vocabulary related to Azure cloud VM Images. You can use below properties to find VM templates on Azure cloud marketplace.

  • Publisher: The associated company that made the image. Specimens: Canonical, MicrosoftWindowsServer
  • Offer: The name of a group of associated images produced by a publisher. Instances: UbuntuServer, WindowsServer
  • SKU: An instance of an offer, such as a major release of a distribution. Examples: 20.04-LTS, 2022-Datacenter
  • Version: The version number of an image SKU. (or Latest)

In the first command to list all the available publishers in the marketplace use the below command. There are long list of many organizations and companies which created their own images on Azure Marketplace. List is long and publisher names won't fit on the console screen, so I am using Format-Wide to list PublisherNames, It is very helpful to find names on screen.

Get-AzVMImagePublisher -Location westus3 | fw PublisherName -Column 10

Microsoft Azure Get-azvmimagepublisher location format-wide publishername column powershell az module cloud provider create vm pwsh azure cmdlet.jpg

In next for stated publisher, list their offers using below command.

Get-AzVMImageOffer -Location westus3 -PublisherName Canonical | Format-Wide Offer

Microsoft Windows Get-AzVMImageOffer Powershell location publishername canonical format-wide offer ubuntuserer windows Microsoft focal grovy.jpg

In the last command for the specified PublisherName and Offer, it will list the all available SKUs.

Get-AzVMImageSku -Location westus3 -PublisherName Canonical -Offer UbuntuServer

Microsoft Windows Get-azvmimagesku location publishername canonical ubuntuserver offer lts powershell azure microsoft cloud stack automation.jpg

If you need version of the Image you can use below command with combination parameter of PublisherName, Offer and SKU. For the very recent use Latest naming.

Get-AzVMImage -Location westus3 -PublisherName Canonical -Offer UbuntuServer -Sku 18.04-LTS

Mcirosoft Azure Powershell Get-AZVMImage location publisher name offers sku windowsserver ubuntuserver microsoft canonical sku version azure powershell ps1 automation module az.jpg

Below are the list of images from Microsoft Windows servers.

Get-AzVMImageSku -Location westus3 -PublisherName MicrosoftWindowsServer -Offer WindowsServer

mICROSOFT Azure windows server datacenter 2019 operating system 2022 MicrosoftWindowsserver Powershell az module Get-AzVMImageSku publishername offer cloud os images template.jpg

Useful Articles
Create a Azure Virtual Network with Subnet using PowerShell
Azure add create a Subnet to existing Virtual Network using PowerShell
Remove Azure Virtual Network Subnet using PowerShell
Create key vault and secrets with access policies in Microsoft Azure
Working With Azure Key Vault Using Azure PowerShell and AzureCLI
Use Key Vault secret identifier url to get the secret value using Powershell
Use a Azure VM system assigned managed identity to access Azure Key Vault
Create Azure Key Vault Certificates on Azure Portal and Powershell
Export certificates from Azure Key Vault using PowerShell

Go Back

Comment

Blog Search

Page Views

12056191

Follow me on Blogarama