az pipelines: Manage and Check Azure Pipelines
az pipelines, from the Azure CLI azure-devops extension, creates and runs pipelines; the preview API renders the final YAML for a pipeline without queuing a real run.
Azure Pipelines validates YAML on the server. The azure-devops CLI extension lets you drive that from the terminal, and the runs preview endpoint returns the compiled YAML so you can check templates before merging.
What it does
The az pipelines command group (installed via az extension add --name azure-devops) lists, creates, and runs pipelines. To validate YAML including templates, call the preview REST API with az devops invoke, which returns the final compiled YAML or the error.
Common usage
az extension add --name azure-devops
az pipelines list --org https://dev.azure.com/ORG --project PROJ
az pipelines run --name my-pipeline --branch main
# preview (compile) a pipeline without running it
az devops invoke --area pipelines --resource preview \
--route-parameters project=PROJ pipelineId=ID \
--http-method POST --api-version 7.1 \
--in-file preview.jsonOptions
| Command / flag | What it does |
|---|---|
| az pipelines run | Queue a run of a pipeline |
| --name / --id | Select the pipeline by name or id |
| --branch <ref> | Branch to run against |
| az pipelines runs list | List past runs |
| az devops invoke ... resource preview | Compile YAML via the preview API without running |
| --org / --project | Target organization and project (or set defaults) |
In CI
Use the preview API in a validation job to compile templated YAML and fail the PR if compilation errors. For a pure syntax gate on the file, a YAML linter plus the server-side check on push is often enough.
Common errors in CI
A bad pipeline compiles to errors like /azure-pipelines.yml (Line: N, Col: M): Unexpected value ... and A template expression is not allowed in this context. TF400813: The user is not authorized means the PAT lacks scope. az: error: ... is not in the ... command group means the azure-devops extension is not installed.