Open
Description
Description
I have noticed that when I do deployment with New-AzDeployment I can get the following error:
Error: 10:11:51 - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'Template parameter JToken type is not valid. Expected 'Object'. Actual 'String'. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.
The error does not hint where the problem is. If we look at the activity log for the same error we actually see more detailed error message:
"statusMessage": "{\"error\":{\"code\":\"InvalidTemplate\",\"message\":\"Deployment template validation failed: 'Template parameter JToken type is not valid. Expected 'Object'. Actual 'String'. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.\",\"additionalInfo\":[{\"type\":\"TemplateViolation\",\"info\":{\"lineNumber\":5,\"linePosition\":30,\"path\":\"parameters.approvedLocations\"}}]}}",
Az deployments should include the full error so you can troubleshoot easier and do not have to go to activity log.
Steps to reproduce
New-AzDeployment
Environment data
Module versions
Az.Resources 3.2.1
Debug output
N/A
Error output
N/A