Initial commit
This commit is contained in:
12
.claude-plugin/plugin.json
Normal file
12
.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "azure-devops",
|
||||
"description": "Azure DevOps CLI guidance for managing repos, pipelines, boards, and projects",
|
||||
"version": "0.1.0",
|
||||
"author": {
|
||||
"name": "Lukas Trumm",
|
||||
"email": "lukas.trumm@gmail.com"
|
||||
},
|
||||
"skills": [
|
||||
"./skills"
|
||||
]
|
||||
}
|
||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# azure-devops
|
||||
|
||||
Azure DevOps CLI guidance for managing repos, pipelines, boards, and projects
|
||||
61
plugin.lock.json
Normal file
61
plugin.lock.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"$schema": "internal://schemas/plugin.lock.v1.json",
|
||||
"pluginId": "gh:lttr/claude-marketplace:plugins/azure-devops",
|
||||
"normalized": {
|
||||
"repo": null,
|
||||
"ref": "refs/tags/v20251128.0",
|
||||
"commit": "c0bf52abe187ee72cad0567a724add6d82d6894b",
|
||||
"treeHash": "6744437f78894dc5b717bac1a80eb398abc40cd73f7b05086984d70a67c1f2e4",
|
||||
"generatedAt": "2025-11-28T10:20:22.043651Z",
|
||||
"toolVersion": "publish_plugins.py@0.2.0"
|
||||
},
|
||||
"origin": {
|
||||
"remote": "git@github.com:zhongweili/42plugin-data.git",
|
||||
"branch": "master",
|
||||
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
|
||||
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
|
||||
},
|
||||
"manifest": {
|
||||
"name": "azure-devops",
|
||||
"description": "Azure DevOps CLI guidance for managing repos, pipelines, boards, and projects",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"content": {
|
||||
"files": [
|
||||
{
|
||||
"path": "README.md",
|
||||
"sha256": "2ccd894129aad3d8e90dcb928e615ba6ed8fc9ac866881647c20939c14f87e88"
|
||||
},
|
||||
{
|
||||
"path": ".claude-plugin/plugin.json",
|
||||
"sha256": "283166b5270a0a119123fee82ad72ca9d8bc7821e6cbcebd382bd63afe352463"
|
||||
},
|
||||
{
|
||||
"path": "skills/az-cli/SKILL.md",
|
||||
"sha256": "754d1f30d9d872ac5605d1aaa1ec004b0354ffc2266381e2f0aad7e17813522b"
|
||||
},
|
||||
{
|
||||
"path": "skills/az-cli/references/repos.md",
|
||||
"sha256": "e90214f753888e558a8493b9124ea7108471bbd7ee21eb775fa4aaff7ea862b2"
|
||||
},
|
||||
{
|
||||
"path": "skills/az-cli/references/boards.md",
|
||||
"sha256": "49fce858f232daa797d346b142bb6c27e96b408ff69546b1e131422a1ecebe29"
|
||||
},
|
||||
{
|
||||
"path": "skills/az-cli/references/pipelines.md",
|
||||
"sha256": "072e249d645876cefdc856dc1633cdc19de1f00e0769c518937ebe445e45aac1"
|
||||
},
|
||||
{
|
||||
"path": "skills/az-cli/references/devops.md",
|
||||
"sha256": "70518244ff3ea7e5ee17afccd13a773551133bb5cb5e7b61e4351fffa23c7b2b"
|
||||
}
|
||||
],
|
||||
"dirSha256": "6744437f78894dc5b717bac1a80eb398abc40cd73f7b05086984d70a67c1f2e4"
|
||||
},
|
||||
"security": {
|
||||
"scannedAt": null,
|
||||
"scannerVersion": null,
|
||||
"flags": []
|
||||
}
|
||||
}
|
||||
138
skills/az-cli/SKILL.md
Normal file
138
skills/az-cli/SKILL.md
Normal file
@@ -0,0 +1,138 @@
|
||||
---
|
||||
name: az-cli
|
||||
description: This skill should be used when working with Azure DevOps from the command line. Trigger when user mentions az devops, az repos, az pipelines, az boards, or asks about managing PRs, work items, pipelines, or repositories in Azure DevOps. Also trigger for questions about Azure DevOps CLI setup, authentication, or querying work items.
|
||||
---
|
||||
|
||||
# Azure DevOps CLI
|
||||
|
||||
## Overview
|
||||
|
||||
Manage Azure DevOps resources using the `az` CLI with the `azure-devops` extension. Covers repositories, pull requests, pipelines, boards, and work items.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
```bash
|
||||
# Install azure-devops extension (requires az cli 2.30+)
|
||||
az extension add --name azure-devops
|
||||
|
||||
# Authenticate
|
||||
az login
|
||||
|
||||
# Set defaults (recommended)
|
||||
az devops configure --defaults organization=https://dev.azure.com/YOUR_ORG project=YOUR_PROJECT
|
||||
```
|
||||
|
||||
## Most-Used Commands
|
||||
|
||||
### My Pull Requests
|
||||
|
||||
```bash
|
||||
# List PRs I created
|
||||
az repos pr list --creator "$(az account show --query user.name -o tsv)"
|
||||
|
||||
# List PRs assigned to me for review
|
||||
az repos pr list --reviewer "$(az account show --query user.name -o tsv)"
|
||||
|
||||
# Show PR details
|
||||
az repos pr show --id <pr-id>
|
||||
|
||||
# Checkout PR locally
|
||||
az repos pr checkout --id <pr-id>
|
||||
```
|
||||
|
||||
### My Work Items
|
||||
|
||||
```bash
|
||||
# List work items assigned to me
|
||||
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.AssignedTo] = @Me AND [System.State] <> 'Closed' ORDER BY [System.ChangedDate] DESC"
|
||||
|
||||
# Show work item details
|
||||
az boards work-item show --id <work-item-id>
|
||||
|
||||
# Create work item
|
||||
az boards work-item create --title "Task title" --type "Task"
|
||||
|
||||
# Update work item state
|
||||
az boards work-item update --id <id> --state "In Progress"
|
||||
```
|
||||
|
||||
### Pipelines
|
||||
|
||||
```bash
|
||||
# List pipelines
|
||||
az pipelines list
|
||||
|
||||
# List recent runs
|
||||
az pipelines runs list --top 10
|
||||
|
||||
# Run a pipeline
|
||||
az pipelines run --name "pipeline-name"
|
||||
|
||||
# Run with parameters
|
||||
az pipelines run --name "pipeline-name" --parameters "env=prod version=1.0"
|
||||
|
||||
# Show run details
|
||||
az pipelines runs show --id <run-id>
|
||||
```
|
||||
|
||||
### Repositories
|
||||
|
||||
```bash
|
||||
# List repositories
|
||||
az repos list
|
||||
|
||||
# Show repo details
|
||||
az repos show --repository <repo-name>
|
||||
|
||||
# Create repository
|
||||
az repos create --name "new-repo"
|
||||
```
|
||||
|
||||
### Pull Request Workflow
|
||||
|
||||
```bash
|
||||
# Create PR
|
||||
az repos pr create --source-branch feature/my-branch --target-branch main --title "PR Title" --description "Description"
|
||||
|
||||
# Add reviewers
|
||||
az repos pr update --id <pr-id> --reviewers user@email.com
|
||||
|
||||
# Set vote (approve: 10, approve with suggestions: 5, wait: -5, reject: -10)
|
||||
az repos pr set-vote --id <pr-id> --vote 10
|
||||
|
||||
# Complete/merge PR
|
||||
az repos pr update --id <pr-id> --status completed
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
Detailed command references available:
|
||||
|
||||
- **`references/repos.md`** - Repository management, PRs, policies, refs
|
||||
- **`references/pipelines.md`** - Pipeline CRUD, runs, variables, releases
|
||||
- **`references/boards.md`** - Work items, queries, areas, iterations
|
||||
- **`references/devops.md`** - Organization, projects, teams, wikis, auth
|
||||
|
||||
## Common Flags
|
||||
|
||||
Most commands support:
|
||||
|
||||
| Flag | Description |
|
||||
| ------------------- | --------------------------------------------------- |
|
||||
| `--org` | Organization URL (or set via `az devops configure`) |
|
||||
| `--project` | Project name (or set via `az devops configure`) |
|
||||
| `--detect` | Auto-detect org/project from git remote |
|
||||
| `-o json/table/tsv` | Output format |
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
```bash
|
||||
# Check current config
|
||||
az devops configure --list
|
||||
|
||||
# Verify authentication
|
||||
az account show
|
||||
|
||||
# Check extension version
|
||||
az extension show --name azure-devops
|
||||
```
|
||||
334
skills/az-cli/references/boards.md
Normal file
334
skills/az-cli/references/boards.md
Normal file
@@ -0,0 +1,334 @@
|
||||
# Azure Boards CLI Reference
|
||||
|
||||
## Work Item Queries
|
||||
|
||||
### az boards query
|
||||
|
||||
Query work items using WIQL.
|
||||
|
||||
```bash
|
||||
# Using WIQL directly
|
||||
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.TeamProject] = @project ORDER BY [System.ChangedDate] DESC"
|
||||
|
||||
# Common query patterns:
|
||||
|
||||
# My work items
|
||||
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State], [System.WorkItemType] FROM WorkItems WHERE [System.AssignedTo] = @Me AND [System.State] <> 'Closed' ORDER BY [System.ChangedDate] DESC"
|
||||
|
||||
# Active bugs
|
||||
az boards query --wiql "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.WorkItemType] = 'Bug' AND [System.State] = 'Active'"
|
||||
|
||||
# Items in current sprint
|
||||
az boards query --wiql "SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.IterationPath] UNDER @CurrentIteration"
|
||||
|
||||
# Recently updated
|
||||
az boards query --wiql "SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.ChangedDate] >= @Today - 7 ORDER BY [System.ChangedDate] DESC"
|
||||
|
||||
# Using saved query ID
|
||||
az boards query --id <query-id>
|
||||
|
||||
# Using saved query path
|
||||
az boards query --path "Shared Queries/My Query"
|
||||
```
|
||||
|
||||
**WIQL Field References:**
|
||||
|
||||
- `[System.Id]` - Work item ID
|
||||
- `[System.Title]` - Title
|
||||
- `[System.State]` - State (New, Active, Closed, etc.)
|
||||
- `[System.AssignedTo]` - Assigned user
|
||||
- `[System.WorkItemType]` - Type (Bug, Task, User Story, etc.)
|
||||
- `[System.IterationPath]` - Sprint/iteration
|
||||
- `[System.AreaPath]` - Area path
|
||||
- `[System.Tags]` - Tags
|
||||
- `[System.ChangedDate]` - Last modified
|
||||
- `[System.CreatedDate]` - Created date
|
||||
|
||||
**WIQL Macros:**
|
||||
|
||||
- `@Me` - Current user
|
||||
- `@Today` - Today's date
|
||||
- `@CurrentIteration` - Current sprint
|
||||
- `@project` - Current project
|
||||
|
||||
## Work Items
|
||||
|
||||
### az boards work-item show
|
||||
|
||||
Show work item details.
|
||||
|
||||
```bash
|
||||
az boards work-item show --id <work-item-id> [--open] [--expand all|relations|fields]
|
||||
```
|
||||
|
||||
### az boards work-item create
|
||||
|
||||
Create a work item.
|
||||
|
||||
```bash
|
||||
# Basic creation
|
||||
az boards work-item create --title "Task title" --type "Task"
|
||||
|
||||
# With description and assignment
|
||||
az boards work-item create \
|
||||
--title "Fix login bug" \
|
||||
--type "Bug" \
|
||||
--description "Users cannot login with SSO" \
|
||||
--assigned-to user@email.com
|
||||
|
||||
# With area and iteration
|
||||
az boards work-item create \
|
||||
--title "New feature" \
|
||||
--type "User Story" \
|
||||
--area "Project\\Team" \
|
||||
--iteration "Project\\Sprint 1"
|
||||
|
||||
# With additional fields
|
||||
az boards work-item create \
|
||||
--title "Critical bug" \
|
||||
--type "Bug" \
|
||||
--fields "System.Tags=urgent;production" "Microsoft.VSTS.Common.Priority=1"
|
||||
```
|
||||
|
||||
**Common work item types:**
|
||||
|
||||
- `Task` - Development task
|
||||
- `Bug` - Bug/defect
|
||||
- `User Story` - User story (Agile)
|
||||
- `Product Backlog Item` - PBI (Scrum)
|
||||
- `Feature` - Feature
|
||||
- `Epic` - Epic
|
||||
- `Issue` - Issue (Basic process)
|
||||
|
||||
### az boards work-item update
|
||||
|
||||
Update a work item.
|
||||
|
||||
```bash
|
||||
# Update state
|
||||
az boards work-item update --id <id> --state "In Progress"
|
||||
|
||||
# Update title
|
||||
az boards work-item update --id <id> --title "New title"
|
||||
|
||||
# Update assignment
|
||||
az boards work-item update --id <id> --assigned-to user@email.com
|
||||
|
||||
# Update area/iteration
|
||||
az boards work-item update --id <id> --area "Project\\NewArea" --iteration "Project\\Sprint 2"
|
||||
|
||||
# Update multiple fields
|
||||
az boards work-item update --id <id> --fields "System.Tags=tag1;tag2" "Microsoft.VSTS.Common.Priority=2"
|
||||
|
||||
# Update description
|
||||
az boards work-item update --id <id> --description "Updated description"
|
||||
```
|
||||
|
||||
### az boards work-item delete
|
||||
|
||||
Delete a work item.
|
||||
|
||||
```bash
|
||||
az boards work-item delete --id <work-item-id> [--yes] [--destroy]
|
||||
```
|
||||
|
||||
Note: `--destroy` permanently deletes; without it, item goes to recycle bin.
|
||||
|
||||
## Work Item Relations
|
||||
|
||||
### az boards work-item relation list-type
|
||||
|
||||
List available relation types.
|
||||
|
||||
```bash
|
||||
az boards work-item relation list-type
|
||||
```
|
||||
|
||||
Common relation types:
|
||||
|
||||
- `System.LinkTypes.Hierarchy-Forward` - Parent (child -> parent)
|
||||
- `System.LinkTypes.Hierarchy-Reverse` - Child (parent -> child)
|
||||
- `System.LinkTypes.Related` - Related
|
||||
- `System.LinkTypes.Dependency-Forward` - Successor
|
||||
- `System.LinkTypes.Dependency-Reverse` - Predecessor
|
||||
|
||||
### az boards work-item relation add
|
||||
|
||||
Add a relation.
|
||||
|
||||
```bash
|
||||
# Link to parent
|
||||
az boards work-item relation add \
|
||||
--id <work-item-id> \
|
||||
--relation-type "System.LinkTypes.Hierarchy-Forward" \
|
||||
--target-id <parent-id>
|
||||
|
||||
# Add related item
|
||||
az boards work-item relation add \
|
||||
--id <work-item-id> \
|
||||
--relation-type "System.LinkTypes.Related" \
|
||||
--target-id <related-id>
|
||||
```
|
||||
|
||||
### az boards work-item relation remove
|
||||
|
||||
Remove a relation.
|
||||
|
||||
```bash
|
||||
az boards work-item relation remove \
|
||||
--id <work-item-id> \
|
||||
--relation-type "System.LinkTypes.Related" \
|
||||
--target-id <target-id>
|
||||
```
|
||||
|
||||
### az boards work-item relation show
|
||||
|
||||
Show work item relations.
|
||||
|
||||
```bash
|
||||
az boards work-item relation show --id <work-item-id>
|
||||
```
|
||||
|
||||
## Area Paths
|
||||
|
||||
### az boards area project list
|
||||
|
||||
List area paths in project.
|
||||
|
||||
```bash
|
||||
az boards area project list [--depth <n>]
|
||||
```
|
||||
|
||||
### az boards area project show
|
||||
|
||||
Show area details.
|
||||
|
||||
```bash
|
||||
az boards area project show --path "\\Project\\Area\\SubArea"
|
||||
```
|
||||
|
||||
### az boards area project create
|
||||
|
||||
Create an area path.
|
||||
|
||||
```bash
|
||||
az boards area project create --name "New Area" [--path "\\Project\\ParentArea"]
|
||||
```
|
||||
|
||||
### az boards area project delete
|
||||
|
||||
Delete an area path.
|
||||
|
||||
```bash
|
||||
az boards area project delete --path "\\Project\\Area" [--yes]
|
||||
```
|
||||
|
||||
### az boards area team list
|
||||
|
||||
List areas for a team.
|
||||
|
||||
```bash
|
||||
az boards area team list --team "Team Name"
|
||||
```
|
||||
|
||||
### az boards area team add
|
||||
|
||||
Add area to team.
|
||||
|
||||
```bash
|
||||
az boards area team add --team "Team Name" --path "\\Project\\Area" [--include-sub-areas true]
|
||||
```
|
||||
|
||||
### az boards area team remove
|
||||
|
||||
Remove area from team.
|
||||
|
||||
```bash
|
||||
az boards area team remove --team "Team Name" --path "\\Project\\Area"
|
||||
```
|
||||
|
||||
## Iteration Paths (Sprints)
|
||||
|
||||
### az boards iteration project list
|
||||
|
||||
List iterations in project.
|
||||
|
||||
```bash
|
||||
az boards iteration project list [--depth <n>]
|
||||
```
|
||||
|
||||
### az boards iteration project show
|
||||
|
||||
Show iteration details.
|
||||
|
||||
```bash
|
||||
az boards iteration project show --path "\\Project\\Sprint 1"
|
||||
```
|
||||
|
||||
### az boards iteration project create
|
||||
|
||||
Create an iteration.
|
||||
|
||||
```bash
|
||||
az boards iteration project create \
|
||||
--name "Sprint 5" \
|
||||
--path "\\Project" \
|
||||
[--start-date 2024-01-15] \
|
||||
[--finish-date 2024-01-29]
|
||||
```
|
||||
|
||||
### az boards iteration project delete
|
||||
|
||||
Delete an iteration.
|
||||
|
||||
```bash
|
||||
az boards iteration project delete --path "\\Project\\Sprint 5" [--yes]
|
||||
```
|
||||
|
||||
### az boards iteration team list
|
||||
|
||||
List team iterations.
|
||||
|
||||
```bash
|
||||
az boards iteration team list --team "Team Name"
|
||||
```
|
||||
|
||||
### az boards iteration team add
|
||||
|
||||
Add iteration to team.
|
||||
|
||||
```bash
|
||||
az boards iteration team add --team "Team Name" --id <iteration-id>
|
||||
```
|
||||
|
||||
### az boards iteration team remove
|
||||
|
||||
Remove iteration from team.
|
||||
|
||||
```bash
|
||||
az boards iteration team remove --team "Team Name" --id <iteration-id>
|
||||
```
|
||||
|
||||
### az boards iteration team list-work-items
|
||||
|
||||
List work items in iteration.
|
||||
|
||||
```bash
|
||||
az boards iteration team list-work-items --team "Team Name" --id <iteration-id>
|
||||
```
|
||||
|
||||
### az boards iteration team set-backlog-iteration
|
||||
|
||||
Set backlog iteration for team.
|
||||
|
||||
```bash
|
||||
az boards iteration team set-backlog-iteration --team "Team Name" --id <iteration-id>
|
||||
```
|
||||
|
||||
### az boards iteration team set-default-iteration
|
||||
|
||||
Set default iteration for new work items.
|
||||
|
||||
```bash
|
||||
az boards iteration team set-default-iteration --team "Team Name" --id <iteration-id>
|
||||
```
|
||||
491
skills/az-cli/references/devops.md
Normal file
491
skills/az-cli/references/devops.md
Normal file
@@ -0,0 +1,491 @@
|
||||
# Azure DevOps CLI Reference
|
||||
|
||||
## Authentication & Configuration
|
||||
|
||||
### az devops configure
|
||||
|
||||
Configure CLI defaults.
|
||||
|
||||
```bash
|
||||
# Set organization and project defaults
|
||||
az devops configure --defaults organization=https://dev.azure.com/YOUR_ORG project=YOUR_PROJECT
|
||||
|
||||
# View current configuration
|
||||
az devops configure --list
|
||||
|
||||
# Clear a default
|
||||
az devops configure --defaults project=
|
||||
```
|
||||
|
||||
### az devops login
|
||||
|
||||
Set credentials for an organization.
|
||||
|
||||
```bash
|
||||
# Interactive login (prompts for PAT)
|
||||
az devops login --organization https://dev.azure.com/YOUR_ORG
|
||||
|
||||
# Login with PAT from environment variable
|
||||
echo $AZURE_DEVOPS_EXT_PAT | az devops login --organization https://dev.azure.com/YOUR_ORG
|
||||
```
|
||||
|
||||
### az devops logout
|
||||
|
||||
Clear stored credentials.
|
||||
|
||||
```bash
|
||||
# Logout from specific org
|
||||
az devops logout --organization https://dev.azure.com/YOUR_ORG
|
||||
|
||||
# Logout from all orgs
|
||||
az devops logout
|
||||
```
|
||||
|
||||
## Projects
|
||||
|
||||
### az devops project list
|
||||
|
||||
List projects in organization.
|
||||
|
||||
```bash
|
||||
az devops project list [--top <n>] [--skip <n>] [--state all|deleting|new|wellFormed]
|
||||
```
|
||||
|
||||
### az devops project show
|
||||
|
||||
Show project details.
|
||||
|
||||
```bash
|
||||
az devops project show --project <project-name> [--open]
|
||||
```
|
||||
|
||||
### az devops project create
|
||||
|
||||
Create a new project.
|
||||
|
||||
```bash
|
||||
az devops project create \
|
||||
--name "New Project" \
|
||||
--description "Project description" \
|
||||
[--process Agile|Scrum|Basic|CMMI] \
|
||||
[--source-control git|tfvc] \
|
||||
[--visibility private|public]
|
||||
```
|
||||
|
||||
### az devops project delete
|
||||
|
||||
Delete a project.
|
||||
|
||||
```bash
|
||||
az devops project delete --id <project-id> [--yes]
|
||||
```
|
||||
|
||||
## Teams
|
||||
|
||||
### az devops team list
|
||||
|
||||
List teams in project.
|
||||
|
||||
```bash
|
||||
az devops team list [--top <n>] [--skip <n>]
|
||||
```
|
||||
|
||||
### az devops team show
|
||||
|
||||
Show team details.
|
||||
|
||||
```bash
|
||||
az devops team show --team "Team Name"
|
||||
```
|
||||
|
||||
### az devops team create
|
||||
|
||||
Create a team.
|
||||
|
||||
```bash
|
||||
az devops team create --name "New Team" [--description "Team description"]
|
||||
```
|
||||
|
||||
### az devops team delete
|
||||
|
||||
Delete a team.
|
||||
|
||||
```bash
|
||||
az devops team delete --id <team-id> [--yes]
|
||||
```
|
||||
|
||||
### az devops team update
|
||||
|
||||
Update team settings.
|
||||
|
||||
```bash
|
||||
az devops team update --team "Team Name" --name "New Team Name" --description "Updated description"
|
||||
```
|
||||
|
||||
### az devops team list-member
|
||||
|
||||
List team members.
|
||||
|
||||
```bash
|
||||
az devops team list-member --team "Team Name" [--top <n>] [--skip <n>]
|
||||
```
|
||||
|
||||
## Users
|
||||
|
||||
### az devops user list
|
||||
|
||||
List users in organization.
|
||||
|
||||
```bash
|
||||
az devops user list [--top <n>] [--skip <n>]
|
||||
```
|
||||
|
||||
### az devops user show
|
||||
|
||||
Show user details.
|
||||
|
||||
```bash
|
||||
az devops user show --user user@email.com
|
||||
```
|
||||
|
||||
### az devops user add
|
||||
|
||||
Add user to organization.
|
||||
|
||||
```bash
|
||||
az devops user add \
|
||||
--email-id user@email.com \
|
||||
--license-type express|stakeholder|basic|professional \
|
||||
[--send-email-invite true]
|
||||
```
|
||||
|
||||
### az devops user update
|
||||
|
||||
Update user license.
|
||||
|
||||
```bash
|
||||
az devops user update --user user@email.com --license-type basic
|
||||
```
|
||||
|
||||
### az devops user remove
|
||||
|
||||
Remove user from organization.
|
||||
|
||||
```bash
|
||||
az devops user remove --user user@email.com [--yes]
|
||||
```
|
||||
|
||||
## Service Endpoints (Connections)
|
||||
|
||||
### az devops service-endpoint list
|
||||
|
||||
List service connections.
|
||||
|
||||
```bash
|
||||
az devops service-endpoint list
|
||||
```
|
||||
|
||||
### az devops service-endpoint show
|
||||
|
||||
Show connection details.
|
||||
|
||||
```bash
|
||||
az devops service-endpoint show --id <endpoint-id>
|
||||
```
|
||||
|
||||
### az devops service-endpoint create
|
||||
|
||||
Create service connection (general).
|
||||
|
||||
```bash
|
||||
az devops service-endpoint create --service-endpoint-configuration <config-file>
|
||||
```
|
||||
|
||||
### az devops service-endpoint azurerm create
|
||||
|
||||
Create Azure Resource Manager connection.
|
||||
|
||||
```bash
|
||||
az devops service-endpoint azurerm create \
|
||||
--name "Azure Connection" \
|
||||
--azure-rm-service-principal-id <sp-id> \
|
||||
--azure-rm-subscription-id <sub-id> \
|
||||
--azure-rm-subscription-name "Subscription Name" \
|
||||
--azure-rm-tenant-id <tenant-id>
|
||||
```
|
||||
|
||||
### az devops service-endpoint github create
|
||||
|
||||
Create GitHub connection.
|
||||
|
||||
```bash
|
||||
az devops service-endpoint github create \
|
||||
--name "GitHub Connection" \
|
||||
--github-url https://github.com
|
||||
```
|
||||
|
||||
### az devops service-endpoint delete
|
||||
|
||||
Delete a service connection.
|
||||
|
||||
```bash
|
||||
az devops service-endpoint delete --id <endpoint-id> [--yes]
|
||||
```
|
||||
|
||||
### az devops service-endpoint update
|
||||
|
||||
Update service connection.
|
||||
|
||||
```bash
|
||||
az devops service-endpoint update --id <endpoint-id> --enable-for-all true
|
||||
```
|
||||
|
||||
## Extensions
|
||||
|
||||
### az devops extension list
|
||||
|
||||
List installed extensions.
|
||||
|
||||
```bash
|
||||
az devops extension list [--include-built-in] [--include-disabled]
|
||||
```
|
||||
|
||||
### az devops extension show
|
||||
|
||||
Show extension details.
|
||||
|
||||
```bash
|
||||
az devops extension show --extension-id <id> --publisher-id <publisher>
|
||||
```
|
||||
|
||||
### az devops extension search
|
||||
|
||||
Search marketplace extensions.
|
||||
|
||||
```bash
|
||||
az devops extension search --search-query "search term"
|
||||
```
|
||||
|
||||
### az devops extension install
|
||||
|
||||
Install an extension.
|
||||
|
||||
```bash
|
||||
az devops extension install --extension-id <id> --publisher-id <publisher>
|
||||
```
|
||||
|
||||
### az devops extension uninstall
|
||||
|
||||
Uninstall an extension.
|
||||
|
||||
```bash
|
||||
az devops extension uninstall --extension-id <id> --publisher-id <publisher> [--yes]
|
||||
```
|
||||
|
||||
### az devops extension enable/disable
|
||||
|
||||
Enable or disable an extension.
|
||||
|
||||
```bash
|
||||
az devops extension enable --extension-id <id> --publisher-id <publisher>
|
||||
az devops extension disable --extension-id <id> --publisher-id <publisher>
|
||||
```
|
||||
|
||||
## Wiki
|
||||
|
||||
### az devops wiki list
|
||||
|
||||
List wikis in project.
|
||||
|
||||
```bash
|
||||
az devops wiki list
|
||||
```
|
||||
|
||||
### az devops wiki show
|
||||
|
||||
Show wiki details.
|
||||
|
||||
```bash
|
||||
az devops wiki show --wiki <wiki-name>
|
||||
```
|
||||
|
||||
### az devops wiki create
|
||||
|
||||
Create a wiki.
|
||||
|
||||
```bash
|
||||
# Project wiki
|
||||
az devops wiki create --name "Project Wiki" --type projectWiki
|
||||
|
||||
# Code wiki (from repo)
|
||||
az devops wiki create \
|
||||
--name "Code Wiki" \
|
||||
--type codeWiki \
|
||||
--repository <repo-id> \
|
||||
--mapped-path /docs \
|
||||
--version <branch>
|
||||
```
|
||||
|
||||
### az devops wiki delete
|
||||
|
||||
Delete a wiki.
|
||||
|
||||
```bash
|
||||
az devops wiki delete --wiki <wiki-name> [--yes]
|
||||
```
|
||||
|
||||
### az devops wiki page show
|
||||
|
||||
Show wiki page.
|
||||
|
||||
```bash
|
||||
az devops wiki page show --wiki <wiki-name> --path "/Page Name"
|
||||
```
|
||||
|
||||
### az devops wiki page create
|
||||
|
||||
Create a wiki page.
|
||||
|
||||
```bash
|
||||
az devops wiki page create \
|
||||
--wiki <wiki-name> \
|
||||
--path "/New Page" \
|
||||
--content "# Page Content"
|
||||
```
|
||||
|
||||
### az devops wiki page update
|
||||
|
||||
Update a wiki page.
|
||||
|
||||
```bash
|
||||
az devops wiki page update \
|
||||
--wiki <wiki-name> \
|
||||
--path "/Page Name" \
|
||||
--content "# Updated Content" \
|
||||
--version <etag>
|
||||
```
|
||||
|
||||
### az devops wiki page delete
|
||||
|
||||
Delete a wiki page.
|
||||
|
||||
```bash
|
||||
az devops wiki page delete --wiki <wiki-name> --path "/Page Name" [--yes]
|
||||
```
|
||||
|
||||
## Security
|
||||
|
||||
### az devops security group list
|
||||
|
||||
List security groups.
|
||||
|
||||
```bash
|
||||
az devops security group list [--scope organization|project]
|
||||
```
|
||||
|
||||
### az devops security group show
|
||||
|
||||
Show group details.
|
||||
|
||||
```bash
|
||||
az devops security group show --id <group-descriptor>
|
||||
```
|
||||
|
||||
### az devops security group create
|
||||
|
||||
Create a security group.
|
||||
|
||||
```bash
|
||||
az devops security group create --name "Group Name" [--description "Description"]
|
||||
```
|
||||
|
||||
### az devops security group membership list
|
||||
|
||||
List group members.
|
||||
|
||||
```bash
|
||||
az devops security group membership list --id <group-descriptor>
|
||||
```
|
||||
|
||||
### az devops security group membership add
|
||||
|
||||
Add member to group.
|
||||
|
||||
```bash
|
||||
az devops security group membership add --group-id <group-id> --member-id <member-id>
|
||||
```
|
||||
|
||||
### az devops security permission list
|
||||
|
||||
List permissions.
|
||||
|
||||
```bash
|
||||
az devops security permission list --namespace-id <namespace-id> --token <security-token>
|
||||
```
|
||||
|
||||
## Invoke (Raw API Calls)
|
||||
|
||||
### az devops invoke
|
||||
|
||||
Make arbitrary API calls.
|
||||
|
||||
```bash
|
||||
# GET request
|
||||
az devops invoke \
|
||||
--area core \
|
||||
--resource projects \
|
||||
--api-version 6.0
|
||||
|
||||
# POST request with body
|
||||
az devops invoke \
|
||||
--area wit \
|
||||
--resource workitems \
|
||||
--route-parameters project=MyProject type=Bug \
|
||||
--http-method POST \
|
||||
--in-file body.json \
|
||||
--api-version 6.0
|
||||
|
||||
# With query parameters
|
||||
az devops invoke \
|
||||
--area core \
|
||||
--resource projects \
|
||||
--query-parameters "\$top=10" "stateFilter=wellFormed"
|
||||
```
|
||||
|
||||
## Admin (Organization Level)
|
||||
|
||||
### az devops admin banner list
|
||||
|
||||
List organization banners.
|
||||
|
||||
```bash
|
||||
az devops admin banner list
|
||||
```
|
||||
|
||||
### az devops admin banner add
|
||||
|
||||
Add an organization banner.
|
||||
|
||||
```bash
|
||||
az devops admin banner add \
|
||||
--id <banner-id> \
|
||||
--message "Important announcement" \
|
||||
--type info|warning|error \
|
||||
[--expiration 2024-12-31]
|
||||
```
|
||||
|
||||
### az devops admin banner remove
|
||||
|
||||
Remove a banner.
|
||||
|
||||
```bash
|
||||
az devops admin banner remove --id <banner-id>
|
||||
```
|
||||
|
||||
### az devops admin banner update
|
||||
|
||||
Update a banner.
|
||||
|
||||
```bash
|
||||
az devops admin banner update --id <banner-id> --message "Updated message"
|
||||
```
|
||||
369
skills/az-cli/references/pipelines.md
Normal file
369
skills/az-cli/references/pipelines.md
Normal file
@@ -0,0 +1,369 @@
|
||||
# Azure Pipelines CLI Reference
|
||||
|
||||
## Pipeline Management
|
||||
|
||||
### az pipelines list
|
||||
|
||||
List pipelines in a project.
|
||||
|
||||
```bash
|
||||
az pipelines list [--name <filter>] [--top <n>] [--org] [--project]
|
||||
```
|
||||
|
||||
### az pipelines show
|
||||
|
||||
Get pipeline details.
|
||||
|
||||
```bash
|
||||
az pipelines show --name <pipeline-name> [--open] [--org] [--project]
|
||||
az pipelines show --id <pipeline-id>
|
||||
```
|
||||
|
||||
### az pipelines create
|
||||
|
||||
Create a new YAML pipeline.
|
||||
|
||||
```bash
|
||||
az pipelines create \
|
||||
--name "My Pipeline" \
|
||||
--repository <repo-name> \
|
||||
--branch main \
|
||||
--yml-path azure-pipelines.yml \
|
||||
[--folder-path "\\folder"] \
|
||||
[--skip-first-run]
|
||||
```
|
||||
|
||||
### az pipelines update
|
||||
|
||||
Update pipeline settings.
|
||||
|
||||
```bash
|
||||
az pipelines update --id <id> --name "New Name" [--new-folder-path "\\new-folder"]
|
||||
```
|
||||
|
||||
### az pipelines delete
|
||||
|
||||
Delete a pipeline.
|
||||
|
||||
```bash
|
||||
az pipelines delete --id <pipeline-id> [--yes]
|
||||
```
|
||||
|
||||
## Running Pipelines
|
||||
|
||||
### az pipelines run
|
||||
|
||||
Queue/run a pipeline.
|
||||
|
||||
```bash
|
||||
# Simple run
|
||||
az pipelines run --name "pipeline-name"
|
||||
|
||||
# Run specific branch
|
||||
az pipelines run --name "pipeline-name" --branch feature/branch
|
||||
|
||||
# Run with parameters
|
||||
az pipelines run --name "pipeline-name" --parameters "param1=value1 param2=value2"
|
||||
|
||||
# Run with variables
|
||||
az pipelines run --name "pipeline-name" --variables "var1=value1 var2=value2"
|
||||
|
||||
# Run by ID
|
||||
az pipelines run --id <pipeline-id>
|
||||
```
|
||||
|
||||
## Pipeline Runs
|
||||
|
||||
### az pipelines runs list
|
||||
|
||||
List pipeline runs.
|
||||
|
||||
```bash
|
||||
# Recent runs
|
||||
az pipelines runs list --top 10
|
||||
|
||||
# Filter by pipeline
|
||||
az pipelines runs list --pipeline-ids <id>
|
||||
|
||||
# Filter by status
|
||||
az pipelines runs list --status completed|inProgress|notStarted|cancelling
|
||||
|
||||
# Filter by result
|
||||
az pipelines runs list --result succeeded|failed|canceled
|
||||
|
||||
# Filter by branch
|
||||
az pipelines runs list --branch refs/heads/main
|
||||
```
|
||||
|
||||
### az pipelines runs show
|
||||
|
||||
Show run details.
|
||||
|
||||
```bash
|
||||
az pipelines runs show --id <run-id> [--open]
|
||||
```
|
||||
|
||||
## Run Artifacts
|
||||
|
||||
### az pipelines runs artifact list
|
||||
|
||||
List artifacts from a run.
|
||||
|
||||
```bash
|
||||
az pipelines runs artifact list --run-id <id>
|
||||
```
|
||||
|
||||
### az pipelines runs artifact download
|
||||
|
||||
Download an artifact.
|
||||
|
||||
```bash
|
||||
az pipelines runs artifact download --run-id <id> --artifact-name <name> --path <download-path>
|
||||
```
|
||||
|
||||
## Run Tags
|
||||
|
||||
### az pipelines runs tag list
|
||||
|
||||
List tags on a run.
|
||||
|
||||
```bash
|
||||
az pipelines runs tag list --run-id <id>
|
||||
```
|
||||
|
||||
### az pipelines runs tag add
|
||||
|
||||
Add tag to a run.
|
||||
|
||||
```bash
|
||||
az pipelines runs tag add --run-id <id> --tags "tag1" "tag2"
|
||||
```
|
||||
|
||||
## Builds (Classic)
|
||||
|
||||
### az pipelines build list
|
||||
|
||||
List builds.
|
||||
|
||||
```bash
|
||||
az pipelines build list [--definition-ids <id>] [--top <n>]
|
||||
```
|
||||
|
||||
### az pipelines build show
|
||||
|
||||
Show build details.
|
||||
|
||||
```bash
|
||||
az pipelines build show --id <build-id>
|
||||
```
|
||||
|
||||
### az pipelines build cancel
|
||||
|
||||
Cancel a running build.
|
||||
|
||||
```bash
|
||||
az pipelines build cancel --id <build-id>
|
||||
```
|
||||
|
||||
## Pipeline Variables
|
||||
|
||||
### az pipelines variable list
|
||||
|
||||
List pipeline variables.
|
||||
|
||||
```bash
|
||||
az pipelines variable list --pipeline-name <name>
|
||||
az pipelines variable list --pipeline-id <id>
|
||||
```
|
||||
|
||||
### az pipelines variable create
|
||||
|
||||
Create a variable.
|
||||
|
||||
```bash
|
||||
az pipelines variable create \
|
||||
--pipeline-name <name> \
|
||||
--name <var-name> \
|
||||
--value <value> \
|
||||
[--secret true] \
|
||||
[--allow-override true]
|
||||
```
|
||||
|
||||
### az pipelines variable update
|
||||
|
||||
Update a variable.
|
||||
|
||||
```bash
|
||||
az pipelines variable update \
|
||||
--pipeline-name <name> \
|
||||
--name <var-name> \
|
||||
--value <new-value>
|
||||
```
|
||||
|
||||
### az pipelines variable delete
|
||||
|
||||
Delete a variable.
|
||||
|
||||
```bash
|
||||
az pipelines variable delete --pipeline-name <name> --name <var-name> [--yes]
|
||||
```
|
||||
|
||||
## Variable Groups
|
||||
|
||||
### az pipelines variable-group list
|
||||
|
||||
List variable groups.
|
||||
|
||||
```bash
|
||||
az pipelines variable-group list [--group-name <filter>]
|
||||
```
|
||||
|
||||
### az pipelines variable-group show
|
||||
|
||||
Show variable group details.
|
||||
|
||||
```bash
|
||||
az pipelines variable-group show --id <group-id>
|
||||
az pipelines variable-group show --group-name <name>
|
||||
```
|
||||
|
||||
### az pipelines variable-group create
|
||||
|
||||
Create a variable group.
|
||||
|
||||
```bash
|
||||
az pipelines variable-group create \
|
||||
--name "My Variables" \
|
||||
--variables "var1=value1" "var2=value2" \
|
||||
[--authorize true]
|
||||
```
|
||||
|
||||
### az pipelines variable-group variable list
|
||||
|
||||
List variables in a group.
|
||||
|
||||
```bash
|
||||
az pipelines variable-group variable list --group-id <id>
|
||||
```
|
||||
|
||||
### az pipelines variable-group variable create
|
||||
|
||||
Add variable to group.
|
||||
|
||||
```bash
|
||||
az pipelines variable-group variable create \
|
||||
--group-id <id> \
|
||||
--name <var-name> \
|
||||
--value <value> \
|
||||
[--secret true]
|
||||
```
|
||||
|
||||
## Pipeline Folders
|
||||
|
||||
### az pipelines folder list
|
||||
|
||||
List folders.
|
||||
|
||||
```bash
|
||||
az pipelines folder list [--path "\\"]
|
||||
```
|
||||
|
||||
### az pipelines folder create
|
||||
|
||||
Create a folder.
|
||||
|
||||
```bash
|
||||
az pipelines folder create --path "\\folder\\subfolder"
|
||||
```
|
||||
|
||||
### az pipelines folder delete
|
||||
|
||||
Delete a folder.
|
||||
|
||||
```bash
|
||||
az pipelines folder delete --path "\\folder" [--yes]
|
||||
```
|
||||
|
||||
## Agents and Pools
|
||||
|
||||
### az pipelines agent list
|
||||
|
||||
List agents in a pool.
|
||||
|
||||
```bash
|
||||
az pipelines agent list --pool-id <id>
|
||||
```
|
||||
|
||||
### az pipelines agent show
|
||||
|
||||
Show agent details.
|
||||
|
||||
```bash
|
||||
az pipelines agent show --pool-id <id> --agent-id <id>
|
||||
```
|
||||
|
||||
### az pipelines pool list
|
||||
|
||||
List agent pools.
|
||||
|
||||
```bash
|
||||
az pipelines pool list [--pool-name <filter>]
|
||||
```
|
||||
|
||||
### az pipelines pool show
|
||||
|
||||
Show pool details.
|
||||
|
||||
```bash
|
||||
az pipelines pool show --id <pool-id>
|
||||
```
|
||||
|
||||
### az pipelines queue list
|
||||
|
||||
List agent queues.
|
||||
|
||||
```bash
|
||||
az pipelines queue list [--queue-name <filter>]
|
||||
```
|
||||
|
||||
## Releases (Classic)
|
||||
|
||||
### az pipelines release list
|
||||
|
||||
List releases.
|
||||
|
||||
```bash
|
||||
az pipelines release list [--definition-id <id>] [--top <n>]
|
||||
```
|
||||
|
||||
### az pipelines release show
|
||||
|
||||
Show release details.
|
||||
|
||||
```bash
|
||||
az pipelines release show --id <release-id>
|
||||
```
|
||||
|
||||
### az pipelines release create
|
||||
|
||||
Create a release.
|
||||
|
||||
```bash
|
||||
az pipelines release create --definition-id <id> [--description "Release notes"]
|
||||
```
|
||||
|
||||
### az pipelines release-definition list
|
||||
|
||||
List release definitions.
|
||||
|
||||
```bash
|
||||
az pipelines release-definition list [--name <filter>]
|
||||
```
|
||||
|
||||
### az pipelines release-definition show
|
||||
|
||||
Show release definition.
|
||||
|
||||
```bash
|
||||
az pipelines release-definition show --id <id>
|
||||
```
|
||||
274
skills/az-cli/references/repos.md
Normal file
274
skills/az-cli/references/repos.md
Normal file
@@ -0,0 +1,274 @@
|
||||
# Azure Repos CLI Reference
|
||||
|
||||
## Repository Management
|
||||
|
||||
### az repos list
|
||||
|
||||
List repositories in a project.
|
||||
|
||||
```bash
|
||||
az repos list [--org] [--project] [--detect {false,true}]
|
||||
```
|
||||
|
||||
### az repos show
|
||||
|
||||
Get repository details.
|
||||
|
||||
```bash
|
||||
az repos show --repository <name-or-id> [--open] [--org] [--project]
|
||||
```
|
||||
|
||||
### az repos create
|
||||
|
||||
Create a new repository.
|
||||
|
||||
```bash
|
||||
az repos create --name <repo-name> [--org] [--project] [--open]
|
||||
```
|
||||
|
||||
### az repos delete
|
||||
|
||||
Delete a repository.
|
||||
|
||||
```bash
|
||||
az repos delete --id <repo-id> [--yes] [--org] [--project]
|
||||
```
|
||||
|
||||
### az repos update
|
||||
|
||||
Update repository settings.
|
||||
|
||||
```bash
|
||||
az repos update --repository <name-or-id> --name <new-name> [--default-branch <branch>]
|
||||
```
|
||||
|
||||
## Pull Requests
|
||||
|
||||
### az repos pr list
|
||||
|
||||
List pull requests.
|
||||
|
||||
```bash
|
||||
# All open PRs
|
||||
az repos pr list
|
||||
|
||||
# Filter by creator
|
||||
az repos pr list --creator <email-or-name>
|
||||
|
||||
# Filter by reviewer
|
||||
az repos pr list --reviewer <email-or-name>
|
||||
|
||||
# Filter by status
|
||||
az repos pr list --status active|completed|abandoned|all
|
||||
|
||||
# Filter by source/target branch
|
||||
az repos pr list --source-branch <branch> --target-branch <branch>
|
||||
|
||||
# Limit results
|
||||
az repos pr list --top 10 --skip 0
|
||||
```
|
||||
|
||||
### az repos pr show
|
||||
|
||||
Show PR details.
|
||||
|
||||
```bash
|
||||
az repos pr show --id <pr-id> [--open]
|
||||
```
|
||||
|
||||
### az repos pr create
|
||||
|
||||
Create a pull request.
|
||||
|
||||
```bash
|
||||
az repos pr create \
|
||||
--source-branch <branch> \
|
||||
--target-branch <branch> \
|
||||
--title "PR Title" \
|
||||
--description "Description" \
|
||||
[--reviewers user1@email.com user2@email.com] \
|
||||
[--work-items 123 456] \
|
||||
[--draft] \
|
||||
[--auto-complete] \
|
||||
[--squash] \
|
||||
[--delete-source-branch]
|
||||
```
|
||||
|
||||
### az repos pr update
|
||||
|
||||
Update a pull request.
|
||||
|
||||
```bash
|
||||
# Update title/description
|
||||
az repos pr update --id <pr-id> --title "New Title" --description "New desc"
|
||||
|
||||
# Add reviewers
|
||||
az repos pr update --id <pr-id> --reviewers user@email.com
|
||||
|
||||
# Set auto-complete
|
||||
az repos pr update --id <pr-id> --auto-complete true
|
||||
|
||||
# Complete (merge) PR
|
||||
az repos pr update --id <pr-id> --status completed
|
||||
|
||||
# Abandon PR
|
||||
az repos pr update --id <pr-id> --status abandoned
|
||||
```
|
||||
|
||||
### az repos pr set-vote
|
||||
|
||||
Vote on a pull request.
|
||||
|
||||
```bash
|
||||
# Vote values:
|
||||
# 10 = approve
|
||||
# 5 = approve with suggestions
|
||||
# 0 = no vote
|
||||
# -5 = wait for author
|
||||
# -10 = reject
|
||||
|
||||
az repos pr set-vote --id <pr-id> --vote 10
|
||||
```
|
||||
|
||||
### az repos pr checkout
|
||||
|
||||
Checkout PR branch locally.
|
||||
|
||||
```bash
|
||||
az repos pr checkout --id <pr-id>
|
||||
```
|
||||
|
||||
## PR Reviewers
|
||||
|
||||
### az repos pr reviewer list
|
||||
|
||||
List PR reviewers.
|
||||
|
||||
```bash
|
||||
az repos pr reviewer list --id <pr-id>
|
||||
```
|
||||
|
||||
### az repos pr reviewer add
|
||||
|
||||
Add reviewers.
|
||||
|
||||
```bash
|
||||
az repos pr reviewer add --id <pr-id> --reviewers user@email.com
|
||||
```
|
||||
|
||||
### az repos pr reviewer remove
|
||||
|
||||
Remove a reviewer.
|
||||
|
||||
```bash
|
||||
az repos pr reviewer remove --id <pr-id> --reviewer user@email.com
|
||||
```
|
||||
|
||||
## PR Work Items
|
||||
|
||||
### az repos pr work-item list
|
||||
|
||||
List linked work items.
|
||||
|
||||
```bash
|
||||
az repos pr work-item list --id <pr-id>
|
||||
```
|
||||
|
||||
### az repos pr work-item add
|
||||
|
||||
Link work item to PR.
|
||||
|
||||
```bash
|
||||
az repos pr work-item add --id <pr-id> --work-items 123 456
|
||||
```
|
||||
|
||||
### az repos pr work-item remove
|
||||
|
||||
Unlink work item.
|
||||
|
||||
```bash
|
||||
az repos pr work-item remove --id <pr-id> --work-items 123
|
||||
```
|
||||
|
||||
## Branch Policies
|
||||
|
||||
### az repos policy list
|
||||
|
||||
List branch policies.
|
||||
|
||||
```bash
|
||||
az repos policy list --repository <repo> --branch <branch>
|
||||
```
|
||||
|
||||
### az repos policy create
|
||||
|
||||
Create a policy (various types available).
|
||||
|
||||
```bash
|
||||
# Require minimum reviewers
|
||||
az repos policy approver-count create \
|
||||
--repository <repo> \
|
||||
--branch main \
|
||||
--minimum-approver-count 2 \
|
||||
--creator-vote-counts false \
|
||||
--enabled true \
|
||||
--blocking true
|
||||
|
||||
# Require linked work items
|
||||
az repos policy work-item-linking create \
|
||||
--repository <repo> \
|
||||
--branch main \
|
||||
--enabled true \
|
||||
--blocking true
|
||||
|
||||
# Build validation
|
||||
az repos policy build create \
|
||||
--repository <repo> \
|
||||
--branch main \
|
||||
--build-definition-id <id> \
|
||||
--enabled true \
|
||||
--blocking true
|
||||
```
|
||||
|
||||
## Git References
|
||||
|
||||
### az repos ref list
|
||||
|
||||
List branches and tags.
|
||||
|
||||
```bash
|
||||
az repos ref list --repository <repo> [--filter heads/] [--filter tags/]
|
||||
```
|
||||
|
||||
### az repos ref create
|
||||
|
||||
Create a branch or tag.
|
||||
|
||||
```bash
|
||||
az repos ref create \
|
||||
--name refs/heads/new-branch \
|
||||
--repository <repo> \
|
||||
--object-id <commit-sha>
|
||||
```
|
||||
|
||||
### az repos ref delete
|
||||
|
||||
Delete a branch or tag.
|
||||
|
||||
```bash
|
||||
az repos ref delete --name refs/heads/branch-name --repository <repo> --object-id <sha>
|
||||
```
|
||||
|
||||
## Import Repository
|
||||
|
||||
### az repos import create
|
||||
|
||||
Import a repository from external source.
|
||||
|
||||
```bash
|
||||
az repos import create \
|
||||
--git-source-url https://github.com/user/repo.git \
|
||||
--repository <target-repo-name> \
|
||||
[--requires-authorization] \
|
||||
[--user-name <git-username>]
|
||||
```
|
||||
Reference in New Issue
Block a user