【问题标题】:Azure Pipeline Debug LoggingAzure 管道调试日志记录
【发布时间】:2020-08-11 13:55:15
【问题描述】:

使用 YAML 模板,我的理解是当我使用 system.debug 运行代码时,下面的代码应该记录参数:true。谁能告诉我我做错了什么?

parameters:
- name: branchName
  displayName: 'Repository branch name'
  type: string
- name: WebAppName
  displayName: 'Application name'
  type: string
- name: ServiceConnection
  displayName: 'ServiceConnection name'
  type: string
- name: Workspace
  displayName: 'Workspace name'
  type: string
  
  ##[group]Beginning of a DeployTemplate Parameters
  ##[debug]Debug branchName: ${{parameters.branchName}}
  ##[debug]Debug WebAppName: ${{parameters.WebAppName}}
  ##[debug]Debug ServiceConnection: ${{parameters.ServiceConnection}}
  ##[debug]Debug Workspace: ${{parameters.Workspace}}
  ##[debug]Build.SourceBranchName: variables['Build.SourceBranchName']
  ##[endgroup]

【问题讨论】:

标签: azure-pipelines


【解决方案1】:

我测试了以下脚本,在我这边,参数值在日志中正常显示。你是在模板文件中为参数设置了默认值还是在管道yaml中将值传递给了参数?

参数模板yaml:

管道yaml:

日志:

【讨论】:

  • 谢谢你,休!看到你的代码后,我意识到我的错误。我没有使用电源外壳任务。我的印象是代理只是拿起了命令,所以就像编译器命令一样。阅读您的回复后,docs.microsoft.com/en-us/azure/devops/pipelines/scripts/… 的文档更有意义。谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-03-26
  • 1970-01-01
  • 1970-01-01
  • 2019-07-28
  • 2015-11-04
  • 1970-01-01
相关资源
最近更新 更多