ARM模板更多行

问题描述 投票:0回答:1

我有一个关于ARM模板的问题,当出现错误时,它总是会说第1行

##[error]Deployment template validation failed: 'The template resource at line '1' and column '3276'
is not valid: The template function 'reference' is not expected at this location. Please see
https://aka.ms/arm-template-expressions for usage details.. 

我的ARM模板显然有多于1行。这使得故障排除非常困难。如何保存文件,以便在发生错误时有更多行?

其他信息

部署方法:YAML(Azure DevOps)

  - task: AzureResourceManagerTemplateDeployment@3
    inputs:
      deploymentScope: 'Resource Group'
      azureResourceManagerConnection: ***
      subscriptionId: ***
      action: 'Create Or Update Resource Group'
      resourceGroupName: ***
      location: 'West Europe'
      templateLocation: 'Linked artifact'
      csmFile: 'pipelines/azuredeploy.json'
      csmParametersFile: 'pipelines/azuredeploy.parameters.json'
      deploymentMode: 'Incremental'
      deploymentName: 'AzureDeployment-$(fullversion)'
  • 使用的编码:UTF-8
  • 行尾:CRLF

非常感谢。

azure-resource-manager
1个回答
0
投票

根据错误,请不要在正确的位置使用Azure ARM模板函数reference。实际上,reference函数仅可用于资源定义的属性以及模板或部署的输出部分。有关更多详细信息,请参阅document

此外,您可以使用Powershell命令Test-AzResourceGroupDeployment -debug调试ARM模板。

© www.soinside.com 2019 - 2024. All rights reserved.