Reputation: 5236
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
Upvotes: 7
Views: 6053
Reputation: 71
I've found this to work for me: (as just using the respond above gave an error)
- powershell: |
$jsonParams = '${{ convertToJson(parameters) }}'
Write-Host $jsonParams
displayName: 'Print parameters in JSON format'
Upvotes: 5
Reputation: 745
I was also faced with this requirement and found the following solution:
- script: |
echo "${{ convertToJson(parameters) }}"
Documentation for convertToJson
Upvotes: 10
Reputation: 40633
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 }}'
Upvotes: 1