I was trying to deploy multiple resources using ARM Template deployment and got interrupted with the following error.
New-AzResourceGroupDeployment : 11:59:25 PM – Error: Code=InvalidTemplateDeployment; Message=The template deployment ‘AzureFunctionsVPN’ is not valid according to the validation procedure. The tracking id is ’16b65e77-8c46-462f-8f4c-a909492f7229′. See inner errors for details.
It is very common to see such errors while working with ARM Template deployments. I found the following command-let extremely helpful without which it would have been a herculean task.
Get-AzLog -CorrelationId 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' -DetailedOutput
If you are still using old RM command-lets, use the following
Get-AzureRMLog -CorrelationId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -DetailedOutput
The above command generates a lengthy JSON Output, pay attention to Properties > Status Message > Message
Note: Please give at least a minute before you run the above command, it usually takes that much time for the log to show up, otherwise you might get an empty response sometimes.
You can also get the logs based on a date and time range. For more information please refer to the following link.
https://docs.microsoft.com/en-us/powershell/module/az.monitor/get-azlog?view=azps-3.8.0