You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

部署Azure DevOps YAML流水线时添加DisplayName不生效的问题

解决Azure DevOps YAML流水线displayName不显示的问题

问题出在displayName的位置错误——它是任务的顶级属性,不能嵌套在inputs块内。你的YAML把它放在了inputs里,流水线会忽略这个配置,直接显示任务默认名称AzurePowerShell。

修正后的YAML代码

- task: AzurePowerShell@5
  displayName: PreDeployment
  inputs:
    azureSubscription: 'NewConnectionName'
    ScriptType: 'FilePath'
    ScriptPath: '$(System.DefaultWorkingDirectory)/caplogic-warehouse-dev-df/PrePostDeploymentScript.ps1'
    ScriptArguments: '-armTemplate "$(System.DefaultWorkingDirectory)/caplogic-warehouse-dev-df/ARMTemplateForFactory.json" -ResourceGroupName $(ResourceGroup) -DataFactoryName $(DataFactory) -predeployment $true -deleteDeployment $false'
    azurePowerShellVersion: 'LatestVersion'

关键说明

  • displayName需要和task、inputs处于同一层级,作为任务的直接属性配置。
  • 修正后重新运行流水线,任务名称就会显示为你设置的PreDeployment。

内容的提问来源于stack exchange,提问作者Patterson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 17:22:00