1
---
2
name: azure-devops-cli
3
description: Manage Azure DevOps resources via CLI including projects, repos, pipelines, builds, pull requests, work items, artifacts, and service endpoints. Use when working with Azure DevOps, az commands, devops automation, CI/CD, or when user mentions Azure DevOps CLI.
4
---
5
6
# Azure DevOps CLI
7
8
Manage Azure DevOps resources using the Azure CLI with the Azure DevOps extension.
9
10
**CLI Version:** 2.81.0 (current as of 2025)
11
12
## Prerequisites
13
14
```bash
15
# Install Azure CLI
16
brew install azure-cli # macOS
17
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash # Linux
18
19
# Install Azure DevOps extension
20
az extension add --name azure-devops
21
```
22
23
## Authentication
24
25
```bash
26
# Login with PAT token
27
az devops login --organization https://dev.azure.com/{org} --token YOUR_PAT_TOKEN
28
29
# Set default organization and project (avoids repeating --org/--project)
30
# Note: Legacy URL https://{org}.visualstudio.com should be replaced with https://dev.azure.com/{org}
31
az devops configure --defaults organization=https://dev.azure.com/{org} project={project}
32
33
# List current configuration
34
az devops configure --list
35
```
36
37
## CLI Structure
38
39
```
40
az devops # Main DevOps commands
41
├── admin # Administration (banner)
42
├── extension # Extension management
43
├── project # Team projects
44
├── security # Security operations
45
│ ├── group # Security groups
46
│ └── permission # Security permissions
47
├── service-endpoint # Service connections
48
├── team # Teams
49
├── user # Users
50
├── wiki # Wikis
51
├── configure # Set defaults
52
├── invoke # Invoke REST API
53
├── login # Authenticate
54
└── logout # Clear credentials
55
56
az pipelines # Azure Pipelines
57
├── agent # Agents
58
├── build # Builds
59
├── folder # Pipeline folders
60
├── pool # Agent pools
61
├── queue # Agent queues
62
├── release # Releases
63
├── runs # Pipeline runs
64
├── variable # Pipeline variables
65
└── variable-group # Variable groups
66
67
az boards # Azure Boards
68
├── area # Area paths
69
├── iteration # Iterations
70
└── work-item # Work items
71
72
az repos # Azure Repos
73
├── import # Git imports
74
├── policy # Branch policies
75
├── pr # Pull requests
76
└── ref # Git references
77
78
az artifacts # Azure Artifacts
79
└── universal # Universal Packages
80
```
81
82
## Reference Files
83
84
Read the relevant reference file based on the user's task. Each file contains complete command syntax and examples for its domain.
85
86
| File | When to read | Covers |
87
|---|---|---|
88
| `references/repos-and-prs.md` | Repos, branches, pull requests, branch policies | Repositories, Import, PRs (create/list/vote/reviewers/policies), Git refs, Branch policies |
89
| `references/pipelines-and-builds.md` | Pipelines, builds, releases, artifacts | Pipelines CRUD, runs, builds, releases, artifacts download/upload |
90
| `references/boards-and-iterations.md` | Work items, sprints, area paths | Work items (WIQL/create/update/relations), Area paths, Iterations, Team iterations |
91
| `references/variables-and-agents.md` | Pipeline variables, agent pools | Pipeline variables, Variable groups, Pipeline folders, Agent pools/queues |
92
| `references/org-and-security.md` | Projects, teams, users, permissions, wikis | Projects, Extensions, Teams, Users, Security groups/permissions, Service endpoints, Wikis, Admin |
93
| `references/advanced-usage.md` | Output formatting, JMESPath queries | Output formats, JMESPath queries (basic + advanced), Global args, Common params, Git aliases |
94
| `references/workflows-and-patterns.md` | Automation scripts, best practices, error handling | Common workflows, Best practices, Error handling, Scripting patterns, Real-world examples |
95
| `references/long-comments-on-windows.md` | Long `--discussion`, `--description`, or `--content` values failing on Windows | The `cmd.exe` 8191 char cap on `az.cmd`, shell detection, and three verified workarounds (`azps.ps1`, native `--file-path`, `az devops invoke --in-file`) |
96