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
In next for stated publisher, list their offers using below command.
Get-AzVMImageOffer -Location westus3 -PublisherName Canonical | Format-Wide Offer
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
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
Below are the list of images from Microsoft Windows servers.
Get-AzVMImageSku -Location westus3 -PublisherName MicrosoftWindowsServer -Offer WindowsServer
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