All skills
github avatar

/azure-devops-cli

@4e8726d official
by githubgithub/awesome-copilot40k stars
5,040

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.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/azure-devops-cli

This session only. Nothing lands on disk.

referencesrepos-and-prs.md

≈1.7k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Repositories & Pull Requests

Table of Contents


Repositories

List Repositories

az repos list --org https://dev.azure.com/{org} --project {project}
az repos list --output table

Show 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} --yes

Update 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 user1@example.com user2@example.com \
  --required-reviewers lead@example.com \
  --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 table

Show PR Details

az repos pr show --id {pr-id}
az repos pr show --id {pr-id} --open  # Open in browser

Update 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 upstream

Vote 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 reset

PR Reviewers

# Add reviewers
az repos pr reviewer add --id {pr-id} --reviewers user1@example.com user2@example.com

# List reviewers
az repos pr reviewer list --id {pr-id}

# Remove reviewers
az repos pr reviewer remove --id {pr-id} --reviewers user1@example.com

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 main

Create/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} --yes

Approver 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 true

Build 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 720

Work 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 user@example.com

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 true

Case 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 bytes

Source: SKILL.md on GitHub

1 alert14d5 checks · Risk SAFE
  • Gen Agent Trust Hub14d

    The skill provides a comprehensive collection of commands and automation patterns for managing Azure DevOps resources through the Azure CLI. It includes standard installation instructions from trusted vendor sources and best practices for handling long arguments and complex queries. The analysis identified the standard attack surface for indirect prompt injection associated with processing external work items and pull requests.

  • Socket14d

    1 alert: gptAnomaly

  • Snyk14d

    Risk: MEDIUM · 1 issue

  • Runlayer6mo

    2/8 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 4e8726d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 19 hours ago.

Activeupdated 3 months ago
  • azure-devops
  • azure-cli
  • devops-automation
  • ci-cd
  • pipelines
  • repos
  • work-items
  • azure-artifacts
  • bash

README badge

README badge for github/awesome-copilot/azure-devops-cli

Manages Azure DevOps resources via the Azure CLI including projects, repositories, pipelines, builds, pull requests, work items, and service endpoints. Use when automating Azure DevOps workflows, CI/CD configuration, or resource administration through the `az devops` and `az pipelines` command families.

Generated from the current SKILL.md.

Does this skill work with the legacy Azure DevOps URL format?
The skill supports both formats but recommends the modern https://dev.azure.com/{org} URL. Legacy https://{org}.visualstudio.com URLs should be replaced with the new format.
What authentication method does this skill use?
The skill uses PAT (Personal Access Token) authentication via the az devops login command. You provide your token when logging in to your organization.
Does this cover Azure Pipelines, Repos, Boards, and Artifacts?
Yes. The skill includes commands for managing pipelines, builds, releases, repositories, pull requests, work items, iterations, and universal packages across all four services.
Can I set default organization and project to avoid repeating them in commands?
Yes. Use az devops configure --defaults to set default organization and project, which will apply to subsequent commands unless explicitly overridden.
Does this skill include scripting patterns and automation examples?
Yes. The skill includes a workflows-and-patterns reference file covering automation scripts, best practices, error handling, and real-world examples for CI/CD automation.

Generated from the current SKILL.md. These answers refresh after source changes.