部署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
相关产品推荐
相关产品推荐

