Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Pipeline Debug Logging

Using a YAML template, my understanding is the code below should log the parameters when I run the code with system.debug : true. Can someone tell me what I have done wrong?

parameters:
- name: branchName
  displayName: 'Repository branch name'
  type: string
- name: WebAppName
  displayName: 'Application name'
  type: string
- name: ServiceConnection
  displayName: 'ServiceConnection name'
  type: string
- name: Workspace
  displayName: 'Workspace name'
  type: string
  
  ##[group]Beginning of a DeployTemplate Parameters
  ##[debug]Debug branchName: ${{parameters.branchName}}
  ##[debug]Debug WebAppName: ${{parameters.WebAppName}}
  ##[debug]Debug ServiceConnection: ${{parameters.ServiceConnection}}
  ##[debug]Debug Workspace: ${{parameters.Workspace}}
  ##[debug]Build.SourceBranchName: variables['Build.SourceBranchName']
  ##[endgroup]
like image 369
nice Avatar asked May 11 '26 06:05

nice


1 Answers

I tested the following script, on my side, the parameter value is displayed normally in the log. Did you set the defalut value for the parameter in the template file or pass the value to the parameter in the pipeline yaml?

Parameter template yaml:

enter image description here

Pipeline yaml:

enter image description here

Logs:

enter image description here

like image 197
Hugh Lin Avatar answered May 12 '26 19:05

Hugh Lin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!