Adventures with Azure ARM Templates: Deployment Fails See inner errors for details

In my effort to get better with Azure ARM Templates I encountered the following error in one of my deployments:

Validation returned the following errors:

The template deployment 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' is not valid according to the validation procedure. The tracking id is 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'. See inner errors for details.

To get a more verbose version of the error you can execute the following cmdlet:

Get-AzLog `
   -CorrelationId XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX `
   -Verbose

Make sure to include -Verbose otherwise you won’t get the details you need to troubleshoot the error.

Navigate to the Properties section of the output and you’ll find find a much more helpful error message:

statusCode : BadRequest
serviceRequestId: 
statusMessage : {"error":{"code":"InvalidTemplateDeployment","message":"The template deployment 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' is not valid 
according to the validation procedure. The tracking id is 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'. 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":"XXX-st","message":"XXX-st 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."}]}]}}
eventCategory : Administrative

I had a dash in my storage account name, which is a big no-no.

Thanks to Thomas Thortnon and his post AzureRM Deployment Fails: See inner errors for details for pointing me in the right direction.

Hopefully this saves you some time troubleshooting!

Leave a Reply

Your email address will not be published.