Bicep deploy - parse error messages
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 79
Description
Currently the error message from deploy command looks like below:
```
10:19:46 AM: Deployment failed for c:\Desktop\BicepDeployExamples\resourceGroupWithParameterFile.bicep. Deployment template validation failed: 'The value for the template parameter 'storageAccountName' at line '1' and column '304' is not provided. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.
Status: 400 (Bad Request)
ErrorCode: InvalidTemplate
Content:
{"error":{"code":"InvalidTemplate","message":"Deployment template validation failed: 'The value for the template parameter 'storageAccountName' at line '1' and column '304' is not provided. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":1,"linePosition":304,"path":"properties.template.parameters.storageAccountName"}}]}}
Headers:
Cache-Control: no-cache
Pragma: no-cache
x-ms-failure-cause: REDACTED
x-ms-ratelimit-remaining-subscription-writes: REDACTED
x-ms-request-id: a0ddc071-2f9b-4cf9-935f-e899ac381221
x-ms-correlation-request-id: REDACTED
x-ms-routing-request-id: REDACTED
Strict-Transport-Security: REDACTED
X-Content-Type-Options: REDACTED
Date: Thu, 31 Mar 2022 17:19:44 GMT
Content-Type: application/json; charset=utf-8
Expires: -1
Content-Length: 422
```
The above error message is a sample from azure sdk. Sometimes the error message can be deeply nested and hard to read. We need to parse it and display user friendly error message.
Contributor guide
Assessment
This issue has not been assessed yet.