8

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?

Stef Heyenrath
  • 9,335
  • 12
  • 66
  • 121

1 Answers1

15

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

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • This works fine indeed, however I was mislead by VS2017 because the syntax highlighting failed. See this image : https://imgur.com/a/jgXH6t2 – Stef Heyenrath Oct 11 '18 at 16:28
  • @Stef Heyenrath: Seems to be fixed in 2019, but for 2017, try moving displayName above script. – steve May 11 '20 at 18:39