Terraform v0.11.7
provider.azurerm v1.7.0
# 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")}"
}
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.
Attempt to use the azurerm_template_deployment and specificity an parameters_body pointing to a resource
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!
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": "..." } }