Azure Devops CLI
GitHubOfficialFirst committed by AungMyoKyawDistributed by GitHub
- Skill
- Tool integration
- Cloud and DevOps
- MIT
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The Azure DevOps CLI extension enables developers and DevOps engineers to interact with Azure DevOps services through the Azure CLI. It provides a comprehensive command set for managing projects, repositories, pull requests, pipelines, work items, and security configurations. By supporting various output formats and advanced JMESPath querying, it allows for efficient data extraction and integration into shell-based automation scripts.
What it does
- Manage projects, teams, and security permissions.
- Create, update, and query work items and board configurations.
- Handle Git repositories, pull requests, and branch policies.
- Control CI/CD pipelines, builds, releases, and agent pools.
- Query and filter resource data using JMESPath.
- Configure default organization and project settings for streamlined workflows.
When to use it
- Automating repetitive Azure DevOps tasks via shell scripts.
- Managing board items or pipeline configurations without a browser.
- Integrating Azure DevOps data into custom reporting or monitoring tools.
- Performing bulk updates or administrative tasks across multiple projects.
Advantages
- Enables scriptable, repeatable DevOps workflows.
- Reduces context switching by staying in the terminal.
- Supports powerful data filtering and transformation via JMESPath.
- Flexible output formats including JSON, YAML, and table views.
Usage examples
- “How do I list all active work items assigned to me?”
- The agent provides the 'az boards query' command with a WIQL string filtering by current user and active state.
- “Show me the last 5 successful pipeline runs in table format.”
- The agent demonstrates using 'az pipelines runs list' combined with a JMESPath query and '--output table'.
- “How can I create a new bug work item from the CLI?”
- The agent provides the 'az boards work-item create' command syntax with parameters for title, type, and description.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/github/azure-devops-cli/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip azure-devops-cli.zip -d .agents/skills
Documentation by AungMyoKyaw
Azure DevOps CLI
Manage Azure DevOps resources using the Azure CLI with the Azure DevOps extension.
CLI Version: 2.81.0 (current as of 2025)
Prerequisites
# Install Azure CLI
brew install azure-cli # macOS
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash # Linux
# Install Azure DevOps extension
az extension add --name azure-devopsAuthentication
# Login with PAT token
az devops login --organization https://dev.azure.com/{org} --token YOUR_PAT_TOKEN
# Set default organization and project (avoids repeating --org/--project)
# Note: Legacy URL https://{org}.visualstudio.com should be replaced with https://dev.azure.com/{org}
az devops configure --defaults organization=https://dev.azure.com/{org} project={project}
# List current configuration
az devops configure --listCLI Structure
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 PackagesReference Files
Read the relevant reference file based on the user's task. Each file contains complete command syntax and examples for its domain.
| 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, 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 queries | Output formats, JMESPath queries (basic + advanced), Global args, Common params, Git aliases |
references/workflows-and-patterns.md | Automation scripts, best practices, error handling | Common workflows, Best practices, Error handling, Scripting patterns, Real-world examples |
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) |
Files
- ATTRIBUTION.mdAdded by AutoGineer871 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md4.2 KiB
- references/advanced-usage.md5.3 KiB
- references/boards-and-iterations.md6.0 KiB
- references/long-comments-on-windows.md3.1 KiB
- references/org-and-security.md9.0 KiB
- references/pipelines-and-builds.md4.7 KiB
- references/repos-and-prs.md6.6 KiB
- references/variables-and-agents.md3.7 KiB
- references/workflows-and-patterns.md16.0 KiB
references/repos-and-prs.md
Repositories & Pull Requests
Table of Contents
Repositories
Repository Import
Pull Requests
Git References
Repository Policies
Repositories
List Repositories
az repos list --org https://dev.azure.com/{org} --project {project}
az repos list --output tableShow Repository Details
az repos show --repository {repo-name} --project {project}Create Repository
az repos create --name {repo-name} --project {project}Delete Repository
az repos delete --id {repo-id} --project {project} --yesUpdate Repository
az repos update --id {repo-id} --name {new-name} --project {project}Repository Import
Import Git Repository
# Import from public Git repository
az repos import create \
--git-source-url https://github.com/user/repo \
--repository {repo-name}
# Import with authentication
az repos import create \
--git-source-url https://github.com/user/private-repo \
--repository {repo-name} \
--user {username} \
--password {password-or-pat}Pull Requests
Create Pull Request
# Basic PR creation
az repos pr create \
--repository {repo} \
--source-branch {source-branch} \
--target-branch {target-branch} \
--title "PR Title" \
--description "PR description" \
--open
# PR with work items
az repos pr create \
--repository {repo} \
--source-branch {source-branch} \
--work-items 63 64
# Draft PR with reviewers
az repos pr create \
--repository {repo} \
--source-branch feature/new-feature \
--target-branch main \
--title "Feature: New functionality" \
--draft true \
--reviewers [email protected] [email protected] \
--required-reviewers [email protected] \
--labels "enhancement" "backlog"List Pull Requests
# All PRs
az repos pr list --repository {repo}
# Filter by status
az repos pr list --repository {repo} --status active
# Filter by creator
az repos pr list --repository {repo} --creator {email}
# Output as table
az repos pr list --repository {repo} --output tableShow PR Details
az repos pr show --id {pr-id}
az repos pr show --id {pr-id} --open # Open in browserUpdate PR (Complete/Abandon/Draft)
# Complete PR
az repos pr update --id {pr-id} --status completed
# Abandon PR
az repos pr update --id {pr-id} --status abandoned
# Set to draft
az repos pr update --id {pr-id} --draft true
# Publish draft PR
az repos pr update --id {pr-id} --draft false
# Auto-complete when policies pass
az repos pr update --id {pr-id} --auto-complete true
# Set title and description
az repos pr update --id {pr-id} --title "New title" --description "New description"Checkout PR Locally
# Checkout PR branch
az repos pr checkout --id {pr-id}
# Checkout with specific remote
az repos pr checkout --id {pr-id} --remote-name upstreamVote on PR
az repos pr set-vote --id {pr-id} --vote approve
az repos pr set-vote --id {pr-id} --vote approve-with-suggestions
az repos pr set-vote --id {pr-id} --vote reject
az repos pr set-vote --id {pr-id} --vote wait-for-author
az repos pr set-vote --id {pr-id} --vote resetPR Reviewers
# Add reviewers
az repos pr reviewer add --id {pr-id} --reviewers [email protected] [email protected]
# List reviewers
az repos pr reviewer list --id {pr-id}
# Remove reviewers
az repos pr reviewer remove --id {pr-id} --reviewers [email protected]PR Work Items
# Add work items to PR
az repos pr work-item add --id {pr-id} --work-items {id1} {id2}
# List PR work items
az repos pr work-item list --id {pr-id}
# Remove work items from PR
az repos pr work-item remove --id {pr-id} --work-items {id1}PR Policies
# List policies for a PR
az repos pr policy list --id {pr-id}
# Queue policy evaluation for a PR
az repos pr policy queue --id {pr-id} --evaluation-id {evaluation-id}Git References
List References (Branches)
az repos ref list --repository {repo}
az repos ref list --repository {repo} --query "[?name=='refs/heads/main']"Create Reference (Branch)
az repos ref create --name refs/heads/new-branch --object-type commit --object {commit-sha}Delete Reference (Branch)
az repos ref delete --name refs/heads/old-branch --repository {repo} --project {project}Lock/Unlock Branch
az repos ref lock --name refs/heads/main --repository {repo} --project {project}
az repos ref unlock --name refs/heads/main --repository {repo} --project {project}Repository Policies
List All Policies
az repos policy list --repository {repo-id} --branch mainCreate/Update/Delete Policy
# Create from config file
az repos policy create --config policy.json
# Update
az repos policy update --id {policy-id} --config updated-policy.json
# Delete
az repos policy delete --id {policy-id} --yesApprover Count Policy
az repos policy approver-count create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--minimum-approver-count 2 \
--creator-vote-counts trueBuild Policy
az repos policy build create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--build-definition-id {definition-id} \
--queue-on-source-update-only true \
--valid-duration 720Work Item Linking Policy
az repos policy work-item-linking create \
--blocking true \
--branch main \
--enabled true \
--repository-id {repo-id}Required Reviewer Policy
az repos policy required-reviewer create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--required-reviewers [email protected]Merge Strategy Policy
az repos policy merge-strategy create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--allow-squash true \
--allow-rebase true \
--allow-no-fast-forward trueCase Enforcement Policy
az repos policy case-enforcement create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id}Comment Required Policy
az repos policy comment-required create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id}File Size Policy
az repos policy file-size create \
--blocking true \
--enabled true \
--branch main \
--repository-id {repo-id} \
--maximum-file-size 10485760 # 10MB in bytesRequirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs network access, Needs a command-line tool
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- First committed by
AungMyoKyaw
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/azure-devops-cli · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- fondoger, AungMyoKyaw, KomalSrinivasan, alexvago
AutoGineer is not affiliated with or endorsed by AungMyoKyaw or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download azure-devops-cli.zip