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]
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:

Pipeline yaml:

Logs:

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