Terraform-provider-azurerm: The nested deployment has api-version '2017-05-10', which is not supported in api-version '2016-02-01'

Created on 13 Dec 2018  ·  8Comments  ·  Source: terraform-providers/terraform-provider-azurerm

Since this morning all our azurerm_template_deployment keeps failing with error:

"The nested deployment has api-version '2017-05-10', which is not supported in api-version '2016-02-01' used to deploy the template."

It is connected with the latest version of terraform as the same code works fine with the previous version 1.19

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

1.20

Affected Resource(s)

azurerm_template_deployment

Debug Output

resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidTemplate" Message="Deployment template validation failed: 'The template resource '' at line '1' and column '2657' is invalid. The nested deployment has api-version '2017-05-10', which is not supported in api-version '2016-02-01' used to deploy the template. Please use api-version '2017-05-10' or later to deploy the template. Or use an older api-version for the nested deployment in the template. Please see

azurerm_template_deployment.app_service_site: Error creating deployment: resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidTemplate" Message="Deployment template validation failed: 'The template resource '' at line '1' and column '1538' is invalid. The nested deployment has api-version '2018-05-01', which is not supported in api-version '2016-02-01' used to deploy the template. Please use api-version '2017-05-10' or later to deploy the template. Or use an older api-version for the nested deployment in the template. Please see https://aka.ms/arm-template/#resources for usage details.'."

Expected Behavior

Azure deployment resource should be created

Actual Behavior

Terraform is failing prior to creating azure deployment resource

Steps to Reproduce

It seems to be affecting all our terraform deployment resources Its hard to provide one specific example, still investigating.

bug servicresources

All 8 comments

hey @rhollins

Thanks for opening this issue :)

So that we could take a look into this would it be possible to provide a (simplified) Terraform Configuration, the ARM Template and the Azure Region in which you're experiencing this issue? Based on the error being returned I believe there's something in the ARM Template (such as the schema version, maybe?) which may not necessarily be compatible with in the older API version, but it's hard to tell without some more information unfortunately.

Taking a look at the changeset for this resource in v1.20, the one candidate I see is switching to use a Profile rather than an explicit API version - however our acceptance tests for this resource are passing, so I think we may need to add an additional test case here.

Thanks!

Hi Tom, thanks for the quick feedback!

Here is one of the modules that currently doesn't work, the errors I sent earlier was actually generated from this module.
https://github.com/hmcts/cnp-module-webapp

@rhollins thanks for confirming that

Taking a quick look into this it appears that Nested Templates (e.g. an ARM Template Deployment from within an ARM Template Deployment example) aren't supported prior to the 2017-05-10 API, which got downgraded in this change.

We'll take a look at updating to the newer API version as a part of the next release (1.21) - but you should be able to work around this for the moment either by pinning to an older version of the Provider, or by updating the code not to use Nested ARM Templates.

Thanks!

Thanks a lot Tom :) we pinned version already so will be waiting for next release.

closed by mistake

Hi
Regarding this issue, if I want to downgrade to the version: 2017-05-10 I cannot set the location/resource group for that nestedTemplate, but in the examples here, they add, incorrectly the resource group:

https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-cross-resource-group-deployment

Do you have any idea, when will the nested template deployment support version : 2018-05-01 where I can set the location (resource group) ?

Thank you!

@cristinadorotan unfortunately we're unable to support specific ARM Templates, but I'd suggest that either opening an issue on this repository or on Stack Overflow may be your best bet for ARM Template specific questions. Regarding fixing Terraform to use the new API, this has been done in #2514 which will be released in the next version of the AzureRM Provider (1.21)

Thanks!

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings