LinuxCommandLibrary

az-pipelines

Manage Azure Pipelines from the command line

TLDR

Create a new Azure Pipeline (YAML based)

$ az pipelines create [[--org|--organization]] [organization_url] [[-p|--project]] [project_name] --name [pipeline_name] --description [description] --repository [repository_name] --branch [branch_name]
copy

Delete a specific pipeline
$ az pipelines delete [[--org|--organization]] [organization_url] [[-p|--project]] [project_name] --id [pipeline_id]
copy

List pipelines
$ az pipelines list [[--org|--organization]] [organization_url] [[-p|--project]] [project_name]
copy

Enqueue a specific pipeline to run
$ az pipelines run [[--org|--organization]] [organization_url] [[-p|--project]] [project_name] --name [pipeline_name]
copy

Get the details of a specific pipeline
$ az pipelines show [[--org|--organization]] [organization_url] [[-p|--project]] [project_name] --name [pipeline_name]
copy

Update a specific pipeline
$ az pipelines update [[--org|--organization]] [organization_url] [[-p|--project]] [project_name] --name [pipeline_name] --new-name [pipeline_new_name] --new-folder-path [user1/production_pipelines]
copy

List all agents in a pool
$ az pipelines agent list [[--org|--organization]] [organization_url] --pool-id [agent_pool]
copy

SYNOPSIS

az pipelines [--organization <ORG_URL>] [--project <NAME_OR_ID>] {create|delete|list|show|update} [--output (-o) <format>] [--query <JMESPath>] [global-options]

PARAMETERS

--debug
    Increase logging verbosity to show all debug logs.

--help (-h)
    Show help message and exit.

--only-show-errors
    Only show errors, suppressing warnings.

--output (-o)
    Output format: json, jsonc, table, tsv. Default: json.

--query
    JMESPath query string for output filtering.

--subscription
    Azure subscription name or ID.

--verbose
    Increase logging verbosity.

--organization
    Azure DevOps organization URL. Configurable via az devops configure.

--project
    Project name or ID. Configurable via az devops configure.

DESCRIPTION

The az pipelines command is part of the Azure CLI's Azure DevOps extension, enabling programmatic management of pipelines in Azure DevOps. It supports creating, listing, viewing, updating, and deleting pipelines, primarily YAML-based CI/CD workflows.

Pipelines define build, test, and deployment processes for applications. This CLI tool integrates seamlessly with scripts, automation, and other DevOps practices, reducing reliance on the Azure DevOps web portal. Key operations include listing pipelines in a project, showing detailed configurations, and bulk updates.

Usage requires specifying an organization and project context, either via command flags or default configuration. It inherits Azure CLI's output formatting (json, table, etc.) and query capabilities with JMESPath for filtering results. Ideal for infrastructure as code (IaC) enthusiasts and teams automating pipeline lifecycle management.

Subcommands handle core CRUD operations, while az pipelines folder manages organizational folders. Authentication uses Azure CLI login or personal access tokens (PATs).

CAVEATS

Requires Azure CLI with azure-devops extension installed and Azure DevOps authentication (e.g., az login or PAT). Not all advanced web UI features available. Subcommands may have additional required parameters.

INSTALLATION

az extension add --name azure-devops
az extension update --name azure-devops (for latest)

DEFAULT CONFIG

az devops configure --defaults organization=https://dev.azure.com/<org> project=<project>
Saves --organization and --project flags.

EXAMPLE USAGE

az pipelines list --organization https://dev.azure.com/myorg --project myproject --output table

HISTORY

Introduced in Azure CLI 2.0.50+ with azure-devops extension (2018). Evolved with Azure DevOps features like multi-stage YAML pipelines (2019+). Regular updates via az extension update.

SEE ALSO

az(1), git(1)

Copied to clipboard