Azure DevOps CLI
Use the Azure CLI plus the Azure DevOps extension to automate projects, repos, pipelines, builds, pull requests, work items, artifacts, service endpoints, security, teams, users, wikis, variables, agents, and advanced REST calls.
When to invoke
- "Use Azure DevOps CLI to create a pull request."
- "List pipeline runs with az pipelines."
- "Create or update an Azure Boards work item."
- "Automate Azure DevOps repos, builds, or artifacts."
- "Fix this az devops command or PAT login."
Prerequisites and context
CLI Version: 2.81.0 (current as of 2025)
# Install Azure CLI on macOS
brew install azure-cli
# Install Azure CLI on Linux
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# Install Azure DevOps extension
az extension add --name azure-devops
Authenticate with a PAT only through standard CLI login; do not print or store the token in scripts.
az devops login --organization https://dev.azure.com/{org} --token YOUR_PAT_TOKEN
az devops configure --defaults organization=https://dev.azure.com/{org} project={project}
az devops configure --list
Replace legacy https://{org}.visualstudio.com URLs with https://dev.azure.com/{org}.
Command map
az devops # Main DevOps commands
├── admin # Administration (banner)
├── extension # Extension management
├── project # Team projects
├── security # Security operations
│ ├── group # Security groups
│ └── permission # Security permissions
├── service-endpoint # Service connections
├── team # Teams
├── user # Users
├── wiki # Wikis
├── configure # Set defaults
├── invoke # Invoke REST API
├── login # Authenticate
└── logout # Clear credentials
az pipelines # Azure Pipelines
├── agent # Agents
├── build # Builds
├── folder # Pipeline folders
├── pool # Agent pools
├── queue # Agent queues
├── release # Releases
├── runs # Pipeline runs
├── variable # Pipeline variables
└── variable-group # Variable groups
az boards # Azure Boards
├── area # Area paths
├── iteration # Iterations
└── work-item # Work items
az repos # Azure Repos
├── import # Git imports
├── policy # Branch policies
├── pr # Pull requests
└── ref # Git references
az artifacts # Azure Artifacts
└── universal # Universal Packages
Reference routing
Read the smallest reference that matches the user task.
| File |
When to read |
Covers |
references/repos-and-prs.md |
Repos, branches, pull requests, branch policies |
Repositories, Import, PRs create/list/vote/reviewers/policies, Git refs, Branch policies |
references/pipelines-and-builds.md |
Pipelines, builds, releases, artifacts |
Pipelines CRUD, runs, builds, releases, artifacts download/upload |
references/boards-and-iterations.md |
Work items, sprints, area paths |
Work items, WIQL, create/update/relations, Area paths, Iterations, Team iterations |
references/variables-and-agents.md |
Pipeline variables, variable groups, agent pools |
Pipeline variables, Variable groups, Pipeline folders, Agent pools/queues |
references/org-and-security.md |
Projects, teams, users, permissions, wikis |
Projects, Extensions, Teams, Users, Security groups/permissions, Service endpoints, Wikis, Admin |
references/advanced-usage.md |
Output formatting, JMESPath, aliases |
Output formats, JMESPath queries, Global args, Common params, Git aliases |
references/workflows-and-patterns.md |
Automation scripts and repeatable workflows |
Common workflows, Best practices, Error handling, Scripting patterns, Real-world examples |
references/long-comments-on-windows.md |
Long descriptions or discussions fail on Windows |
cmd.exe 8191 char cap on az.cmd, shell detection, azps.ps1, native --file-path, az devops invoke --in-file |
Procedure
- Identify the target organization, project, resource type, and command group.
- Configure defaults with
az devops configure --defaults when repeated commands share organization and project.
- Read the relevant reference file for exact command syntax.
- Use
--output json or --query for scripts; avoid parsing human table output.
- For commands that create or mutate resources, preview inputs and use explicit names, IDs, and project context.
- For unsupported CLI gaps, use
az devops invoke with the documented REST route.
- Report the command run, output summary, and any IDs or URLs created.
Command selection patterns
| Goal |
Command family |
Notes |
| Create/list projects |
az devops project |
Use org defaults or pass organization explicitly. |
| Create PRs and policies |
az repos pr, az repos policy |
Prefer branch names and repository IDs from CLI output. |
| Queue or inspect builds |
az pipelines build, az pipelines runs |
Use JSON output for automation. |
| Manage releases |
az pipelines release |
Confirm project and definition before mutation. |
| Work with boards |
az boards work-item, az boards area, az boards iteration |
Use WIQL for complex queries. |
| Manage artifacts |
az artifacts universal |
Confirm feed, package, version, and path. |
| Manage service connections |
az devops service-endpoint |
Treat credentials as secrets; do not echo them. |
| Security and permissions |
az devops security group, az devops security permission |
Use descriptors and namespace IDs carefully. |
Gotchas
- Do not expose
YOUR_PAT_TOKEN: pass tokens through secure input or environment-controlled login, never commit them.
- Configure defaults carefully: stale defaults can mutate the wrong organization or project.
- Prefer
https://dev.azure.com/{org}: legacy https://{org}.visualstudio.com URLs should be replaced.
- Windows long comments fail through
az.cmd: read references/long-comments-on-windows.md before sending long --discussion, --description, or --content values.
- JMESPath is not shell-neutral: quote
--query expressions differently for Bash, PowerShell, and cmd.exe when needed.
Progressive disclosure and bundled resources
This skill is a router over reference files. Read only the reference matching the task so command details stay precise without loading every Azure DevOps domain.
references/repos-and-prs.md
references/pipelines-and-builds.md
references/boards-and-iterations.md
references/variables-and-agents.md
references/org-and-security.md
references/advanced-usage.md
references/workflows-and-patterns.md
references/long-comments-on-windows.md
CLI shorthand
Defaults avoid repeating --org/--project. Boards references include WIQL/create/update/relations patterns.
Output template
## Azure DevOps CLI result
**Status:** complete | blocked | failed
**Organization:** `https://dev.azure.com/{org}`
**Project:** `<project>`
**Command group:** `az <group>`
### Commands
- `<command run or recommended>`
### Results
| Resource | ID/Name | URL/State |
| --- | --- | --- |
| <resource> | <id or name> | <url or state> |
### Validation
- Authentication/config checked: pass | fail
- Reference file used: `<references/file.md>`
- Output captured as JSON or explicit IDs: pass | fail
Quality gate
References
1---2name: azure-devops-cli3description: Manage Azure DevOps with Azure CLI and the azure-devops extension. Use when the user asks for Azure DevOps CLI commands, az devops automation, projects, repos, pull requests, pipelines, builds, work items, artifacts, service endpoints, permissions, or CI/CD scripting.4---56<!-- Generated from harness/github-copilot/skills/azure-devops-cli/SKILL.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->78# Azure DevOps CLI910Use the Azure CLI plus the Azure DevOps extension to automate projects, repos, pipelines, builds, pull requests, work items, artifacts, service endpoints, security, teams, users, wikis, variables, agents, and advanced REST calls.1112## When to invoke1314- "Use Azure DevOps CLI to create a pull request."15- "List pipeline runs with az pipelines."16- "Create or update an Azure Boards work item."17- "Automate Azure DevOps repos, builds, or artifacts."18- "Fix this az devops command or PAT login."1920## Prerequisites and context2122**CLI Version:** 2.81.0 (current as of 2025)2324```bash25# Install Azure CLI on macOS26brew install azure-cli2728# Install Azure CLI on Linux29curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash3031# Install Azure DevOps extension32az extension add --name azure-devops33```3435Authenticate with a PAT only through standard CLI login; do not print or store the token in scripts.3637```bash38az devops login --organization https://dev.azure.com/{org} --token YOUR_PAT_TOKEN39az devops configure --defaults organization=https://dev.azure.com/{org} project={project}40az devops configure --list41```4243Replace legacy `https://{org}.visualstudio.com` URLs with `https://dev.azure.com/{org}`.4445## Command map4647```text48az devops # Main DevOps commands49├── admin # Administration (banner)50├── extension # Extension management51├── project # Team projects52├── security # Security operations53│ ├── group # Security groups54│ └── permission # Security permissions55├── service-endpoint # Service connections56├── team # Teams57├── user # Users58├── wiki # Wikis59├── configure # Set defaults60├── invoke # Invoke REST API61├── login # Authenticate62└── logout # Clear credentials6364az pipelines # Azure Pipelines65├── agent # Agents66├── build # Builds67├── folder # Pipeline folders68├── pool # Agent pools69├── queue # Agent queues70├── release # Releases71├── runs # Pipeline runs72├── variable # Pipeline variables73└── variable-group # Variable groups7475az boards # Azure Boards76├── area # Area paths77├── iteration # Iterations78└── work-item # Work items7980az repos # Azure Repos81├── import # Git imports82├── policy # Branch policies83├── pr # Pull requests84└── ref # Git references8586az artifacts # Azure Artifacts87└── universal # Universal Packages88```8990## Reference routing9192Read the smallest reference that matches the user task.9394| File | When to read | Covers |95| --- | --- | --- |96| `references/repos-and-prs.md` | Repos, branches, pull requests, branch policies | Repositories, Import, PRs create/list/vote/reviewers/policies, Git refs, Branch policies |97| `references/pipelines-and-builds.md` | Pipelines, builds, releases, artifacts | Pipelines CRUD, runs, builds, releases, artifacts download/upload |98| `references/boards-and-iterations.md` | Work items, sprints, area paths | Work items, WIQL, create/update/relations, Area paths, Iterations, Team iterations |99| `references/variables-and-agents.md` | Pipeline variables, variable groups, agent pools | Pipeline variables, Variable groups, Pipeline folders, Agent pools/queues |100| `references/org-and-security.md` | Projects, teams, users, permissions, wikis | Projects, Extensions, Teams, Users, Security groups/permissions, Service endpoints, Wikis, Admin |101| `references/advanced-usage.md` | Output formatting, JMESPath, aliases | Output formats, JMESPath queries, Global args, Common params, Git aliases |102| `references/workflows-and-patterns.md` | Automation scripts and repeatable workflows | Common workflows, Best practices, Error handling, Scripting patterns, Real-world examples |103| `references/long-comments-on-windows.md` | Long descriptions or discussions fail on Windows | `cmd.exe` 8191 char cap on `az.cmd`, shell detection, `azps.ps1`, native `--file-path`, `az devops invoke --in-file` |104105## Procedure1061071. Identify the target organization, project, resource type, and command group.1082. Configure defaults with `az devops configure --defaults` when repeated commands share organization and project.1093. Read the relevant reference file for exact command syntax.1104. Use `--output json` or `--query` for scripts; avoid parsing human table output.1115. For commands that create or mutate resources, preview inputs and use explicit names, IDs, and project context.1126. For unsupported CLI gaps, use `az devops invoke` with the documented REST route.1137. Report the command run, output summary, and any IDs or URLs created.114115## Command selection patterns116117| Goal | Command family | Notes |118| --- | --- | --- |119| Create/list projects | `az devops project` | Use org defaults or pass organization explicitly. |120| Create PRs and policies | `az repos pr`, `az repos policy` | Prefer branch names and repository IDs from CLI output. |121| Queue or inspect builds | `az pipelines build`, `az pipelines runs` | Use JSON output for automation. |122| Manage releases | `az pipelines release` | Confirm project and definition before mutation. |123| Work with boards | `az boards work-item`, `az boards area`, `az boards iteration` | Use WIQL for complex queries. |124| Manage artifacts | `az artifacts universal` | Confirm feed, package, version, and path. |125| Manage service connections | `az devops service-endpoint` | Treat credentials as secrets; do not echo them. |126| Security and permissions | `az devops security group`, `az devops security permission` | Use descriptors and namespace IDs carefully. |127128## Gotchas129130- **Do not expose `YOUR_PAT_TOKEN`**: pass tokens through secure input or environment-controlled login, never commit them.131- **Configure defaults carefully**: stale defaults can mutate the wrong organization or project.132- **Prefer `https://dev.azure.com/{org}`**: legacy `https://{org}.visualstudio.com` URLs should be replaced.133- **Windows long comments fail through `az.cmd`**: read `references/long-comments-on-windows.md` before sending long `--discussion`, `--description`, or `--content` values.134- **JMESPath is not shell-neutral**: quote `--query` expressions differently for Bash, PowerShell, and cmd.exe when needed.135136## Progressive disclosure and bundled resources137138This skill is a router over reference files. Read only the reference matching the task so command details stay precise without loading every Azure DevOps domain.139140- `references/repos-and-prs.md`141- `references/pipelines-and-builds.md`142- `references/boards-and-iterations.md`143- `references/variables-and-agents.md`144- `references/org-and-security.md`145- `references/advanced-usage.md`146- `references/workflows-and-patterns.md`147- `references/long-comments-on-windows.md`148149## CLI shorthand150151Defaults avoid repeating `--org/--project`. Boards references include `WIQL/create/update/relations` patterns.152153## Output template154155```markdown156## Azure DevOps CLI result157158**Status:** complete | blocked | failed159**Organization:** `https://dev.azure.com/{org}`160**Project:** `<project>`161**Command group:** `az <group>`162163### Commands164- `<command run or recommended>`165166### Results167| Resource | ID/Name | URL/State |168| --- | --- | --- |169| <resource> | <id or name> | <url or state> |170171### Validation172- Authentication/config checked: pass | fail173- Reference file used: `<references/file.md>`174- Output captured as JSON or explicit IDs: pass | fail175```176177## Quality gate178179- [ ] Azure CLI and `azure-devops` extension prerequisites are satisfied or installation commands are provided.180- [ ] Organization uses `https://dev.azure.com/{org}` and the project context is explicit.181- [ ] `YOUR_PAT_TOKEN` or any real PAT is never printed, committed, or embedded in scripts.182- [ ] The relevant bundled reference file was used for exact syntax.183- [ ] Mutating commands identify the target resource by explicit project, repository, pipeline, work item, or descriptor.184- [ ] Scripted output uses JSON, IDs, or `--query` instead of fragile table parsing.185- [ ] Windows long-comment workarounds are used when command length may exceed the `cmd.exe` limit.186187## References188189- [Azure CLI Linux install](https://aka.ms/InstallAzureCLIDeb)