Azure Resource Manager API Versions

When authoring Azure Resource Manager templates it's sometime not obvious what apiVersion a particular resource is up to. You can get this information a few different ways, today I'll demonstrate how to do it via Azure PowerShell.

Open up PowerShell and connect to Azure. Run the following:

Get-AzureRmResourceProvider | ft ProviderNamespace
ProviderNamespace
-----------------
Microsoft.Advisor
Microsoft.Cache
Microsoft.Compute
Microsoft.DevTestLab
microsoft.insights
Microsoft.KeyVault
Microsoft.Logic
Microsoft.ManagedIdentity
...

The list you get back is a list of all the Resource Providers in Azure. I like to think of the Resource Providers as a container or grouping of the resources you can deploy in Azure (I'm certain there is more to it but let's keep it simple).

If you want to see what the resources are in a given provider run something like this.

(Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Compute).ResourceTypes | ft ResourceTypeName
ResourceTypeName
----------------
availabilitySets
virtualMachines
virtualMachines/extensions
...

Finally if you want to see the supported ApiVersions for a given resource run the following.

(Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Compute).ResourceTypes | ? ResourceTypeName -eq 'virtualMachines' | Select-Object -ExpandProperty ApiVersions
2018-04-01
2017-12-01
2017-03-30
2016-08-30
2016-04-30-preview
2016-03-30
2015-06-15
2015-05-01-preview
Author image
About Jacob Hodges