Printing template parameters in azure devops template

Viewed 1493

Is there a task or command that I can use to output all the parameters variable in a Azure DevOps template when the pipeline is run?

I would like the first task in the pipeline to print all parameters, that would help to spot mistakes.

Any suggestions

2 Answers

At the moment there is no way to display template parameters using single command, so your only option is printing them one be one like this:

- script: |
    echo 'vmImage - ${{ parameters.vmImage }}'
    echo 'anotherRuntimeParameter - ${{ parameters.anotherRuntimeParameter }}'

I was also faced with this requirement and found the following solution:

    - script: |    
       echo "${{ convertToJson(parameters) }}"

Documentation for convertToJson

Related