Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debug flag to arm deployment command (#1188)
There are some ARM deployment errors that do not surface adequate messages for debugging in the default error output. For example issues related to template validation (that can be a result of account quotas, invalid names, etc.): ``` WARNING: Attempt 1 failed: Exception calling "Invoke" with "0" argument(s): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: 07:13:02 - Error: Code=InvalidTemplateDeployment; Message=The template deployment 'benbp-foobar' is not valid according to the validation procedure. The tracking id is '182f1217-fa54-4fa8-bff3-ef74605e2fe9'. See inner errors for details. ``` By updating the `$DebugPreference` for the `New-AzResourceGroupDeployment` command, we print the inner error messages without having to plug correlation IDs into the ARM internal kusto to get the actual error. ``` DEBUG: ============================ HTTP RESPONSE ============================ Status Code: BadRequest Headers: Cache-Control : no-cache Pragma : no-cache x-ms-failure-cause : gateway x-ms-ratelimit-remaining-subscription-writes: 1199 x-ms-request-id : 11a8a92c-21ba-43dc-b504-84b92524c71b x-ms-correlation-request-id : 11a8a92c-21ba-43dc-b504-84b92524c71b x-ms-routing-request-id : EASTUS:20201110T225406Z:11a8a92c-21ba-43dc-b504-84b92524c71b Strict-Transport-Security : max-age=31536000; includeSubDomains X-Content-Type-Options : nosniff Date : Tue, 10 Nov 2020 22:54:06 GMT Body: { "error": { "code": "InvalidTemplateDeployment", "message": "The template deployment 'benbp-foobar' is not valid according to the validation procedure. The tracking id is '11a8a92c-21ba-43dc-b504-84b92524c71b'. See inner errors for details.", "details": [ { "code": "PreflightValidationCheckFailed", "message": "Preflight validation failed. Please refer to the details for the specific errors.", "details": [ { "code": "AccountNameInvalid", "target": "benbp-basenameprim", "message": "benbp-basenameprim is not a valid storage account name. Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only." }, ``` An example full log with failures can be found here: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=614171&view=logs&j=011e1ec8-6569-5e69-4f06-baf193d1351e&t=5431112d-2b61-5a5f-7042-ef698f761043
- Loading branch information