I'm trying to create a YAML based pipeline that takes a parameter, then trigger the pipeline to run from a Azure DevOps REST API. I'm able to see the build gets queued, but the parameter was not overridden from my POST body.
My template my-template.yaml
.
parameters:
- name: testParam
type: string
default: 'N/A'
steps:
- script: echo ${{ parameters.testParam }}
My pipeline yaml that extends the template.
trigger:
- master
extends:
template: my-template.yaml
Then I trigger this pipeline using the queue build
REST API: https://dev.azure.com/{organization}/{project}/_apis/build/builds?api-version=5.1
with a POST body as below.
{
"parameters": "{\"testParam\": \"hello world\"}",
"definition": {
"id": 50642
},
"sourceBranch": "refs/heads/master"
}
So I'm expecting the pipeline execution will echo hello world
instead of N/A
. Unfortunately, I'm still seeing N/A
in the pipeline results.
Anyone has idea of what happened? Am I miss anything?