Q. How can I view available images in Azure using ARM?
A. If you are using Azure Resource Manager (ARM) with IaaS v2, you can no longer run Get-AzureVMImage with no parameters.
Instead, you need to provide detail using a series of commands you can view all the available publishers, offers and SKUs which gives the information to pass to the Set-AzureVMSourceImage. Microsoft has a good article with more detail on this process.
#Find all the available publishers
Get-AzureVMImagePublisher -Location $loc | Select PublisherName
#Pick a publisher
$pubName="MicrosoftWindowsServer"
Get-AzureVMImageOffer -Location $loc -Publisher $pubName | Select Offer
#Pick a specific offer
$offerName="WindowsServer"
#View the different SKUs
Get-AzureVMImageSku -Location $loc -Publisher $pubName -Offer $offerName | Select Skus
#View the versions of a SKU
Get-AzureVMImage -Location $loc -PublisherName 'MicrosoftWindowsServer' -Offer 'WindowsServer' -Skus '2012-R2-Datacenter'
#View detail of a specific version of the SKU
Get-AzureVMImageDetail -Location 'East US' -PublisherName 'MicrosoftWindowsServer' -Offer 'WindowsServer' -Skus '2012-R2-Datacenter' -Version '4.0.201504'
0 comments
Hide comments