az-devops
Manage Azure DevOps from the command line
TLDR
Set the Personal Access Token (PAT) to login to a particular organization
Open a project in the browser
List members of a specific team working on a particular project
Check the Azure DevOps CLI current configuration
Configure the Azure DevOps CLI behavior by setting a default project and a default organization
SYNOPSIS
Usage:
az devops <command-group> <subcommand> [options]
This command acts as a root for a large set of subcommands. For example:
az devops project list
az devops configure --defaults organization=https://dev.azure.com/myorg project=myproject
az devops pipelines build queue --definition-id 123 --branch main
PARAMETERS
<command-group>
Represents the specific service area within Azure DevOps you wish to manage. Common groups include project (for managing projects), repos (for managing Git repositories), pipelines (for managing build/release pipelines), boards (for managing work items), artifacts (for managing packages), security (for managing permissions), and configure (for setting defaults). Each group has its own set of <subcommands> and [options].
<subcommand>
The specific action to perform within a <command-group>. For instance, under the project group, you might use create, list, show, or delete. The available <subcommands> and their specific [options] vary widely depending on the chosen <command-group>.
[--help]
Displays detailed help for the command, a subcommand, or a command group, showing available options and examples.
[--output {json, jsonc, table, tsv, yaml, yamlc, none}]
Specifies the output format of the command results. This is a common global Azure CLI option.
[--query]
A JMESPath query string used to filter or transform the command output, allowing for precise data extraction. This is a common global Azure CLI option.
[--verbose]
Increases logging verbosity to show more detailed information, useful for debugging. This is a common global Azure CLI option.
[--debug]
Enables even higher logging verbosity than --verbose, providing all debug logs for in-depth troubleshooting. This is a common global Azure CLI option.
DESCRIPTION
The az devops command is an extension to the Azure Command-Line Interface (Azure CLI) specifically designed to interact with and manage Azure DevOps services. It provides a comprehensive set of functionalities for automating tasks related to source control (Azure Repos), continuous integration and continuous delivery (Azure Pipelines), agile planning (Azure Boards), package management (Azure Artifacts), and test management (Azure Test Plans). Users can perform a wide array of operations such as creating and managing projects, configuring complex build and release pipelines, managing work items and sprints, handling Git repositories and pull requests, and administering organization and project-level settings. This direct command-line interface enables powerful scripting, integration with CI/CD workflows, and consistent automation of DevOps practices across various environments.
CAVEATS
The az devops command is an extension to the core Azure CLI. It is not installed by default and must be added separately using the command: az extension add --name azure-devops.
Users must be authenticated with Azure (e.g., via az login) and possess appropriate permissions within the specific Azure DevOps organization and project to perform desired operations.
The command syntax can be quite detailed due to the nested nature of subcommands and numerous service-specific options, often requiring familiarity with both Azure CLI conventions and Azure DevOps concepts.
AUTHENTICATION
To utilize az devops commands, you first need to authenticate your Azure CLI session. This is typically done interactively via az login, which prompts you to open a browser for sign-in. Once authenticated, the CLI uses your Azure identity to securely interact with Azure DevOps services, respecting your assigned permissions and access levels.
CONFIGURATION DEFAULTS
For convenience, you can set default values for your Azure DevOps organization and project using the command az devops configure --defaults organization=<URL> project=<Name>. This significantly shortens subsequent commands by eliminating the need to specify these common parameters repeatedly, making your scripts cleaner and easier to use.
SCRIPTING AND AUTOMATION
The command-line interface makes az devops an invaluable tool for scripting and automating repetitive administrative and operational tasks within Azure DevOps. It is commonly integrated into CI/CD pipelines, pre-commit hooks, or custom management scripts to streamline development, deployment, and operational workflows, fostering consistent and repeatable DevOps practices.
HISTORY
Azure DevOps services have a rich history evolving from Microsoft's on-premises offerings like Visual Studio Team System (VSTS) and Team Foundation Server (TFS). The cloud-based counterpart, initially known as Visual Studio Team Services (VSTS), was rebranded to Azure DevOps in 2018, consolidating various developer services. Concurrently, the Azure CLI, Microsoft's cross-platform command-line tool, introduced an extensibility model. The azure-devops extension was subsequently developed to provide a native command-line interface for managing these consolidated services, aligning with the growing emphasis on automation and DevOps practices in cloud environments. Its ongoing development reflects new features and capabilities introduced to the Azure DevOps platform.
SEE ALSO
az(1) (The main Azure CLI command, providing access to all Azure services), git(1) (Distributed version control system, fundamental for Azure Repos and source control), terraform(1) (Infrastructure as Code tool, frequently integrated with Azure DevOps Pipelines for deployment), docker(1) (Containerization platform, widely used in CI/CD pipelines to build and deploy applications), kubectl(1) (Command-line tool for controlling Kubernetes clusters, often used in conjunction with pipelines for Kubernetes deployments)