Azure DevOps中任务的name与displayName属性差异解析
Difference between
name and displayName in Azure DevOps Pipeline Tasks Great question! Let's break down these two properties using your provided DotNetCoreCLI@2 task as an example:
name(Internal Identifier)
This is the machine-friendly, unique identifier for your task. It’s used behind the scenes by the Azure DevOps pipeline system and for cross-task references:- You’ll use this value to reference the task’s outputs or set dependencies (e.g.,
dependsOn: CleanProjectsBeforeBuildin another task) - It can’t contain spaces or special characters—needs to follow valid variable naming rules
- In your example,
name: 'CleanProjectsBeforeBuild'is how the pipeline tracks this task internally, even if you change the display name later
- You’ll use this value to reference the task’s outputs or set dependencies (e.g.,
displayName(Human-Friendly Label)
This is the readable, descriptive name that appears in the Azure DevOps UI (like the pipeline run logs, task list, and dashboard). It’s purely for human clarity:- You can use spaces, capitalization, and natural language to make it obvious what the task does (your
Clean Projects Before Buildis perfect for this) - It doesn’t affect the task’s functionality or how other tasks interact with it—changing it only updates what you see in the interface
- You can use spaces, capitalization, and natural language to make it obvious what the task does (your
To put it simply: name is for the pipeline to understand, displayName is for you to understand at a glance.
内容的提问来源于stack exchange,提问作者Alejandro Herrera
相关产品推荐
相关产品推荐

