Skip to content
Latchkey

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

Terminal
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.json

Options

Command / flagWhat it does
az pipelines runQueue a run of a pipeline
--name / --idSelect the pipeline by name or id
--branch <ref>Branch to run against
az pipelines runs listList past runs
az devops invoke ... resource previewCompile YAML via the preview API without running
--org / --projectTarget 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.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →