How can I troubleshoot Azure ARM template validation errors?

前端 未结 8 1729
终归单人心
终归单人心 2021-02-06 22:27

I have made some small changes to an Azure ARM template file and now when I try to deploy or validate via the xplat cli I get this message.

error: Inval

相关标签:
8条回答
  • 2021-02-06 22:44

    Building on @nftw:

    $deploymentGroupName = 'deploymentGroupName'
    $correlationId = ((Get-AzureRMLog -ResourceGroup $deploymentGroupName)[0]).CorrelationId
    $logentry = (Get-AzureRMLog -CorrelationId $correlationId -DetailedOutput)
    #$logentry
    $rawStatusMessage = $logentry.Properties
    $status = $rawStatusMessage.Content.statusMessage | ConvertFrom-Json
    $status.error.details
    $status.error.details.details
    
    0 讨论(0)
  • 2021-02-06 22:46

    Run the following PowerShell Azure cmdlet with the tracking ID supplied:

    Get-AzureRMLog -CorrelationId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -DetailedOutput

    0 讨论(0)
  • 2021-02-06 22:49

    I was running in the same issue. Basically, I couldn't get any details passed "InvalidTemplateDeployment".

    I added my ARM template in a Visual Studio: Azure Resource Group project template and tried to deploy it. I got verbose details in the Output tab. That helped me solve my problem.

    In my case it was the name of the cluster, it can only be small letters and numbers.

    0 讨论(0)
  • Log into the azure portal portal.azure.com.

    Open the Activity log

    Find the record with Operation Name of Validate in the list of activities. It should have a red exclamation mark because it failed.

    Click on it that record. Then click on the JSON tab at the bottom. Get reading and somewhere deep down in returned Json you might find an error in the statusMessage such as "The storage account named helloworld is already taken."

    0 讨论(0)
  • 2021-02-06 23:00

    I believe that tracking ID is for technical support for looking at their logs, not for the user. Regarding your exact question, you need to take a look at logs - reference.

    Another good way to validate the template is to use Resource Explorer.

    0 讨论(0)
  • 2021-02-06 23:05

    Make sure you're running the latest version of the CLI, we're working on bubbling up the detailed error. If that's still not catching it, let us know https://github.com/Azure/azure-xplat-cli/issues

    Then if the log isn't showing you the detail, run the deployment with the -vv switch, the detailed debug output (while verbose) will have all the error messages and you can usually sift through and find the specific failure.

    azure group deployment create ... --debug
    

    Powershell:

    New-AzResourceGroupDeployment ... -debug
    
    0 讨论(0)
提交回复
热议问题