LinuxCommandLibrary

az-pipelines

Manage Azure Pipelines from the command line

TLDR

Create a new Azure Pipeline (YAML based)

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

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

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

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

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

Update a specific pipeline
$ az pipelines update --org [organization_url] --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_url] --pool-id [agent_pool]
copy

SYNOPSIS

az pipelines [command] [options]

PARAMETERS

--detect {false, true}
    Automatically detect organization and project. Default is true.

--org {organization}
    Azure DevOps organization URL. If not configured will attempt to default to the configured organization or detect.

--project {project}
    Name or ID of the project. If not configured will attempt to default to the configured project or detect.

--debug
    Increase logging verbosity to debug.

--help -h
    Show this help message and exit.

--output {json, jsonc, none, table, tsv, yaml, yml}
    Output format.

--query {JMES path}
    JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription {Azure subscription}
    Name or ID of subscription. If set, it becomes the default subscription.

DESCRIPTION

The az pipelines command is a part of the Azure DevOps CLI extension, providing a way to manage and interact with Azure Pipelines directly from your terminal. It allows users to create, list, update, run, and delete pipelines, as well as manage pipeline runs, definitions, builds, agents, and tasks.

Using az pipelines, developers and administrators can automate pipeline management tasks, integrate pipeline operations into scripts, and streamline their continuous integration and continuous delivery (CI/CD) workflows. It empowers users to manage pipelines without the need to navigate the Azure DevOps web interface. Through this interface, a user can connect directly to their Azure DevOps environment from the command line, empowering them to query for specific pipelines, execute them, and analyze the results without needing to interact through a web browser.

SUBCOMMANDS

The 'az pipelines' command has many subcommands, each responsible for different aspects of pipeline management. Examples include 'az pipelines create' for creating a new pipeline, 'az pipelines run' for manually triggering a pipeline run, 'az pipelines list' for listing available pipelines, and 'az pipelines build' which has subcommands to manage builds.

AUTHENTICATION

Before using the 'az pipelines' command, you must authenticate with Azure DevOps. This can be done using 'az login', which opens a browser window for authentication or using a personal access token (PAT). Ensure the PAT has the necessary permissions to manage pipelines.

SEE ALSO

az devops(1), az account(1)

Copied to clipboard