azure-devopsyamlazure-pipelines

How to give tasks a name in Azure DevOps Pipelines (YML)


In the pipelines.yml file, the following is used:

steps:
# Print buildId
- script: |
    echo "BuildId = $(buildId)"

When looking at the build log in Azure DevOps, I see just "CmdLine".

TaskName

Is there a way to give a step or a script a readable name which is visible in the build log?


Solution

  • You just need to add the parameter displayName:

    steps:
    - script: 'echo "BuildId = $(Build.BuildId)"' 
      displayName: Test1001
    
    - script: 'echo "BuildId = $(Build.BuildId)"' 
      displayName: Test1002
    

    enter image description here