Long enough title? It might be longer than the actual article content.
If you need to queue a yaml pipeline in Azure DevOps from a script, you may be tempted to use the az cli and the devops extension. The extension is useful, but has some bugs/gaps I would recommend using it in combination with the Azure DevOps REST API.
This DOES NOT work:
az pipelines run --organization "https://dev.azure.com/organization/" `
--project "project" `
--name "Pipeline" `
--open `
--variables foo=bar --debug
But this rest request does:
POST https://dev.azure.com/organization/project/_apis/pipelines/25/runs?api-version=6.0-preview.1
Content-Type: application/json
X-VSS-ForceMsaPassThrough: true
Authorization: Basic <PAT>
{
"templateParameters": {"foo": "bar"}
}
Use this PowerShell to create your rest request:
2 Replies to “How to Queue an Azure DevOps yaml Pipeline with Parameters from PowerShell”