curl -X POST \
https://dev.azure.com/{org}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=7.0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $(System.AccessToken)" \
-d '{
"resources": {
"repositories": {
"self": {
"refName": "refs/heads/branch"
}
}
},
"stagesToSkip": [
"AKS_MAR_N",
"AKS_UBU_N_1"
]
}'
After the investigation I found that we don't need any specific conditions with parameters/variables runOnlyStage is not supporting and instead we can use the stagesToSkip to skip the stages what we don't want to run.