SOLVED

ARM Templates (API Versions)

%3CLINGO-SUB%20id%3D%22lingo-sub-47085%22%20slang%3D%22en-US%22%3EARM%20Templates%20(API%20Versions)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-47085%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20question%26nbsp%3Bregarding%20ARM%20templates%20API%20versions.%20I%20notice%20that%20when%20I%20create%20some%20resources%20I%20have%20to%20specify%20different%20API%20Versions%20for%20them.%20Is%20there%20any%20common%20API%20version%20we%20can%20apply%20%3F%20because%20sometimes%20its%20so%20cumbersome%20to%20use%20different%20API%20versions%20for%20different%20resources.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-47085%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-91537%22%20slang%3D%22en-US%22%3ERe%3A%20ARM%20Templates%20(API%20Versions)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-91537%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Kristian%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20solution%20suggested%2C%20but%20in%20my%20openion%20Azure%20team%20should%20improve%20this%20to%20use%20less%20APIs%20versions%20for%20different%20resource%20deployment.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-73532%22%20slang%3D%22en-US%22%3ERe%3A%20ARM%20Templates%20(API%20Versions)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-73532%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Kasun!%3C%2FP%3E%0A%3CP%3EExcellent%20question!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20ARM%20templates%2C%20you%20must%20specify%20an%20API%20version%20for%20every%20resource%26nbsp%3B%3CEM%3Etype%3C%2FEM%3E%20you%20will%20deploy.%20This%20API%20version%20corresponds%20to%20a%20version%20of%20REST%20API%20operations%20that%20are%20released%20by%20the%20resource%20provider%20(Microsoft.Compute%2FvirtualMachines%20is%20the%20resource%20provider%20and%20namespace%20for%20virtual%20machines%2C%20Microsoft.Storage%2FstorageAccounts%20is%20the%20resource%20provider%20and%20namespace%20for%20storage%20and%20storage%20accounts%20-%20as%20examples)%3C%2FP%3E%0A%3CP%3EWhenever%20a%20resource%20provider%20enables%20new%20features%2C%20it%20releases%20a%20new%20version%20of%20the%20REST%20API.%3C%2FP%3E%0A%3CP%3EIn%20order%20for%20you%20to%20leverage%20new%20features%2C%20you%20must%20then%20use%20the%20new%20API%20version.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%2C%20for%20you%20to%20know%20which%20API%20version%20to%20use%2C%20you%20can%20run%20the%20following%20PowerShell%20cmdlet%20to%20retrieve%20this%20info%2C%20for%20a%20selected%20resource%20provider%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E((Get-AzureRmResourceProvider%20-ProviderNamespace%20Microsoft.Web).ResourceTypes%20%7C%20Where-Object%20ResourceTypeName%20-eq%20sites).ApiVersions%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-59120%22%20slang%3D%22en-US%22%3ERe%3A%20ARM%20Templates%20(API%20Versions)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-59120%22%20slang%3D%22en-US%22%3E%3CP%3ECool%20hope%20we%20can%20see%20result%20in%20near%20future.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-58943%22%20slang%3D%22en-US%22%3ERe%3A%20ARM%20Templates%20(API%20Versions)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-58943%22%20slang%3D%22en-US%22%3EI%20am%20also%20interested%20in%20that%20topic.%20Failing%20deployments%20because%20of%20wrong%20api%20versions%20is%20not%20state%20of%20the%20art%20any%20more%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-57573%22%20slang%3D%22en-US%22%3ERe%3A%20ARM%20Templates%20(API%20Versions)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-57573%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%20question!%20We're%20looking%20into%20this%20and%20will%20try%20to%20get%20an%20answer%20for%20you.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

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

5 Replies
Highlighted

Great question! We're looking into this and will try to get an answer for you. 

Highlighted
I am also interested in that topic. Failing deployments because of wrong api versions is not state of the art any more
Highlighted

Cool hope we can see result in near future.

Highlighted
Best Response confirmed by Daniel Martins (Microsoft)
Solution

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!

 

Highlighted

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