Terraform-provider-azurerm: parameters_body generates an "The request content was invalid and could not be deserialized" error for any parameter file

Created on 25 Jun 2018  ยท  3Comments  ยท  Source: terraform-providers/terraform-provider-azurerm

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 Version

Terraform v0.11.7

Affected Resource(s)

provider.azurerm v1.7.0

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp
resource "azurerm_template_deployment" "acscluster" {
  name                = "${var.dns_prefix}"
  resource_group_name = "${var.rgName}"
  deployment_mode     = "Incremental"
  template_body       = "${file("./_output/${var.dns_prefix}/azuredeploy.json")}"
  parameters_body     = "${file("./_output/${var.dns_prefix}/azuredeploy.parameters.json")}"
}

Debug Output

Panic Output

Expected Behavior

Actual Behavior

When attempting to use the parameters_body parameter in the azurerm_template_deployment resource to read in a parameters file, an error is generated. This parameter file works fine when used manually in either the Azure CLI or PowerShell deployment but when using this provider it fails with this error:

azurerm_template_deployment.acscluster: Error creating deployment: resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidRequestContent" Message="The request content was invalid and could not be deserialized: 'Error converting value \"http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#\" to type 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Definitions.DeploymentParameterDefinition'. Path 'properties.parameters.$schema', line 1, position 152673.'."

I have tested with simple parameter files with a single parameter and get the same problem, so it does not seem to be related to the size.

Steps to Reproduce

Attempt to use the azurerm_template_deployment and specificity an parameters_body pointing to a resource

Important Factoids

References

  • #0000
bug servictemplate

Most helpful comment

Ok, found the issue, you have to remove the schema and version from the parameters file, this isn't a Terraform issue but rather one with the azure cli I guess (https://github.com/Azure/azure-quickstart-templates/issues/584).

So your parameters template should essentially look like:
{ "parameterName": { "value": "..." } }

All 3 comments

Ok, found the issue, you have to remove the schema and version from the parameters file, this isn't a Terraform issue but rather one with the azure cli I guess (https://github.com/Azure/azure-quickstart-templates/issues/584).

So your parameters template should essentially look like:
{ "parameterName": { "value": "..." } }

๐Ÿ‘‹

Since this should be fixed by updating the Parameters file (as mentioned in @joshlrogers's comment above) - and the documentation has recently been updated to clarify this I'm going to close this issue for the moment - however please let us know if that doesn't work for you and we'll take another look.

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

Related issues

test-in-prod picture test-in-prod  ยท  28Comments

mooperd picture mooperd  ยท  48Comments

hashibot picture hashibot  ยท  48Comments

hashibot picture hashibot  ยท  43Comments

srusru picture srusru  ยท  44Comments