Get list of Azure RM API versions

 ###### Resource API version play an important role in ARM template. Below script help to get list of available API versions for various providers. if you remove if statement, script will list the API versions for all the provider.
   $listProviderNameSpace=Get-AzureRmResourceProvider -ListAvailable
   foreach($provideNameSpace in $listProviderNameSpace.ProviderNamespace)
    {
       if(($provideNameSpace -eq "microsoft.compute") -or($provideNameSpace -eq "microsoft.storage") -or ($provideNameSpace -eq "microsoft.network"))
        {
            Write-Host $provideNameSpace
            $providerList = (Get-AzureRmResourceProvider -ProviderNamespace $provideNameSpace).ResourceTypes
            foreach($providerType in $providerList.ResourceTypeName)
            {     
                Write-Host $providerType
                ((Get-AzureRmResourceProvider -ProviderNamespace $provideNameSpace).ResourceTypes | Where-Object ResourceTypeName -eq $providerType).ApiVersions
            }
        }
   }

Please do let me know your thoughts/ suggestions/ question in disqus section.


Related Posts

About Ajeet Chouksey

With a robust background spanning more than 18 years, I am an adept Azure and Azure DevOps architect and engineer, dedicated to crafting Azure-centric solutions that prioritize customer requirements and agile methodologies. My expertise encompasses steering extensive cloud migration initiatives and advocating for Azure best practices, all aimed at streamlining costs and steering multinational teams towards success. Fueled by a passion for technological innovation, I am committed to perpetual learning, constantly advancing my proficiency in Azure, AI, MLOps, and Product Management to stay at the forefront of the industry..