Forum Discussion

kasunsjc's avatar
kasunsjc
Iron Contributor
Feb 20, 2017

ARM Templates (API Versions)

Hi All,

 

I have question regarding ARM templates API versions. I notice that when I create some resources I have to specify different API Versions for them. Is there any common API version we can apply ? because sometimes its so cumbersome to use different API versions for different resources.

 

Thanks

  • Hi Kasun!

    Excellent question!

     

    For ARM templates, you must specify an API version for every resource type you will deploy. This API version corresponds to a version of REST API operations that are released by the resource provider (Microsoft.Compute/virtualMachines is the resource provider and namespace for virtual machines, Microsoft.Storage/storageAccounts is the resource provider and namespace for storage and storage accounts - as examples)

    Whenever a resource provider enables new features, it releases a new version of the REST API.

    In order for you to leverage new features, you must then use the new API version.

     

    Now, for you to know which API version to use, you can run the following PowerShell cmdlet to retrieve this info, for a selected resource provider:

     

    ((Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | Where-Object ResourceTypeName -eq sites).ApiVersions

     

    Thanks!

     

  • Hi Kasun!

    Excellent question!

     

    For ARM templates, you must specify an API version for every resource type you will deploy. This API version corresponds to a version of REST API operations that are released by the resource provider (Microsoft.Compute/virtualMachines is the resource provider and namespace for virtual machines, Microsoft.Storage/storageAccounts is the resource provider and namespace for storage and storage accounts - as examples)

    Whenever a resource provider enables new features, it releases a new version of the REST API.

    In order for you to leverage new features, you must then use the new API version.

     

    Now, for you to know which API version to use, you can run the following PowerShell cmdlet to retrieve this info, for a selected resource provider:

     

    ((Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Web).ResourceTypes | Where-Object ResourceTypeName -eq sites).ApiVersions

     

    Thanks!

     

    • kasunsjc's avatar
      kasunsjc
      Iron Contributor

      Hi Kristian,

       

      Thanks for the solution suggested, but in my openion Azure team should improve this to use less APIs versions for different resource deployment.

       

      Thanks 

  • I am also interested in that topic. Failing deployments because of wrong api versions is not state of the art any more
  • Great question! We're looking into this and will try to get an answer for you. 

    • kasunsjc's avatar
      kasunsjc
      Iron Contributor

      Cool hope we can see result in near future.

      • Norma_Muro's avatar
        Norma_Muro
        Copper Contributor

        Hello,

        I know this question and answers were submitted a few years ago, but in case any of you are still working with ARM templates or Bicep files, I'm happy to share that we just released a SaaS AI-powered application that will take care of looking up resource latest API versions for you.  In fact, you don't even have to code the ARM or Bicep files, you can just ask our AI agent for the desired Azure solution in plain natural language and the app will generate the ARM template and Bicep file in less than a minute.  If you want to learn more about it, go to our blog to sign up and test it, for free: https://musi.qa/64whrL

        Cheers,

        Norma 

Resources