Azure DevOps Hour 1: Core Fundamentals
- Explain the Azure DevOps Services and Azure DevOps Server differences, draw the “organization → project → team” hierarchy, know what each of the five services (Boards / Repos / Pipelines / Test Plans / Artifacts) is for, and know when to choose GitHub, when to choose Azure DevOps, and when to combine the two.
- Understand security groups, permission states (Allow / Deny / Not set / inherited / system), organization-level and project-level built-in groups, and be able to derive a user's effective permissions on any object the way the Azure DevOps permission engine does, and verify with the “Why?” trace and the CLI.
- Distinguish access levels (Stakeholder / Basic / Basic + Test Plans) from permissions, work out per-user billing and the cost of parallel jobs , and use Entra group rules to assign licenses in bulk.
- For a team, choose a process template (Basic / Agile / Scrum / CMMI), customize safely with inherited processes, and set up area paths, iteration paths, backlogs, sprints, queries and boards.
- Configure branch policies on Azure Repos (minimum reviewers, linked work items, comment resolution, merge types, build validation), and use PRs to tie code to work items.
- Script all of the above with
az devopsthe CLI and REST API (PAT and Microsoft Entra token authentication), and close the team collaboration loop with Wiki, dashboards and service hooks.
Hour 1 time allocation
| # | Time | Module | Core content | Animations / interactions | Lab (project myapp-lab) |
|---|---|---|---|---|---|
| 0 | Before class | Environment setup | Create a free organization and project myapp-lab, install the Azure CLI + azure-devops extension, and import the myapp repository | Environment self-check list | az devops project show Success |
| 1 | 00–06 | Platform overview and architecture | Services vs Server, organization/project/team, the five services, relationship with GitHub and how to choose, retirement of public projects | Selection decision tool | Browse organization and project structure |
| 2 | 06–14 | Organizations, projects, security groups and permissions | Permission states, group and object inheritance, deny precedence, built-in groups, effective permission evaluation, Why? tracing | Core animation: permission evaluation engine | Create custom groups, explicit deny, verify |
| 3 | 14–20 | Access levels, licensing and billing | Stakeholder / Basic / Basic + Test Plans, first 5 free, parallel jobs, Entra group rules | Cost calculator | Add Stakeholder users, group rules |
| 4 | 20–28 | Azure Boards | Four processes, inherited processes, work item hierarchy, area/iteration paths, backlogs, sprints, queries (WIQL), boards | Work item state transitions and board column mapping | Create areas, iterations, user stories, tasks |
| 5 | 28–36 | Azure Repos | Branch policies, PR lifecycle, merge types, linking work items with AB#, auto-complete | PR policy evaluator | Add a policy to main and complete a PR |
| 6 | 36–43 | az devops CLI and REST API | PAT vs Entra tokens,az boards/repos/pipelines,az devops invoke, api-version rules | Full path of a single REST request | CLI and curl dual-track queries |
| 7 | 43–50 | Wiki, dashboards and service hooks | Project Wiki vs code Wiki, dashboards and widgets, service hook subscriptions and delivery | Service hook delivery and retries | Create a Wiki, Webhook subscription |
| 8 | 50–60 | Collaboration readiness review and troubleshooting basics | 12-item readiness review, TF401027/403, project not found, insufficient license, invalid PAT | Interactive troubleshooting tree | Deliberately create 3 errors and fix them |
| — | After class | Cheat sheet · Capstone lab | Build a project from scratch with the CLI and verify with REST | Final quiz (12 questions) | Capstone lab |
Knowledge Coverage Matrix
| Target skill | M1 | M2 | M3 | M4 | M5 | M6 | M7 | M8 | Key commands | Lab |
|---|---|---|---|---|---|---|---|---|---|---|
| Explain platform hierarchy and service roles | ✓ | ✓ | · | · | · | · | · | ✓ | az devops project list | Modules 0, M1 |
| Azure DevOps vs GitHub selection | ✓ | · | ✓ | · | ✓ | · | · | · | — | Selection decision tool |
| Derive effective permissions (inheritance / deny precedence) | · | ✓ | · | ✓ | ✓ | ✓ | · | ✓ | az devops security permission show | M2 lab |
| Manage security groups and members | · | ✓ | ✓ | · | · | ✓ | · | ✓ | az devops security group | M2, capstone lab |
| Access levels, licensing and cost | · | · | ✓ | · | · | ✓ | · | ✓ | az devops user add/update | M3 lab |
| Process templates and work item tracking | · | · | · | ✓ | ✓ | ✓ | ✓ | · | az boards work-item/area/iteration | M4, capstone lab |
| Branch policies and PRs | · | ✓ | · | · | ✓ | ✓ | · | ✓ | az repos policy,az repos pr | M5, capstone lab |
| CLI / REST automation and authentication | · | · | · | · | · | ✓ | ✓ | ✓ | az devops invoke,curl | M6, capstone lab |
| Wiki, dashboards, service hooks | · | · | · | · | · | ✓ | ✓ | · | az devops wiki,az devops invoke --area hooks | M7 lab |
| Collaboration troubleshooting | · | ✓ | ✓ | · | ✓ | ✓ | · | ✓ | --debug, Why?, audit logs | M8 troubleshooting tree |
Topics excluded from this lesson (and where to learn them)
| Topic | Why it is not in this lesson | Where to learn it |
|---|---|---|
| Git object model, SSH/HTTPS/GCM authentication, Git-side limits of Azure Repos (250 GB repositories, 5 GB per push, SSH supports RSA only) | Already covered in the Git course, not repeated | Git course, Lesson 3 |
| YAML pipelines, triggers, agents and agent pools | Core of Azure Pipelines | Lesson 2 |
| Service connections, workload identity federation, deployment to Azure / AWS | Requires a cloud subscription and more time | Lessons 3, 4 |
| Templates, extends, protected resources, approvals and checks | Part of pipeline governance | Lessons 5, 6 |
| Manual and exploratory testing details in Azure Test Plans | Requires the Basic + Test Plans license ($52/user/month) | Official Test Plans documentation |
| Azure Artifacts feeds, upstream sources, package retention | Fits more naturally alongside pipelines | Lessons 2, 5 |
| GitHub Advanced Security for Azure DevOps, audit streaming | Part of security and compliance | Lessons 6, 7 |
How to use this courseware
Principles · diagrams · animations · commands · labs · production cases · troubleshooting · quizzes · narration · video. Read “Principles” and “Animations” first, then do the “Lab”. The permission evaluation animation in Module 2 is the core of this lesson.
A quiz score of ≥ 70% or clicking “Mark this module complete” counts toward progress, saved in this browser (if the browser blocks local storage, progress is cleared on refresh).
The “Narration” page reads the script aloud with the browser's built-in Web Speech API (en-US); without a Chinese voice pack the script can still be read, or passed to a TTS tool.
api-version=7.1 (GA); for preview features, use 7.2-preview.N. Public projects have been retired: new public projects can no longer be created, existing public projects will become private starting in 2027, so this lesson explains permissions and licensing entirely for private projects. Prices follow the official pricing page ; the figures in this lesson are the USD prices as of 2026-11.Module 0 · Environment setup (complete before class)
- A Microsoft account (personal outlook.com etc.) or a Microsoft Entra ID work account. An organization created with a work account is automatically connected to that Entra tenant, which the “group rules” lab later requires.
- A workstation with Git 2.4x (Windows 11 / macOS / Ubuntu 24.04 all work) with access to
dev.azure.com. - (Optional) an Azure subscription: only needed if you want to enable the free parallel jobs for Microsoft-hosted agents (needed from Lesson 2 onward) or buy additional licenses; the labs in this lesson do not need it.
- Completed Docker course 's myapp (Python Flask + gunicorn + Redis,
/healthz) is better; if you don't have one, a minimal version is given below.
Step 1: Create a free organization
https://dev.azure.com → Start free, sign in with your account. On first sign-in you confirm the organization name (globally unique; it forms https://dev.azure.com/{organization-name}) and the hosting region (geographic location, which determines data residency; choose the region closest to your team, e.g. Canada / United States). In this lesson the organization name is written as $ORG, for example contoso-lab.Step 2: Create project myapp-lab
Web: organization home page → New project → Name myapp-lab, Visibility Private, Advanced → Version control Git, Work item process Agile (Module 4 explains why this one). You can also create it with a command once the CLI is installed in step 3:
az devops project create --name myapp-lab \ --description "Azure DevOps 8h course lab" \ --visibility private --source-control git --process Agile \ --org https://dev.azure.com/$ORG
Step 3: Install the Azure CLI and the azure-devops extension
winget install --exact --id Microsoft.AzureCLI # Reopen the terminal az version
# Ubuntu: Microsoft's official one-line script (requires sudo) curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash # macOS brew update && brew install azure-cli az version
az extension add --name azure-devops # If already installed, use az extension update --name azure-devops az extension show --name azure-devops --query version -o tsv # Sign in: preferably interactive sign-in with Microsoft Entra / Microsoft account (az devops commands reuse the az login token) az login --allow-no-subscriptions # Without an Azure subscription, --allow-no-subscriptions is required # Set the default organization and project; later commands then need no --org / --project az devops configure --defaults organization=https://dev.azure.com/$ORG project=myapp-lab az devops configure --list
1.0.11 [defaults] organization = https://dev.azure.com/contoso-lab project = myapp-lab
az devops login --organization https://dev.azure.com/$ORG then paste the PAT, or set an environment variable AZURE_DEVOPS_EXT_PAT. For PAT risks and alternatives, see Module 6.Step 4: Import the myapp repository
A new project automatically creates an empty repository with the same name as the project myapp-lab. We create another myapp repository and import the code:
# Option A: import from your myapp repository on GitHub (a public repository needs no credentials)
az repos create --name myapp
az repos import create --git-source-url https://github.com/<your-account>/myapp.git --repository myapp
# Option B: if no existing repository is available locally, create a minimal myapp and push it
mkdir myapp && cd myapp && git init -b main
cat > app.py <<'EOF'
import os, redis
from flask import Flask
app = Flask(__name__)
r = redis.Redis(host=os.getenv("REDIS_HOST", "redis"), port=6379)
@app.get("/")
def index():
return f"Hello from myapp, visits={r.incr('hits')}\n"
@app.get("/healthz")
def healthz():
return "ok\n"
EOF
printf 'flask==3.1.*\ngunicorn==23.*\nredis==5.*\n' > requirements.txt
git add . && git commit -m "myapp: minimal Flask + Redis"
git remote add origin "$(az repos show --repository myapp --query remoteUrl -o tsv)"
git push -u origin main
{
"repository": { "name": "myapp", ... },
"status": "completed"
}
To import a private GitHub repository, add --requires-authorization, and provide the source-side token through AZURE_DEVOPS_EXT_GIT_SOURCE_PASSWORD_OR_PAT an environment variable. The import is a one-time copy and does not stay in sync. For Git authentication when pushing (GCM uses OAuth tokens by default), see Git course, Lesson 3.
Step 5: Verify
az devops project show --project myapp-lab --query "{name:name, visibility:visibility, process:capabilities.processTemplate.templateName}" -o table
az repos list --query "[].{name:name, defaultBranch:defaultBranch, size:size}" -o table
Name Visibility Process --------- ------------ --------- myapp-lab private Agile Name DefaultBranch Size --------- --------------- ------ myapp refs/heads/main 2817 myapp-lab 0
Environment self-check list
Module 1 · Azure DevOps platform overview and architecture
- Distinguish Azure DevOps Services (SaaS) from Azure DevOps Server (self-hosted), and know how the two differ in identity, update cadence and licensing.
- Draw the organization (equivalent to a project collection in the on-premises version) → project → team three-level structure, and explain which settings belong at which level.
- Explain the roles of Boards / Repos / Pipelines / Test Plans / Artifacts, and justify a GitHub, Azure DevOps or hybrid choice for a team.
What: what Azure DevOps is
Azure DevOps is Microsoft's integrated software delivery platform, made up of five services that can each be enabled or disabled separately: Azure Boards (work tracking),Azure Repos (Git and TFVC code hosting),Azure Pipelines (CI/CD),Azure Test Plans (manual and exploratory testing),Azure Artifacts (feeds for NuGet, npm, Maven, Python, Cargo and generic packages). Its predecessors were Team Foundation Server (TFS) and Visual Studio Team Services (VSTS); it was renamed to its current name in 2018.
| Azure DevOps Services | Azure DevOps Server | |
|---|---|---|
| Deployment | Microsoft-hosted SaaS, entry point https://dev.azure.com/{org} (legacy address {org}.visualstudio.com still works) | Your own Windows Server + SQL Server, entry point https://server/{collection} |
| Top-level container | Organization | Project collection; there can be several |
| Identity | Microsoft account or Microsoft Entra ID | Active Directory / workgroup accounts |
| Updates | Rolling release about every three weeks (one sprint), with release notes | Installed and patched by version: the latest is Azure DevOps Server (25H2, RTW 2025-12, Patch 9 in 2026-10) |
| Process customization | Inherited process | Inherited process or on-premises XML process model |
| Licensing | Billed monthly per user + parallel jobs, paid through an Azure subscription | Server license + client access licenses (CAL); self-hosted parallel jobs are not charged extra |
| Best for | Most teams; needs zero operations and automatically receives new features | Data must stay in an in-house datacenter, on an isolated network, with strict regulatory requirements |
Why: why there are three levels, “organization / project / team”
- Organization is the boundary for billing, identity (which Entra tenant is connected), organization-level policies, parallel jobs, extensions, agent pools and process templates. All projects share these.
- Project is the main boundary for security and data: repositories, pipelines, work items, Wiki, service connections, and area and iteration paths all belong to a project. Cross-project work item links and queries are possible, but permissions are usually granted per project.
- Team is not a security boundary but a “view and cadence”: each team has its own area paths (which work items it sees), iterations (which sprints it takes part in), backlogs, boards, dashboards and notifications. Creating a team also creates a security group of the same name (
[myapp-lab]\web Team), which by default is a member of Contributors.
How: how a request is located inside the platform
When accessing https://dev.azure.com/contoso-lab/myapp-lab/_workitems/edit/42 , the following happens: (1) the global entry point finds the service instance in the geographic location of the organization from the first segment of the URL; (2) the identity is verified (browser session, Entra token or PAT); (3) it checks that the identity is a valid user of the organization (Project Collection Valid Users) and its access level; (4) it finds the project by name and checks View project-level information; (5) it finds the area path of work item 42 and checks View work items in this node; (6) it returns the data. The Module 2 animation expands on the permission evaluation in steps 3–5.
Where the five services fit
| Service | Problem it solves | Core objects | Common alternatives / comparisons | Where it is covered in this course |
|---|---|---|---|---|
| Boards | Requirements, defects, sprint plans, boards, delivery plans | Work items, area/iteration paths, queries | GitHub Issues + Projects, Jira | Module 4 |
| Repos | Private Git repositories (unlimited number), PRs, branch policies; legacy TFVC | Repositories, branches, PRs, policies | GitHub, GitLab | Module 5; Git side covered in the Git course |
| Pipelines | CI/CD; can build Azure Repos, GitHub, Bitbucket and other repositories | Pipelines, stages, jobs, agent pools, environments | GitHub Actions, Jenkins | Lessons 2–7 |
| Test Plans | Manual test cases, test suites, exploratory testing | Test plans, suites, cases, runs | TestRail, Xray | Requires Basic + Test Plans |
| Artifacts | Private package feeds, upstream source caching | Feeds, views, upstream sources | GitHub Packages, JFrog | Lessons 2, 5 |
When: relationship with GitHub and selection
GitHub and Azure DevOps both belong to Microsoft. Microsoft's official position is that new developer-experience investment mainly goes to GitHub, Azure DevOps continues to receive support and feature updates, and the two are deeply integrated: Azure Boards can connect to GitHub repositories (writing AB#123 in a commit or PR description links the work item), and Azure Pipelines can build GitHub repositories,GitHub Enterprise users automatically get Basic access to Azure DevOps (the “GitHub Enterprise” access level, equivalent to Basic).
| Leaning toward Azure DevOps | Leaning toward GitHub | Common hybrid setups |
|---|---|---|
| Need for hierarchical requirements management (Epic → Feature → Story → Task), formal processes such as CMMI, delivery plans; large amounts of TFVC or classic release assets; must be self-hosted (Server); manual testing with Test Plans | Open source and inner source, developer experience, native Copilot and Advanced Security experience, Actions marketplace, Codespaces | Code and Actions on GitHub, planning in Azure Boards; or code on GitHub and deployment with Azure Pipelines approvals and environments |
Migration path: GitHub Enterprise Importer can move code, PRs and branch policies from Azure Repos to GitHub Enterprise Cloud, but it does not migrate pipelines or LFS objects; a separate guide, “Migrating public projects to GitHub”, is in the public project retirement documentation.
Architecture diagram: organization, projects, teams and the five services
Workflow diagram: how the five services hand off from requirements to release
Step-by-step animation: how a Web/REST request is routed and authorized
Using GET https://dev.azure.com/contoso-lab/myapp-lab/_apis/wit/workitems/42?api-version=7.1 as the example. Each step highlights the matching component; the terminal below shows the real observable effects (HTTP status codes, response headers, error messages).
Interactive: GitHub or Azure DevOps?
Tick the team's actual constraints; the right side gives a recommendation and reasons (based on the official positioning in the “When” section of this module).
Command table
| Command | Purpose | Key parameters |
|---|---|---|
az devops project list | List projects in the organization | --state-filter,--top |
az devops project show | view project details (process, visibility, default team) | --project |
az devops team list / create | list / create teams | --name,--description |
az devops team list-member | list team members | --team |
az devops invoke --area core --resource projects | call REST resources directly (anything the CLI does not wrap) | --route-parameters,--api-version |
az devops extension list | list Marketplace extensions installed in the organization | --include-built-in |
az devops project list --query "value[].{name:name, visibility:visibility, lastUpdate:lastUpdateTime}" -o table
az devops project show --project myapp-lab --query "{id:id, defaultTeam:defaultTeam.name, process:capabilities.processTemplate.templateName, vc:capabilities.versioncontrol.sourceControlType}"
az devops team list --query "[].{name:name, id:id}" -o table
Name Visibility LastUpdate
--------- ------------ ----------------------------
myapp-lab private 2026-11-15T08:12:40.1+00:00
{
"defaultTeam": "myapp-lab Team",
"id": "8c0e6c5d-3f0a-4b9e-9a39-6a6bb1a7b0f1",
"process": "Agile",
"vc": "Git"
}
Name Id
-------------- ------------------------------------
myapp-lab Team 0b5e1d1e-6b4c-4d6e-8a5e-7c2c1f0d9a11
How to verify: In the web UI, Project settings → Overview should show the same process and visibility. Common errors: Empty result: the default organization is wrong, or you have no project permissions in that organization (see Module 8). Production use: Export the project list and last-updated dates each week, and archive projects that have been unused for a long time.
Turn off unused services (less noise and attack surface)
# Web: Project settings → Overview → Azure DevOps services → turn off Test Plans / Artifacts # There is no dedicated CLI subcommand for service toggles; once turned off the menu is hidden but existing data is kept and can be re-enabled at any time
--query uses JMESPath; az devops project list results are wrapped in a value array, whereas most other az devops commands return arrays directly, so look at the structure before writing a query. -o json first.Goal: Learn the structure of myapp-lab and create a second team, web. Environment: The organization and CLI completed in Module 0. Cost: None.
az devops invoke --area core --resource projects --route-parameters projectId=myapp-lab --api-version 7.1 --query "{name:name, state:state, revision:revision}"az devops team create --name web --description "Web front-end team" az devops team list -o table
Name Description -------------- ------------------------- myapp-lab Team The default project team. web Web front-end team
az devops security group list --project myapp-lab --query "graphGroups[].principalName" -o tsv
[myapp-lab]\Build Administrators [myapp-lab]\Contributors [myapp-lab]\myapp-lab Team [myapp-lab]\Project Administrators [myapp-lab]\Project Valid Users [myapp-lab]\Readers [myapp-lab]\Release Administrators [myapp-lab]\web
The principalName of the team security group is the team name (shown in the web UI as the “web Team” view). By default it is added to Contributors.
Case 1: a company with 37 organizations
Problem: Each department registered its own organization, causing duplicate license billing (the same person held a Basic license in 5 organizations), inconsistent policies, and no cross-department queries. Approach: After connecting to a single Entra tenant, download the organization list under Organization settings → Microsoft Entra; merge into 3 organizations by business line; migrate projects by repository import plus work item migration with CSV/tools. Configuration: Entra tenant policy “Restrict organization creation” (only designated groups may create organizations). Limits: Work item history and pipeline run records cannot be migrated losslessly, so the old organization must be kept read-only for a period.
Case 2: code moves to GitHub, planning stays in Boards
Problem: Developers want GitHub Copilot, Codespaces and Actions, while the project manager relies on the Epic/Feature hierarchy and delivery plans in Boards. Approach: GitHub Enterprise Importer migrates repositories and PRs; Project settings → GitHub connections connects the GitHub organization; PR descriptions write AB#1234, which shows the GitHub PR in the work item's Development area. Limits: Pipelines are not migrated with GEI; they must be rewritten as Actions, or Azure Pipelines keeps building the GitHub repositories.
Case 3: on-premises deployment for a regulated industry
Problem: Source code must not leave the country, and the network is isolated from the internet. Approach: Azure DevOps Server (25H2) + SQL Server 2025, with patches installed monthly (security patches were released every month in 2026). Limits: No Microsoft-hosted agents, so self-hosted agents must be built; new features arrive later than in the cloud service; backup and high availability are your own responsibility.
Common errors and fixes
TF400813: The user 'xxx' is not authorized to access this resource.
Cause: The account is not in the organization (never added, or removed), or the wrong account was used (a personal MSA with the same email as a work account).
az account show --query user # Who is currently signed in to the CLI az devops user show --user you@contoso.com # Requires an administrator to run
Fix: Have an organization administrator add you under Organization settings → Users; sign in again in an InPrivate window and confirm you chose the right account type.
There were errors in your request: Organization 'contoso-lab' not found / page shows “The resource cannot be found”
Cause: The organization name is misspelled, the organization was deleted (recoverable within 28 days), or it was renamed (the old URL stops working after a rename).
az devops configure --list
curl -s -o /dev/null -w "%{http_code}\n" https://dev.azure.com/contoso-lab/_apis/connectionData
Fix: Go to https://aex.dev.azure.com (the “My organizations” page) to see the organizations you can access, and update the default.
No Test Plans / Artifacts in the project's left menu
Cause: The service has been turned off in project settings, or your access level does not support it (Test Plans needs Basic + Test Plans; Stakeholders cannot see Repos).
Fix: A project administrator turns the service on under Project settings → Overview; for access level issues see Module 3.
The New project page has no “Public” option
Cause: Public projects have been retired and can no longer be created; existing public projects become private starting in 2027.
Fix: Put open-source projects on GitHub; for public documentation use GitHub Pages or another site.
1. Write one command that prints the name of the process template used by myapp-lab.
az devops project show --project myapp-lab --query capabilities.processTemplate.templateName -o tsv
2. Create a team named api and list its members.
az devops team create --name api az devops team list-member --team api -o table
A company of 200 people has already bought GitHub Enterprise Cloud, and the product manager insists on using the Epic/Feature hierarchy and delivery plans of Azure Boards. Does it need to buy Azure DevOps Basic for the 200 people as well? How should it be set up?
No. The GitHub Enterprise license includes Basic access to Azure DevOps (shown as the “GitHub Enterprise” access level), and users are recognized within 24 hours of signing in. Setup: one Azure DevOps organization connected to the same Entra tenant; Project settings → GitHub connections connects the GitHub organization; developers work on GitHub and write AB#id in the PR description; the few people who need Test Plans are assigned Basic + Test Plans separately.
Verified teaching videos
Official documentation
- What is Azure DevOps?
- Compare Azure DevOps Services with Azure DevOps Server
- Plan your organizational structure
- Public projects retirement
Storyboard script (about 90 seconds)
This courseware cannot directly generate video or MP3 files; a storyboard and narration script are provided, which can be handed to a video tool.
On screen: a large box labeled “Organization contoso-lab”, with billing, Entra, policies and agent pools listed around its edges.
Narration: the organization is the outermost layer; all billing, identity and policy decisions are made at this layer.
On screen: two project boxes appear inside the organization box, each with five service icons lit up.
Narration: the project is the main boundary for data and permissions; each project has Boards, Repos, Pipelines, Test Plans and Artifacts, which can be turned off as needed.
On screen: the project box splits into two teams, each with its own board and sprint calendar.
Narration: a team is not a permission boundary but a view and cadence: it decides which work items you see and which sprints you join.
On screen: an AB# link and a pipeline arrow drawn between the GitHub icon and the Azure DevOps icon.
Narration: GitHub and Azure DevOps can be used together: code on GitHub, planning in Boards, and the GitHub Enterprise license includes basic Azure DevOps access.
Module 2 · Organizations, projects, security groups and permissions
- State the meaning of the seven permission states (Allow, Allow (inherited), Allow (system), Deny, Deny (inherited), Deny (system), Not set).
- Remember the default security groups at project and organization level, and know what Project Collection Administrators and Project Administrators each manage.
- Derive effective permissions in this order: expand group membership → resolve inheritance along the object tree → merge multiple groups (deny precedence) → treat Not set as no permission → layer on the access level; verify with Why? and the CLI.
What: three independent control planes
| Control plane | Question it answers | Where it is set | Example |
|---|---|---|---|
| Membership (Membership) | Which security groups do you belong to? | Organization/project settings → Permissions → Groups → Members | alice belongs to [myapp-lab]\Contributors and Contractors |
| Permissions (Permissions) | What can this group do on this object? | The Security page of the organization / project / object (repositories, branches, area paths, query folders, pipelines …) | Contractors: Contribute = Deny on the myapp repository |
| Access level (Access level) | Which web features can you use? | Organization settings → Users (Module 3) | A Stakeholder cannot see Repos in a private project |
The three work together as an AND: a feature the access level does not support cannot be used even if the permission is granted; without the permission, a higher access level does nothing.
Permission states
| State | Meaning |
|---|---|
| Allow | Explicitly granted at the current scope |
| Allow (inherited) | Inherited from a parent scope or from a group membership |
| Allow (system) | Granted and managed by Azure DevOps; cannot be edited |
| Deny | Explicitly denied at the current scope |
| Deny (inherited) | Denied, inherited from a parent scope or group |
| Deny (system) | Denied by the system; cannot be edited |
| Not set | Neither allowed nor denied at the current scope; decided by other assignments; if everywhere is Not set, the result is no permission (implicit deny) |
Why: why the evaluation order matters
Questions like “I'm in Contributors, so why can't I push?” are, 90% of the time, caused by: the user is also in another group that is explicitly denied on the same scope; or a closer explicit setting on a branch overrides the repository-level inheritance. Looking only at one group's permission page never reveals the cause; you must derive it following the engine's order, or use Why? (permission tracing).
How: the effective permission evaluation process (based on the official About permissions documentation)
- Expand the identity: the user themselves + directly held groups + nested groups + groups brought in by Entra groups (changes to Entra groups sync within about an hour; sign out and back in, or trigger a re-evaluation manually). Every user added to any group is also in Project Collection Valid Users / Project Valid Users.
- Resolve inheritance along the object tree (done separately for each identity): area paths, iteration paths, version-control folders, Git repositories → branches, query folders, pipeline folders and similar objects form a hierarchy. A parent's settings are inherited by all children,unless the identity has an explicit setting on the child—in which case the explicit value on the child replaces the value inherited from the parent. Official example: for
area-1an explicit Deny onarea-1/sub-area-1and an explicit Allow onsub-area-1, the user gets Allow on - Merge multiple identities over the resulting scope: within the same scope, any group's Deny generally takes precedence over Allow in other groups; Not set neither grants nor overrides.
- Result: Allow and no Deny → allowed; any Deny → denied; all Not set → no permission.
- Layer on access levels and system rules: for example, a Stakeholder in a private project cannot access Repos even if the permission allows it; Allow/Deny (system) entries cannot be changed.
Default security groups
| Project level (one set per project) | Organization level (one set per organization) |
|---|---|
| Project Administrators (manage the project: teams, areas/iterations, repositories, service hooks, service connections) Contributors (read and write code, work items, pipelines — most members go here) Readers (read-only) Build Administrators, Release Administrators Project Valid Users (maintained by the system; do not change) Team name Team (one is added for each team created) | Project Collection Administrators (PCA: manage the organization — projects, policies, processes, retention policies, agent pools, extensions; the organization owner is automatically included) Project Collection Build Administrators Project Collection Build Service Accounts / Service Accounts / Proxy Service Accounts / Test Service Accounts Project Collection Valid Users (maintained by the system; do not change) Project-scoped Users (for the “limit user visibility” preview feature) Security Service Group |
Security groups are actually all managed at the organization level (even when used by only one project); some groups are hidden in the web UI, but all are visible through the CLI or REST. Besides roles, some resources use role-based permissions: Artifacts feed roles, extension managers, pipeline resource roles (agent pools, environments, service connections), and team administrators.
When: best practices
- Grant permissions only to groups (preferably Entra groups), not directly to individuals; do not create a new group when a default group will do.
- When a few people must not be able to do something, create a custom group and set an explicit Deny, rather than changing Contributors.
- Do not change the default permissions of the Valid Users groups: denying “View project-level information” would lock everyone out of the project.
- Keep PCA membership as small as possible (2–3 people recommended, using protected administrator accounts).
Comparison with GitHub
| Azure DevOps | GitHub | |
|---|---|---|
| Model | Fine-grained bit permissions (dozens of bits per security namespace) + Allow/Deny/Not set + inheritance | Predefined roles (Read/Triage/Write/Maintain/Admin) + custom repository roles; grant only, no explicit deny |
| Conflicts between groups | Deny takes precedence within the same scope | The highest role wins |
| Branch protection | Branch policies + branch-level permissions (can deny force push, etc.) | Rulesets / branch protection rules |
Structure diagram: identities, groups, objects and permission bits
Flow diagram: effective permission evaluation
Core animation: permission evaluation engine
Choose a scenario and play it step by step: user → groups they belong to → each group's explicit Allow / Deny at each level → each group's value after resolving the object tree → merge (deny precedence) → layer on the access level → final result. You can also click cells in the table to cycle through “· / Allow / Deny” and experiment yourself.
Command table
| Command | Purpose | Key parameters |
|---|---|---|
az devops security group list | List project-level or organization-level security groups | --project or --scope organization |
az devops security group create | Create a custom group | --name,--project,--description |
az devops security group membership add / list / remove | Manage group members | --group-id (descriptor),--member-id (email or descriptor) |
az devops security permission namespace list | List security namespaces and their bit definitions | --query |
az devops security permission show | View the effective permissions of a principal on a token | --id (namespace),--subject,--token |
az devops security permission update / reset | Set allow/deny bits, or reset to Not set | --allow-bit,--deny-bit,--permission-bit |
# 1) Find the Git Repositories namespace and its bit definitions
az devops security permission namespace list \
--query "[?name=='Git Repositories'].{id:namespaceId, actions:actions[].{name:name, bit:bit}}" -o json
# 2) Build the token: repoV2/{projectId}/{repoId}
PROJ_ID=$(az devops project show --project myapp-lab --query id -o tsv)
REPO_ID=$(az repos show --repository myapp --query id -o tsv)
GIT_NS=2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87
TOKEN="repoV2/$PROJ_ID/$REPO_ID"
# 3) View alice's effective permissions (the result resolves to Allow / Deny / inherited)
az devops security permission show --id $GIT_NS --subject alice@contoso.com --token "$TOKEN" \
--query "[0].acesDictionary.*.resolvedPermissions[].{name:displayName, effective:effectivePermission}" -o table
Name Effective ------------------------------------ ---------------- Contribute Deny (inherited) Create branch Allow (inherited) Read Allow (inherited) Force push (rewrite history ...) Not set ...
How to verify: Web: Project settings → Repositories → myapp → Security → select the user → the icon next to Contribute Why?, should show “Deny inherited from [myapp-lab]\Contractors”. Common errors:--subject Using a display name will fail; use an email or descriptor. The branch part of the token is an encoded string, so first az devops security permission list --id $GIT_NS --subject ... --recurse look up the existing token and reuse it. Production use: Scripted audit: iterate over all repositories and find ACEs granted directly to individuals.
# Create a custom group, add members, then explicitly deny Contribute on the repository (bit 4) az devops security group create --name Contractors --project myapp-lab --description "External vendors" GRP=$(az devops security group list --project myapp-lab --query "graphGroups[?displayName=='Contractors'].descriptor" -o tsv) az devops security group membership add --group-id "$GRP" --member-id alice@contoso.com az devops security permission update --id $GIT_NS --subject "$GRP" --token "$TOKEN" --deny-bit 4 # Revert: reset to Not set az devops security permission reset --id $GIT_NS --subject "$GRP" --token "$TOKEN" --permission-bit 4
Goal: Reproduce the situation of “in Contributors but cannot push” yourself, and explain it using Why? and the CLI. Environment: myapp-lab, ideally with a second test account (called alice below); without a second account you can still observe the permission results with the CLI alone. Cost: None (the first 5 Basic users are free).
az devops user add --email-id alice@contoso.com --license-type express --send-email-invite false CONTRIB=$(az devops security group list --project myapp-lab --query "graphGroups[?displayName=='Contributors'].descriptor" -o tsv) az devops security group membership add --group-id "$CONTRIB" --member-id alice@contoso.com
--license-type express i.e. Basic (the older name used in the CLI),stakeholder i.e. Stakeholder,advanced i.e. Basic + Test Plans.
remote: TF401027: You need the Git 'GenericContribute' permission to perform this action. Details: identity 'alice@contoso.com', scope 'repository'. To https://dev.azure.com/contoso-lab/myapp-lab/_git/myapp ! [remote rejected] feature/x -> feature/x (TF401027: ...)Web: Security → alice → Contribute → Why? shows Deny from Contractors.
myapp-lab\legacy and myapp-lab\legacy\hotfix; for Contractors, on legacy deny “Edit work items in this node”, and on legacy\hotfix allow. alice can edit work items under hotfix but not under legacy.az devops security permission reset --id $GIT_NS --subject "$GRP" --token "$TOKEN" --permission-bit 4 az devops security group delete --id "$GRP" --yes
Case 1: contractors may only change the front-end code
Problem: An outsourcing team needs access to the web repository but must not see the payments repository. Approach: Entra group sg-vendors → Azure DevOps group Contractors (not added to Contributors); on the web repository, allow Read + Contribute for Contractors; set nothing on the payments repository (Not set = no permission). Turn on the organization preview feature “Limit user visibility” and place Contractors in Project-scoped Users. Limits: This preview feature only restricts the web portal; some data is still visible through REST or the CLI, so sensitive code is best kept in a separate project.
Case 2: “View project-level information” on Valid Users was accidentally set to Deny
Problem: Everyone (including administrators) gets “VS800075: The project … does not exist, or you do not have permission to access it” when opening the project. Approach: A PCA restores the entry to Not set/Allow via Organization settings → Permissions or REST. Prevention: The documentation clearly advises not to change the default permissions of the Valid Users group; permission changes go through auditing (Organization settings → Auditing) and change review.
Case 3: prevent anyone from force-pushing to main
Problem: Someone git push --force overwrote main. Approach: In main's Security settings, explicitly deny “Force push” to Contributors and Project Administrators, then add a branch policy that enforces PRs (Module 5). Limits: The Bypass policies permission is not granted to any group by default; the emergency path is given only to a dedicated group, with audit alerts enabled.
Common errors and fixes
TF401027: You need the Git 'GenericContribute' permission to perform this action.
Cause: The effective Contribute permission is not Allow: a group the user belongs to is denied on the repository or branch, or the user is only in Readers.
az devops security permission show --id 2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87 --subject user@contoso.com --token "repoV2/$PROJ_ID/$REPO_ID" -o table
Fix: Use Why? to find the source of the deny; remove the user from that group or set it to Not set. Branch-level denies must be checked in the branch's Security settings.
VS800075: The project with id 'vstfs:///Classification/TeamProject/…' does not exist, or you do not have permission to access it.
Cause: The user is not a project member (lacks View project-level information), or the project has been deleted or renamed.
Fix: A project administrator adds the user to Readers/Contributors; check whether Valid Users has been denied by mistake; the project recycle bin can restore a deleted project within 28 days.
The user was added to the group, but the permission still does not take effect
Cause: Changes to Entra groups sync within about an hour; browsers and tokens cache old group membership.
Fix: Have the user sign out and sign back in, or trigger “Re-evaluate permissions” under User settings → Permissions; use az devops security group membership list --id <user-descriptor> --relationship memberof to confirm the membership.
Project administrators cannot see the “New project” or “Process” settings
Cause: These are organization-level operations, which require Project Collection Administrators (or the corresponding organization-level permission).
Fix: Have a PCA do it, or grant the “Create new projects” organization-level permission to a dedicated group.
1. List the members of the Project Administrators group in myapp-lab.
PA=$(az devops security group list --project myapp-lab --query "graphGroups[?displayName=='Project Administrators'].descriptor" -o tsv) az devops security group membership list --id "$PA" -o table
2. Restore the Contribute permission of the Contractors group on the myapp repository to Not set.
az devops security permission reset --id 2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87 --subject "$GRP" --token "repoV2/$PROJ_ID/$REPO_ID" --permission-bit 4
bob is in both Contributors (repository-level Contribute = Allow) and Auditors (Contribute = Deny across all repositories in the project). The project administrator explicitly set Allow for Auditors on the myapp repository. Can bob now push to myapp? Why?
Yes. For the Auditors identity, the explicit Allow on the myapp repository replaces the Deny inherited from “all repositories” (an explicit value on a child overrides the inherited value from the parent); Contributors is also Allow on myapp; after merging there is no Deny, so the result is Allow. If a third group denies on myapp, Deny takes precedence.
Verified teaching videos
No video specifically explaining “permission inheritance and deny precedence” that can be verified via oEmbed was found; follow the official documentation and this module's animation.
Official documentation
- About permissions and security groups
- Permissions and groups reference
- Security namespace and permission reference
- View permissions (Why?)
Storyboard script (about 100 seconds)
This courseware cannot directly generate video or MP3 files; a storyboard and narration script are provided.
On screen: user alice's avatar, with three lines reaching out to three groups.
Narration: the first step of the permission engine is to expand the user into all the groups they belong to, including groups joined indirectly through Entra groups.
On screen: an object tree: all repositories → myapp → main branch; each group carries green Allow or red Deny tags at different levels.
Narration: the second step, each group searches up the object tree on its own; the closest explicit setting takes effect, otherwise the parent is inherited.
On screen: the results of three groups converge into one funnel, with red Deny overpowering green Allow.
Narration: the third step merges all groups over the same scope: one Deny is enough to deny; if none is set, there is no permission.
On screen: the mouse clicks the Why? link beside a permission, and “Deny inherited from Contractors” pops up.
Narration: when something goes wrong, don't guess; click Why, and it tells you which group and which level determined the result.
Module 3 · Access levels, licensing and billing
- Explain what Stakeholder, Basic, Basic + Test Plans, and the Visual Studio subscription and GitHub Enterprise access levels each allow.
- Estimate a team's monthly cost: user licenses + Microsoft-hosted / self-hosted parallel jobs + Artifacts storage, and know how the free allowances are enabled.
- use Entra group rules to assign access levels and project memberships in bulk, and understand “take the highest level” and when re-evaluation happens.
What: access levels
| Access level | Price (2026-11, USD) | What it can do (private projects) | What it cannot do |
|---|---|---|---|
| Stakeholder | Free, unlimited users | Some Boards features: view/add/edit work items, drag state, add at the bottom of backlogs, save “My Queries”; full access to Pipelines; Artifacts; view dashboards and the project Wiki; approve releases | No Repos; cannot reorder backlog priority, cannot assign sprints in the planning pane, cannot view or create query charts; cannot edit the Wiki; no Test Plans |
| Basic | First 5 users free, then $6/user/month | All Boards, Repos, Pipelines and Artifacts features; in Test Plans, only running tests and viewing results | Creating and managing test plans/suites |
| Basic + Test Plans | $52/user/month (30-day trial available) | All of Basic + all Azure Test Plans features | — |
| Visual Studio subscription | Included with the subscription,does not use up the 5 free slots | VS Professional ≈ Basic; VS Enterprise ≈ Basic + Test Plans | Must be assigned in the VS subscription management portal; cannot be assigned with group rules |
| GitHub Enterprise | Included with a GitHub Enterprise license | Equivalent to Basic; recognized when the user signs in, effective within 24 hours at most | If Test Plans is needed, add Basic + Test Plans separately |
What: billing for Pipelines and Artifacts
| Item | Free allowance | Paid |
|---|---|---|
| Microsoft-hosted parallel jobs | 1 parallel job for private projects, up to 1 hour per run, 1,800 minutes per month (30 hours); enabled automatically only after billing is set up for the organization (Azure subscription linked) | $40/month per parallel job, unlimited minutes, up to 31 hours for a single job |
| Self-hosted parallel jobs | 1, plus 1 for each active VS Enterprise subscriber; granted automatically, unlimited duration | $15/month each; any number of agents can be registered, charged by the number of jobs running at the same time |
| Azure Artifacts | 2 GiB per organization | Tiers: 2–10 GiB $2/GiB, 10–100 GiB $1/GiB, 100–1,000 GiB $0.5/GiB, above 1,000 GiB $0.25/GiB |
Key details: buying the first hosted parallel job from the free tier still leaves parallelism at 1 (it only removes the time limit); to run two jobs at once you must buy two. New organizations are capped at 25 hosted parallel jobs; raising the cap requires contacting support. Parallel jobs are shared across all projects in the organization and cannot be assigned to a specific project. Runs waiting for approval do not use a parallel job. Pipelines are not charged per user, and Stakeholders can also write and run pipelines.
Why: why access levels and permissions are distinct
An access level is a “license”, tied to money and assigned at the organization level; a permission is an “authorization”, tied to objects and assigned at the organization, project or object level. Setting product managers, approvers and business stakeholders as Stakeholders saves a lot of license cost, but you must be clear about their limits on Boards (for example, they cannot drag backlog items to reorder), or they will be mistaken for a permission bug.
How: the billing mechanism
- All charges go through the Azure subscription linked to the organization and appear on the monthly Azure bill (EA, pay-as-you-go, CSP and so on are all supported); set it up under Organization settings → Billing. No other Azure services need to be used.
- User licenses are prorated daily. After changing a user from Basic to Stakeholder or removing them, billing stops from the next day.
- A user takes up only one license per organization; across multiple organizations each is billed separately (except for the “multi-organization billing” option when they share one billing subscription; follow the Billing page).
How: Entra group rules
- Organization settings → Users → Group rules: assign an access level to an Entra group (or an Azure DevOps group), and also specify which group to join in which projects and which extensions to install. Only PCAs can see and manage this.
- When a user belongs to multiple rules, the highest access level applies (one rule gives Stakeholder, another gives Basic → Basic). A user who was directly assigned a higher level is not downgraded by group rules.
- Re-evaluation: triggered manually, when a rule is changed, and automatically every 24 hours; Azure DevOps syncs Entra group membership every hour, but Entra dynamic groups themselves may take 24 hours to update.
- A user appears under All users and starts consuming a license only after first sign-in; when a user leaves the Entra group and there is no other source, they are automatically removed from the organization.
- Group rules do not apply to service principals and managed identities; these must be assigned an access level directly.
When: selection guidance
| Role | Suggested access level |
|---|---|
| Developers, operators, and anyone who reads and writes code | Basic (or included with VS / GitHub Enterprise) |
| Product managers, business stakeholders, approvers, managers who only track progress | Stakeholder (upgrade to Basic if they need to reorder the backlog or create shared queries) |
| QA who write and manage manual test plans | Basic + Test Plans or VS Enterprise |
| Service principals / managed identities used by pipelines | Assigned directly (usually Basic; Stakeholder can be considered when only calling the Boards API) |
Structure diagram: where licenses come from
Flow diagram: group rule lifecycle
Interactive: monthly cost calculator (based on the official billing rules)
Adjust the number of users and parallel jobs; the calculator applies “first 5 Basic free, VS/GHE users don't use a slot, Stakeholders free, parallel job unit prices, Artifacts tiers”. The log below explains where each item comes from.
Step-by-step animation: how group rules work out a user's access level
Command table
| Command | Purpose | Key parameters |
|---|---|---|
az devops user list | List users and access levels | --top,--skip |
az devops user add | Add a user and assign an access level | --email-id,--license-type (express=Basic, stakeholder, advanced=Basic + Test Plans),--send-email-invite |
az devops user update | Change access level | --user,--license-type |
az devops user remove | Remove a user from the organization (billing stops immediately) | --user,--yes |
az devops invoke --area MemberEntitlementManagement --resource GroupEntitlements | Query group rules (not wrapped by the CLI) | --api-version 7.1-preview.1 |
az devops user list --top 100 \
--query "items[].{user:user.principalName, level:accessLevel.licenseDisplayName, source:accessLevel.assignmentSource, lastAccess:lastAccessedDate}" -o table
User Level Source LastAccess ------------------- ------------ -------- ---------------------------- you@contoso.com Basic unknown 2026-11-15T08:40:11.2+00:00 alice@contoso.com Basic unknown 2026-11-15T09:02:37.9+00:00 pm@contoso.com Stakeholder unknown 0001-01-01T00:00:00+00:00
lastAccessedDate 0001-01-01 means never signed in. assignmentSource The values of this field and the display of group-rule sources follow what is actually returned.
# Find Basic users who have not signed in for 60 days; candidates to downgrade to Stakeholder (Linux/macOS date syntax)
CUTOFF=$(date -u -d '60 days ago' +%Y-%m-%dT%H:%M:%S 2>/dev/null || date -u -v-60d +%Y-%m-%dT%H:%M:%S)
az devops user list --top 1000 \
--query "items[?accessLevel.licenseDisplayName=='Basic' && lastAccessedDate<'$CUTOFF'].user.principalName" -o tsv
# Downgrade and upgrade
az devops user update --user pm@contoso.com --license-type stakeholder
az devops user update --user qa@contoso.com --license-type advanced
# Query group rules (REST, passed through by the CLI)
az devops invoke --area MemberEntitlementManagement --resource GroupEntitlements \
--api-version 7.1-preview.1 --query "value[].{group:group.displayName, level:licenseRule.accountLicenseType}" -o table
How to verify: In Organization settings → Users, check the “Access level” column and the “License source”. Common errors: If billing is not set up, the 6th user cannot be assigned Basic and you will see insufficient licenses (see Troubleshooting). Production use: Run a monthly “idle Basic users” report and downgrade automatically; this commonly saves 10%–30% of license costs.
--license-type Historical names are used: express = Basic,advanced = Basic + Test Plans. The web UI and REST licenseDisplayName display the new names.Goal: Add a Stakeholder and observe its functional limits; (optional) create a group rule. Cost: None. Permissions: PCA (the organization creator is one).
az devops user add --email-id pm@contoso.com --license-type stakeholder --send-email-invite false az devops security group membership add --group-id "$CONTRIB" --member-id pm@contoso.com
az devops user update --user pm@contoso.com --license-type express
Have pm refresh the page (sign in again if needed); Repos appears.
az devops user remove --user pm@contoso.com --yes
Case 1: license optimization for a 500-person organization
Problem: 500 Basic users, about $2,970 per month ((500−5)×6). Approach: Export the user list and find that 120 people have not signed in for 90 days and 80 are business stakeholders who only look at boards; the former are deleted or downgraded, the latter set to Stakeholder; 120 VS Enterprise subscribers are confirmed to be assigned through the VS portal (they do not use Basic). Result: Basic reduced to about 180 users, monthly cost about $1,050. Limits: Before downgrading, confirm these people do not need Repos or backlog ordering.
Case 2: usable on the first day of employment
Problem: New hires need a ticket for an administrator to add licenses and project memberships, averaging 2 days. Approach: Create Entra groups by department; group rule “sg-eng → Basic + myapp-lab Contributors”; the HR system just writes to the Entra group. Limits: A user consumes a license only after first sign-in; dynamic group updates may be delayed by 24 hours, so on the first day you can re-evaluate manually.
Case 3: pipeline queueing
Problem: 20 developers share 1 hosted parallel job, and PR validation often queues for 30 minutes. Approach: Check the Pool consumption report in the agent pool's Analytics to confirm it is consistently at full load; following the rule of thumb of “1 parallel job per 4–5 users”, buy 4 hosted jobs ($160/month), or move the heavy work to 2 self-hosted agents + 2 self-hosted parallel jobs ($30/month + VM costs).
Common errors and fixes
User reports “the Repos menu is gone” / You don't have access to Azure Repos
Cause: The access level is Stakeholder (private projects have no Repos), or the GitHub Enterprise / group rule license has lapsed and fallen back to the default access level.
az devops user show --user user@contoso.com --query "accessLevel.{level:licenseDisplayName, source:assignmentSource, status:status}"
Fix: Upgrade to Basic, or fix the group rule / GitHub license source.
Cannot assign Basic: the free Basic allowance is used up and billing is not set up for the organization
Cause: The 5 free Basic users are all taken, and without a linked Azure subscription no more can be bought.
Fix: Organization settings → Billing → Set up billing, then select a subscription; or downgrade people who do not write code to Stakeholder to free up slots.
##[error]No hosted parallelism has been purchased or granted.
Cause: The organization has no Microsoft-hosted parallel jobs (the free allowance is not enabled).
Fix: Set up billing for the organization to enable the free allowance automatically (1 job for private projects, 1,800 minutes per month), or switch to self-hosted agents (pool: name: Default, Lesson 2).
The group rule has been created, but the user's access level has not changed
Cause: The user has not yet signed in for the first time; the rule has not been re-evaluated; the user already has a higher direct assignment; the object is a service principal (group rules do not apply).
Fix: Group rules → Re-evaluate rules; check the license source in the user summary; assign service principals directly.
1. List the emails of all Stakeholder users in the organization.
az devops user list --top 1000 --query "items[?accessLevel.licenseDisplayName=='Stakeholder'].user.principalName" -o tsv
2. Change qa@contoso.com to Basic + Test Plans.
az devops user update --user qa@contoso.com --license-type advanced
Team of 12: 8 developers (3 of whom have VS Enterprise), 2 QA who write test plans, 2 product managers who only track progress and create work items. Needs 2 hosted parallel jobs and 6 GiB of Artifacts. Estimate the monthly cost.
Developers: 5 need Basic (3 come through VS Enterprise), covered by the 5 free slots → $0. QA: 2 × $52 = $104. Product managers: Stakeholder $0. Hosted parallel jobs: the free tier has 1 with a time limit; 2 unlimited concurrent jobs require buying 2 → $80. Artifacts: (6 − 2) × $2 = $8. Total about $192/month (an Azure subscription must also be linked).
Verified teaching videos
No recent video specifically covering Azure DevOps licensing and billing that can be verified via YouTube oEmbed was found. Prices change often; follow the official pricing page. The comprehensive video below includes a tour of organization settings and can be used for reference:
Official documentation
- About access levels
- Stakeholder access quick reference
- Billing overview
- Configure and pay for parallel jobs
- Add group rule, assign access levels
- Azure DevOps Services pricing
Storyboard script (about 80 seconds)
This courseware cannot directly generate video or MP3 files; a storyboard and narration script are provided.
On screen: three cards: Stakeholder (free), Basic (six dollars), Basic plus Test Plans (fifty-two dollars).
Narration: access level is the license. The first five Basic users are free, and Stakeholders are free with no user limit.
On screen: one lane in a swimming pool; queued jobs enter the water one after another; adding a lane shortens the queue.
Narration: parallel jobs are like lanes; they determine how many pipeline jobs can run at the same time, regardless of the number of users.
On screen: two Entra groups point to Stakeholder and Basic; the user finally shows Basic.
Narration: group rules take the highest level; joiners and leavers only require changing the Entra group.
On screen: an Azure DevOps entry appears on the Azure bill.
Narration: all charges are billed through the linked Azure subscription and prorated by day.
Module 4 · Azure Boards: work items, backlogs and sprints
- Compare the work item types, backlog levels and states of the four system processes (Basic / Agile / Scrum / CMMI), and choose one for a team.
- Use an inherited process to add fields, states, rules and custom work item types safely.
- Configure area paths, iteration paths and team settings, and use product backlogs, sprint backlogs, task boards, boards and queries (WIQL).
What: the four system processes
| Process | Requirement level (backlog) | Other types | Requirement state flow | Best for |
|---|---|---|---|---|
| Basic | Epic → Issue → Task | — | To Do → Doing → Done | Small teams, just starting out, who only want a simple board |
| Agile | Epic → Feature → User Story → Task | Bug, Issue | New → Active → Resolved → Closed (also Removed) | Most agile teams; this lesson uses it |
| Scrum | Epic → Feature → Product Backlog Item → Task | Bug, Impediment | New → Approved → Committed → Done (also Removed) | Strict Scrum, commitments per sprint |
| CMMI | Epic → Feature → Requirement → Task | Bug, Change Request, Issue, Review, Risk | Proposed → Active → Resolved → Closed | Organizations that need formal change control and audit traceability |
Each process also includes test-related types (Test Plan, Test Suite, Test Case, Shared Steps, etc., used by Test Plans). States are grouped into state categories (Proposed, In Progress, Resolved, Completed, Removed). Boards, burndown and velocity charts are all computed by category, so choose the correct category when customizing states.
Why: why use an inherited process
The four system processes are locked and cannot be modified directly. To add fields, change layouts or add states, first create an inherited process (for example Agile-myapp inherit from Agile), then switch the project to it. Benefits: when the system process is updated, the inherited process automatically gets the updates, and all projects using it stay consistent. What you can do: add custom fields, pick lists, rules (conditionally required, read-only, default values), custom states (inherited states cannot be renamed or deleted), custom work item types, add a composite backlog level, and modify form layouts.
How: key objects
| Object | Role | Belongs to |
|---|---|---|
| Area Path | Groups work items by product / component / team; also carries permissions (View/Edit work items in this node) | Project; teams select the areas they “own” (may include sub-areas) |
| Iteration Path | Sprint / release, with start and end dates | Defined by the project; teams choose which iterations to take part in, and set the default iteration and backlog iteration |
| Product backlog | Requirement-level work items within a team's area, ordered by priority (Stack Rank / Backlog Priority field) | Team |
| Sprint backlog and task board | Requirements and tasks whose iteration path equals a sprint; capacity planning | Team + iteration |
| Board | Card view of requirements; columns map to states, can be split into Doing/Done, with WIP limits, swimlanes and card styles | Team × backlog level |
| Query | Filters work items with WIQL; can be saved as “My Queries” or “Shared Queries”, used for charts, and added to dashboards | Project (the shared query folder has permissions) |
| Delivery Plans | Work items from multiple teams placed on a calendar timeline | Project |
When: selection and design advice
- If unsure, choose Agile; choose Scrum for “commitment” semantics; Basic is the simplest, but switching to Agile/Scrum later requires migrating types.
- Design area paths around a “long-term stable product structure”, not around people's names; when teams are reorganized, change the team's area selection rather than the paths.
- Sprint length is fixed (for example two weeks); create 3–6 iterations in advance; sprint dates must not overlap.
- Note: area and iteration paths can now be deleted only when no work items use them (the same behavior change described in the Azure DevOps Server 25H2 notes).
Comparison with similar tools
| Azure Boards | GitHub Issues + Projects | Jira | |
|---|---|---|---|
| Hierarchy | A fixed hierarchy defined by the process + one optional composite level | Sub-issues + issue types | Epic / Story / Sub-task, configurable |
| Process customization | Inherited process, shared at organization level | Custom fields, issue types | Workflow schemes, very flexible |
| Code integration | Native to Azure Repos; GitHub uses AB# | Native | Plugins |
System.State (the Doing/Done split columns are the exception, using a board-specific field). ② “A team equals an area” — a team selects areas, and several teams can share the same area. ③ “Removed means deleted” — Removed is only a state; the work item still exists; real deletion goes to the recycle bin, and permanent deletion needs extra permissions. ④ “Add custom fields directly to the Agile process” — system processes cannot be changed; you must create an inherited process first.Structure diagram: processes, projects, teams and work items
State diagram: mapping of Agile process User Story states to board columns
Interactive animation: what happens when you drag a board card
Click the button below a card to move it to the next column. Each move shows the REST call the browser actually sends (JSON Patch update System.State), the server-side rule checks (for example, Resolved By/Date filled in automatically when Resolved), the change in the revision number rev, and the state category used by the burndown chart.
Command table
| Command | Purpose | Key parameters |
|---|---|---|
az boards area project create / list | Create / list project area paths | --name,--path (parent path),--depth |
az boards area team add | Add areas to a team | --team,--path '\myapp-lab\web',--set-as-default,--include-sub-areas |
az boards iteration project create / list | Create / list iterations | --name,--start-date,--finish-date |
az boards iteration team add / set-default-iteration / set-backlog-iteration | Team takes part in iterations, set default | --team,--id (iteration identifier, GUID) |
az boards work-item create / update / show / delete | Create, read, update and delete work items | --type,--title,--area,--iteration,--fields,--state |
az boards work-item relation add / show | parent-child and other links | --relation-type parent|child|related,--target-id |
az boards query | Run WIQL or a saved query | --wiql,--id,--path |
# Areas: myapp-lab\web and myapp-lab\api, and set as the team's default area az boards area project create --name web az boards area project create --name api az boards area team add --team web --path '\myapp-lab\web' --set-as-default --include-sub-areas true # Iterations: one two-week sprint, with the web team taking part az boards iteration project create --name "Sprint 1" --start-date 2026-11-16 --finish-date 2026-11-27 az boards iteration project create --name "Sprint 2" --start-date 2026-11-30 --finish-date 2026-12-11 S1=$(az boards iteration project list --depth 1 --query "children[?name=='Sprint 1'].identifier" -o tsv) S2=$(az boards iteration project list --depth 1 --query "children[?name=='Sprint 2'].identifier" -o tsv) az boards iteration team add --team web --id $S1 az boards iteration team add --team web --id $S2 az boards iteration team list --team web -o table
Name Path StartDate FinishDate -------- ----------------------- -------------------- -------------------- Sprint 1 myapp-lab\Sprint 1 2026-11-16T00:00:00Z 2026-11-27T00:00:00Z Sprint 2 myapp-lab\Sprint 2 2026-11-30T00:00:00Z 2026-12-11T00:00:00Z
# Work items and parent-child links
EPIC=$(az boards work-item create --type Epic --title "Observability" --area 'myapp-lab\web' --query id -o tsv)
STORY=$(az boards work-item create --type "User Story" --title "Provide /healthz health check" \
--area 'myapp-lab\web' --iteration 'myapp-lab\Sprint 1' \
--fields "Microsoft.VSTS.Scheduling.StoryPoints=3" "Microsoft.VSTS.Common.Priority=1" --query id -o tsv)
az boards work-item relation add --id $STORY --relation-type parent --target-id $EPIC
az boards work-item update --id $STORY --state Active --assigned-to you@contoso.com
# WIQL: unfinished stories in the web team's current sprint
az boards query --wiql "SELECT [System.Id],[System.Title],[System.State] FROM WorkItems \
WHERE [System.TeamProject] = @project AND [System.WorkItemType] = 'User Story' \
AND [System.IterationPath] = @CurrentIteration('[myapp-lab]\web Team') \
AND [System.State] <> 'Closed' ORDER BY [Microsoft.VSTS.Common.Priority]" -o table
How to verify: Boards → Sprints → web team → Sprint 1 should show the story; in Backlogs it sits under the Epic (open the Epic level or turn on “Parents: Show”). Common errors: Path written as myapp-lab\Area\web—area paths do not contain “Area”, whereas --path the parent path parameter is only used in project create \myapp-lab\Area; in WIQL <> in the shell it must be enclosed in quotes. Production use: Bulk-import backlog items from CSV or a script; drive dashboards with shared queries.
Goal: Set up areas, two sprints and the Epic → Story → Task hierarchy for the web team, and walk through the states on the board. Cost: None.
$EPIC,$STORY IDs.TASK=$(az boards work-item create --type Task --title "Write unit tests for /healthz" --area 'myapp-lab\web' --iteration 'myapp-lab\Sprint 1' \
--fields "Microsoft.VSTS.Scheduling.RemainingWork=4" --query id -o tsv)
az boards work-item relation add --id $TASK --relation-type parent --target-id $STORY
az boards work-item relation show --id $STORY --query "relations[].{rel:rel, url:url}" -o table
Rel Url ----------------------------------- ------------------------------------------------------------- System.LinkTypes.Hierarchy-Reverse https://dev.azure.com/contoso-lab/_apis/wit/workItems/1 System.LinkTypes.Hierarchy-Forward https://dev.azure.com/contoso-lab/_apis/wit/workItems/4
Agile-myapp; add a field to User Story Component (pick list: web/api/infra); project myapp-lab → Change process → Agile-myapp.Case 1: three teams sharing one backlog makes “whose work is it” unclear
Problem: All work items sit in the root area, and the three teams' boards look exactly the same. Approach: Create areas web/api/infra by product component, with each team selecting only its own area; the default team keeps the root area and “includes sub-areas” as an overview. Configuration:az boards area team add --team api --path '\myapp-lab\api' --set-as-default. Limits: Changing area paths updates many work items, so do it during off-peak hours.
Case 2: audit requires every Bug to have a severity and a root cause
Approach: Add a “Root cause” field to Bug in the inherited process; rules: Root cause is required when State changes to Closed, and Severity is required. Limits: Rules are enforced on the server and apply equally to REST/CLI, so automation scripts must fill in the fields, or they will return TF401320 rule validation errors.
Case 3: switching from the Basic process to Agile
Problem: The project started on Basic (Issue) and now needs the Feature/Story hierarchy. Approach: Follow the official “Change a project from Basic to Agile” steps: switch the project to the Agile inherited process, then use bulk edit to change Issue to User Story and map states (To Do→New, Doing→Active, Done→Closed). Limits: Queries and board column settings must be rechecked; rehearse first in a test project.
Common errors and fixes
TF401347: Invalid tree name given for work item -1, field 'System.AreaPath'.
Cause: The area or iteration path does not exist, or the spelling, case or backslashes are wrong (for example, writing myapp-lab/web).
az boards area project list --depth 2 -o json --query "children[].path"
Fix: Create the path first, and use myapp-lab\web format.
A newly created work item does not appear in the team backlog
Cause: The work item's area is outside the areas selected by the team; or its type is not on the backlog level (for example, Task only shows on the sprint task board); or its state belongs to Completed/Removed.
Fix: Check Project settings → Team configuration → Areas; change the work item's area to the team's area; check filters such as “Completed child items” in the upper-right corner of the backlog.
The sprint page shows “No iterations selected for this team”
Cause: Iterations are created only at project level, and the team has not selected them.
az boards iteration team add --team web --id <iteration-guid>
When dragging a card: The field 'Story Points' cannot be empty / Rule validation failed
Cause: The inherited process defines a conditionally required rule.
Fix: Open the card, fill in the field, then move it; or adjust the rule. Rules apply equally to CLI/REST updates.
1. Move work item 3 to Sprint 2 and set it to Resolved.
az boards work-item update --id 3 --iteration 'myapp-lab\Sprint 2' --state Resolved
2. Use WIQL to list all Bugs in the web area whose state is Active.
az boards query --wiql "SELECT [System.Id],[System.Title] FROM WorkItems WHERE [System.TeamProject]=@project AND [System.WorkItemType]='Bug' AND [System.AreaPath] UNDER 'myapp-lab\web' AND [System.State]='Active'" -o table
The project manager requires that every User Story gets a “Customer” field, required when it enters Active; another project using Agile must be unaffected. How do you implement this?
Create a process inherited from Agile (for example Agile-myapp), add the Customer field to User Story, and add the rule “When State changes to Active → Make required Customer”; switch only myapp-lab to this inherited process, while the other project keeps using Agile (or another inherited process). System processes themselves cannot be modified.
Verified teaching videos
Official documentation
- Choose a process
- About process customization and inherited processes
- About area and iteration paths
- WIQL syntax reference
Storyboard script (about 90 seconds)
This courseware cannot directly generate video or MP3 files; a storyboard and narration script are provided.
On screen: four process cards, Basic, Agile, Scrum and CMMI, each expanding into its work item hierarchy.
Narration: choose the process first. The process determines which work item types and states exist; if unsure, choose Agile.
On screen: two trees in a project: area paths by component, iteration paths by sprint dates.
Narration: areas answer “whose is this”, iterations answer “when is it done”. Teams select their own part from them.
On screen: a board card is dragged from New to Active, and a line of PATCH request pops up at the bottom of the screen.
Narration: dragging a card is really changing the state field; the server enforces the process rules and increments the revision number.
On screen: fields and rules are being added in the inherited-process editor.
Narration: to customize, first create an inherited process; the system process itself is locked.
Module 5 · Azure Repos: repositories, branch policies and PRs
- List the types of branch policy (minimum reviewers, linked work items, comment resolution, limited merge types, build validation, status checks, automatic reviewers), and understand the difference between “required” and “optional”.
- Walk through the full PR lifecycle: draft → publish → review votes → policy evaluation → auto-complete → merge type → work item state transition.
- Understand how branch-level permissions (Force push, Bypass policies) relate to policies, so that policies are not “in name only”.
What: repositories and branch policies
A project can have any number of Git repositories (unlimited private repositories) and at most one TFVC repository (legacy; new projects should use Git only; the organization can turn on “Disallow creating TFVC repositories”). Branch policies are attached to a “repository + branch (or branch pattern)”; they can also be set under Project settings → Repositories → Policies as cross-repository policies (applies to the main or release/* of all repositories; pattern matching is case-sensitive).
| Policy | Purpose | Key options |
|---|---|---|
| Require a minimum number of reviewers | Minimum number of approvals | Whether the author may vote for their own change; prohibit approval by the most recent pusher; whether it can still be completed if someone has voted “Wait/Reject”; reset votes when new pushes arrive |
| Check for linked work items | PR must link a work item | Required / optional |
| Check for comment resolution | All comments must be resolved | Required / optional |
| Limit merge types | Limit merge types | Basic merge (no-ff), Squash, Rebase and fast-forward, Rebase with merge commit (semi-linear) |
| Build validation | PR's pre-merge result must build successfully | Select the pipeline, trigger mode (automatic/manual), expiration policy, path filter |
| Status checks | External services (security scans, deployment previews) write back status | Status name, whether required, when it expires |
| Automatically included reviewers | Automatically add reviewers by path (similar to CODEOWNERS) | Required / optional; path filter such as /infra/* |
Why: why use policies rather than just “conventions”
As long as any one of these is required is enabled, the branch cannot be pushed to directly; all changes must go through a PR (a push is rejected with TF402455). Policies are enforced on the server and apply equally to the web, CLI, REST and IDE. Combined with the branch permissions from Module 2, for main an explicit Deny on Force push; Bypass policies is not granted to any ordinary group.
How: the internal mechanics of PRs
- Creating a PR: source branch → target branch; it can be a draft (Draft; it does not trigger required-review notifications; build validation can be configured).
- Pre-merge commit: the server computes a merge result and stores it at
refs/pull/{id}/merge; build validation builds exactly this, so a “green PR” means the merged code passes. When the target branch moves forward, the result can be set to “expire” under the policy and must be rebuilt. - Voting: Approve (10), Approve with suggestions (5), No vote (0), Wait for author (−5), Reject (−10).
- Policy evaluation: each policy produces an evaluation record (policy evaluation) with the status queued / running / approved / rejected / notApplicable. A PR can be completed only when all required policies are approved.
- Completing: choose an allowed merge type; you can tick “Delete source branch after completion” and “Complete linked work items” (moves work items to a completed state such as Resolved/Closed). When Auto-complete is set, the server merges automatically once all policies pass.
Four ways to link work items
- Select work items when creating a PR (or
az repos pr create --work-items). - Write
#42in the PR description or a comment; the mention creates a link. - Click “Create a branch / pull request” in the Development area of the work item form.
- Repository settings can turn on “commit mention links” and “commit mention work item resolution” (write
Fixes #42in the commit message, and it is resolved automatically after merging to the default branch); GitHub repositories useAB#42.
When: recommended baseline (main branch)
| Policy | Small team | Regulated / production repositories |
|---|---|---|
| Minimum reviewers | 1, self-approval not allowed | 2, the most recent pusher cannot approve, new pushes reset votes |
| Linked work items | Required | Required |
| Comment resolution | Required | Required |
| Merge types | Squash only | Squash or semi-linear |
| Build validation | Required (added in Lesson 2) | Required + security scan status check |
Comparison with GitHub
| Azure Repos | GitHub | |
|---|---|---|
| Protection mechanism | Branch policies + branch permissions + cross-repository policies | Rulesets (ruleset) / branch protection rules |
| Code owners | Automatic reviewers (path filter) | CODEOWNERS file |
| Work item linking | Native policy enforcement | Requires Actions or third-party tools |
| Signed commits | No built-in “require signed commits” policy | Rulesets can require signed commits |
Structure diagram: policies, permissions and PRs
Sequence diagram: from PR creation to completion
Interactive simulator: PR policy evaluator
The left side shows main's policy configuration, and the right side shows the current state of the PR. Each time you change any item, the evaluator recalculates each policy's result (approved / rejected / running / notApplicable) and judges whether the “Complete” button is available and whether auto-complete would trigger. The log shows the corresponding REST resources.
Command table
| Command | Purpose | Key parameters |
|---|---|---|
az repos policy approver-count create | Minimum reviewers | --minimum-approver-count,--creator-vote-counts,--allow-downvotes,--reset-on-source-push |
az repos policy work-item-linking create | Work item linking required | Common parameters |
az repos policy comment-required create | Comment resolution required | Common parameters |
az repos policy merge-strategy create | Limit merge types | --allow-squash,--allow-no-fast-forward,--allow-rebase,--allow-rebase-merge |
az repos policy required-reviewer create | Automatically include reviewers by path | --required-reviewer-ids,--path-filter |
az repos policy build create | Build validation (Lesson 2) | --build-definition-id,--queue-on-source-update-only,--valid-duration |
az repos policy list | List policies | --repository-id,--branch |
az repos pr create / update / show / list | PR management | --work-items,--auto-complete,--squash,--delete-source-branch,--transition-work-items,--draft |
az repos pr set-vote | Vote | --vote approve|approve-with-suggestions|reset|wait-for-author|reject |
az repos pr policy list | View the PR's policy evaluation | --id |
Common parameters: --repository-id,--branch,--blocking (true = required),--enabled.
REPO_ID=$(az repos show --repository myapp --query id -o tsv)
COMMON="--repository-id $REPO_ID --branch main --blocking true --enabled true"
az repos policy approver-count create $COMMON --minimum-approver-count 1 \
--creator-vote-counts false --allow-downvotes false --reset-on-source-push true
az repos policy work-item-linking create $COMMON
az repos policy comment-required create $COMMON
az repos policy merge-strategy create $COMMON --allow-squash true --allow-no-fast-forward false
az repos policy list --repository-id $REPO_ID --branch main \
--query "[].{id:id, type:type.displayName, blocking:isBlocking}" -o table
Id Type Blocking ---- ------------------------------------ ---------- 1 Minimum number of reviewers True 2 Work item linking True 3 Comment requirements True 4 Require a merge strategy True
# A complete PR: branch → push → create PR (linked work item, auto-complete) → vote → view policies
git switch -c feature/healthz
echo "# healthz returns ok" >> README.md && git commit -am "docs: healthz #$STORY" && git push -u origin feature/healthz
PR=$(az repos pr create --repository myapp --source-branch feature/healthz --target-branch main \
--title "Add /healthz docs" --description "Implements #$STORY" --work-items $STORY \
--auto-complete true --squash true --delete-source-branch true --transition-work-items true --query pullRequestId -o tsv)
az repos pr policy list --id $PR --query "[].{policy:configuration.type.displayName, status:status}" -o table
az repos pr set-vote --id $PR --vote approve # Must be run by a reviewer other than the author (creator-vote-counts=false)
Policy Status ---------------------------- -------- Minimum number of reviewers rejected Work item linking approved Comment requirements approved Require a merge strategy approved
How to verify: After the reviewer approves,az repos pr show --id $PR --query status changes to completed, and the work item is moved to a completed state. Common errors: The author's own approval does not count; the branch name written as refs/heads/main and main are both acceptable, but policy matching is case-sensitive. Production use: Treat policies as code: az repos policy create --config policy.json roll them out to all repositories in bulk.
Goal: Add 4 required policies to myapp's main, verify that a direct push is rejected, and then complete a PR linked to a work item. Environment: A second account is needed as the reviewer (alice, Basic, Contributors). Cost: None.
git switch main && echo x >> README.md && git commit -am "direct push" && git push
remote: error: TF402455: Pushes to this branch are not permitted; you must use a pull request to update this branch. ! [remote rejected] main -> main (TF402455: ...)
git reset --hard HEAD~1 # Undo this local commit
$STORY from Module 4).az repos pr set-vote --id $PR --vote approve in alice's CLI session.az boards work-item show --id $STORY --query fields.\"System.State\" shows Resolved (or the completed state defined by the process); the source branch is deleted.git switch main && git pull.Case 1: protect main across 200 repositories in one go
Problem: Configuring each repository one by one is impractical, and new repositories are often forgotten. Approach: Add cross-repository branch policies under Project settings → Repositories → Policies, applying to the default branch of all repositories; repositories that need exceptions get stricter repository-level policies. Limits: Branch patterns in cross-repository policies are case-sensitive,Main and main are different.
Case 2: infrastructure code must be reviewed by the platform team
Approach: Automatic reviewers policy: path /infra/*;/pipelines/* → required reviewer “[myapp-lab]\Platform”. Effect: When these paths change, the platform team is added automatically and must approve; other paths do not bother them.
Case 3: emergency fix bypasses policies
Problem: An outage in the early morning, with reviewers offline. Approach: Create a “Hotfix Approvers” group, and only this group is allowed “Bypass policies when completing pull requests” on main; the bypass reason must be entered on completion and is recorded in the audit log; review is completed the next day. Limits: Do not give Project Administrators standing bypass permission.
Common errors and fixes
TF402455: Pushes to this branch are not permitted; you must use a pull request to update this branch.
Cause: The branch has a required policy. This is expected behavior.
Fix: Push to a new branch and create a PR; an automation account that genuinely needs to push directly can be granted “Bypass policies when pushing” (use with care).
PR shows “1 of 1 reviewers must approve”, and the author has already approved but it still does not pass
Cause: The policy is set not to count the author's vote (creator-vote-counts=false), or “the most recent pusher cannot approve” is set.
Fix: Ask someone else to review; check az repos pr policy list --id PR.
Work item linking: Required — cannot complete the PR
Cause: The PR is not linked to a work item.
az repos pr work-item add --id $PR --work-items 3
TF401027: You need the Git 'PullRequestContribute' permission to perform this action.
Cause: Commenting, voting or creating a PR requires the “Contribute to pull requests” permission; Readers have it by default, but a group may deny it on the repository.
Fix: Use Why? to find the source of the deny, as in the Module 2 method.
Message when merging: The merge type is not allowed by policy / only Squash can be selected
Cause: The Limit merge types policy allows only some methods.
Fix: Select an allowed method; with the CLI, use --squash true.
1. Add a required policy to myapp's release/* branches: “at least 2 reviewers, new pushes reset votes” (hint: the branch pattern needs --branch-match-type prefix).
az repos policy approver-count create --repository-id $REPO_ID --branch release --branch-match-type prefix \ --blocking true --enabled true --minimum-approver-count 2 --creator-vote-counts false --allow-downvotes false --reset-on-source-push true
2. List the number, title and author of all active PRs in myapp.
az repos pr list --repository myapp --status active --query "[].{id:pullRequestId, title:title, by:createdBy.displayName}" -o tablemain has “minimum 1 reviewer (required)” enabled, but someone can still directly git push --force overwrite main. What could be the cause? How do you close it off completely?
Possible cause: the user, or a group they belong to, was granted the “Bypass policies when pushing” and “Force push” permissions (for example, they were added to a highly privileged custom group, or the permissions were granted to an automation account). Fix: check the Why? for these permissions in main's Security settings, remove unnecessary Allow entries, explicitly Deny Force push for Contributors and Project Administrators; grant Bypass only to one controlled emergency group, with auditing.
Verified teaching videos
Official documentation
- Branch policies and settings
- Create pull requests
- Complete pull requests
- Repository settings and policies
- Git course Lesson 3: Git-side details of Azure Repos
Storyboard script (about 90 seconds)
This courseware cannot directly generate video or MP3 files; a storyboard and narration script are provided.
On screen: in the terminal, git push main is rejected with red text showing TF402455.
Narration: once a required policy is added to main, no one can push directly; changes must go through a pull request.
On screen: the policy list on the right side of the PR page turns from grey to green one by one.
Narration: each policy produces an evaluation record: reviewer count, linked work items, comment resolution, merge type, build validation.
On screen: a virtual merge commit node refs/pull/7/merge, surrounded by pipeline icons.
Narration: build validation builds the pre-merge commit, so green means the merged code is fine.
On screen: the last policy turns green, the PR auto-completes, and the work item card slides into the Resolved column.
Narration: with auto-complete set, the server merges automatically when the last policy passes, and updates the linked work items.
Module 6 · az devops CLI and REST API
- Compare three authentication methods (Microsoft Entra tokens, PATs, service principals / managed identities), and know the purpose of the Azure DevOps resource ID
499b84ac-1321-427f-aa17-267ca6975798. - Be proficient with
az devops,az boards,az repos,az pipelinesfour command groups, and--query/-o tsv. - Read the REST URL structure and
api-versionrules (GA,-preview, resource version number), and handle paging, throttling and common error codes.
What: three authentication methods
| Method | How to obtain it | Request header | Lifetime | Best for |
|---|---|---|---|---|
| Microsoft Entra token (user) | az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798; or interactive sign-in with MSAL | Authorization: Bearer <JWT> | About 1 hour; re-obtained when expired | Temporary scripts and administrator operations; protected by MFA and conditional access |
| Service principal / managed identity | az login --service-principal or az login --identity then obtain tokens the same way; the identity must first be added to the organization and assigned an access level | Bearer | About 1 hour | Background services, pipelines, automation tools (no long-term secret to store) |
| Personal access token (PAT) | User settings → Personal access tokens; choose the organization and scope | Authorization: Basic base64(":"+PAT) (username empty) | Your choice, up to 1 year | Legacy tools and scenarios where Entra cannot be used |
Why: why use the CLI and REST
The web UI suits exploration, but automation must be repeatable: new project setup, bulk policies, license audits, migration scripts, chatbots and internal portals all depend on REST. az devops The extension wraps REST with a default organization/project, automatic detection of the Git remote (--detect) and JMESPath queries; for operations not wrapped, use az devops invoke as a pass-through, which still gets the same authentication.
How: the components of a REST request
VERB https://dev.azure.com/{organization}[/{project}[/{team}]]/_apis[/{area}]/{resource}?api-version={version}
Example:
GET https://dev.azure.com/contoso-lab/_apis/projects?api-version=7.1
POST https://dev.azure.com/contoso-lab/myapp-lab/_apis/wit/wiql?api-version=7.1
GET https://dev.azure.com/contoso-lab/myapp-lab/_apis/git/repositories/myapp/pullrequests?searchCriteria.status=active&api-version=7.1
Some services use separate hosts: vssps.dev.azure.com (users, groups, graph API), vsaex.dev.azure.com (user entitlements / licensing), feeds.dev.azure.com (Artifacts)
| api-version format | Meaning |
|---|---|
7.1 | GA (Azure DevOps Server 2022.1 corresponds to 7.1; the cloud service is compatible with the latest and older versions) |
7.2-preview / 7.2-preview.1 | Preview version; must include -preview; the trailing number is the resource version |
| Omitted | Not recommended: behavior may change as the service is upgraded. The official requirement is that every request includes api-version |
- Paging: most list APIs support
$top/$skip; some return a response headerx-ms-continuationtoken, and the next request includescontinuationToken. WIQL returns only IDs, which are then fetched withworkitems?ids=in batches (up to 200 per batch). - Throttling: calculated by the resources consumed per identity (TSTU); when delayed, the response carries headers
X-RateLimit-Resource,X-RateLimit-RemainingandRetry-After, and clients should respectRetry-After. - Updating work items uses JSON Patch:
Content-Type: application/json-patch+json, with the body[{"op":"add","path":"/fields/System.Title","value":"..."}].
When: which to choose
- Interactive administrative work:
az login+az devops(the underlying layer uses Entra tokens automatically). - Calling Azure DevOps from inside a pipeline: prefer
$(System.AccessToken)(job access token, Lesson 2) or an Azure DevOps service connection with workload identity federation. - Long-running external services: service principals / managed identities.
- Legacy tools that can only use PATs: organization-level, minimal scope, short-lived, stored in a key vault and rotated regularly.
Comparison with GitHub
| Azure DevOps | GitHub | |
|---|---|---|
| CLI | az devops/boards/repos/pipelines (Azure CLI extension) | gh |
| API | REST (versioned via api-version) | REST (X-GitHub-Api-Version) + GraphQL |
| Tokens | Entra tokens, PATs (organization level) | Fine-grained PATs, GitHub App installation tokens |
az login signing in, az devops the commands use the Entra token directly, and az devops login is only used for PATs. ④ “Writing 7.2 is enough for preview APIs” — you must write 7.2-preview, otherwise an error is returned.Architecture diagram: CLI, REST and authentication
Data flow diagram: the two-step WIQL query
Step-by-step animation: the full path of one REST request
Choose an authentication method and a fault to inject, then play step by step. Each step shows a real fragment of the request or response (request headers, status codes, error messages).
Command table
| Command | Purpose | Key parameters |
|---|---|---|
az devops configure | Set / view the default organization and project | --defaults,--list |
az devops login / logout | save / delete a PAT (PAT scenarios only) | --organization; or environment variable AZURE_DEVOPS_EXT_PAT |
az account get-access-token | Obtain an Entra token | --resource 499b84ac-1321-427f-aa17-267ca6975798 |
az devops invoke | Call any REST resource | --area,--resource,--route-parameters,--query-parameters,--http-method,--in-file,--api-version |
az boards ... | Work items, areas, iterations, queries | see Module 4 |
az repos ... | Repositories, policies, PRs, imports, refs | see Module 5 |
az pipelines list / run / runs list | Pipelines (detailed in Lesson 2) | --name,--branch,--parameters |
Method A: Entra token + curl
ORG=contoso-lab TOKEN=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv) curl -s -H "Authorization: Bearer $TOKEN" \ "https://dev.azure.com/$ORG/_apis/projects?api-version=7.1" | jq -r '.value[] | "\(.name)\t\(.visibility)"'
myapp-lab private
Method B: PAT + curl (only when Entra cannot be used)
read -rs AZURE_DEVOPS_EXT_PAT && export AZURE_DEVOPS_EXT_PAT # Enter interactively; keeps it out of shell history
curl -s -u ":$AZURE_DEVOPS_EXT_PAT" "https://dev.azure.com/$ORG/_apis/connectionData?api-version=7.1-preview" \
| jq '{user: .authenticatedUser.providerDisplayName, id: .authenticatedUser.id}'
WIQL + bulk field retrieval
cat > wiql.json <<'EOF'
{ "query": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = 'myapp-lab' AND [System.State] <> 'Closed' ORDER BY [System.ChangedDate] DESC" }
EOF
IDS=$(curl -s -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @wiql.json \
"https://dev.azure.com/$ORG/myapp-lab/_apis/wit/wiql?api-version=7.1&\$top=200" | jq -r '[.workItems[].id] | join(",")')
curl -s -H "Authorization: Bearer $TOKEN" \
"https://dev.azure.com/$ORG/myapp-lab/_apis/wit/workitems?ids=$IDS&fields=System.Id,System.WorkItemType,System.Title,System.State&api-version=7.1" \
| jq -r '.value[] | [.id, .fields."System.WorkItemType", .fields."System.State", .fields."System.Title"] | @tsv'
4 Task New Write unit tests for /healthz 3 User Story Resolved Provide /healthz health check 1 Epic New Observability
The same thing with az devops invoke (authentication applied automatically)
az devops invoke --area wit --resource wiql --route-parameters project=myapp-lab \
--http-method POST --in-file wiql.json --api-version 7.1 --query "workItems[].id" -o tsv
# Create a work item (JSON Patch)
cat > patch.json <<'EOF'
[ {"op":"add","path":"/fields/System.Title","value":"Task created through REST"},
{"op":"add","path":"/fields/System.AreaPath","value":"myapp-lab\\web"} ]
EOF
curl -s -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json-patch+json" -d @patch.json \
"https://dev.azure.com/$ORG/myapp-lab/_apis/wit/workitems/\$Task?api-version=7.1" | jq '{id, rev, state: .fields."System.State"}'
How to verify: A new task appears on Boards, and “Changed By” in History is the identity tied to the token. Common errors: In the shell, $Task gets expanded and must be escaped as \$Task or URL-encoded %24Task; if Content-Type is written as application/json, the response is 415. Production use: Wrap common REST calls into scripts or use the official SDK; for 429/503, respect Retry-After.
Goal: Complete the same set of queries via both the CLI and REST paths, and experience the difference between a PAT and an Entra token. Cost: None. Security: Give the PAT only the Work Items (Read) scope, with a 1-day lifetime, and revoke it immediately after the lab.
echo "$TOKEN" | cut -d. -f2 | tr '_-' '/+' | base64 -d 2>/dev/null | jq '{aud, upn, exp}'
{ "aud": "499b84ac-1321-427f-aa17-267ca6975798", "upn": "you@contoso.com", "exp": 1794729600 }contoso-lab for Organization (do not choose All accessible organizations), Expiration 1 day, Scopes: Work Items → Read.curl -s -o /dev/null -w "%{http_code}\n" -u ":$AZURE_DEVOPS_EXT_PAT" "https://dev.azure.com/$ORG/myapp-lab/_apis/wit/workitems/3?api-version=7.1"
curl -s -o /dev/null -w "%{http_code}\n" -u ":$AZURE_DEVOPS_EXT_PAT" -X POST -H "Content-Type: application/json-patch+json" -d @patch.json \
"https://dev.azure.com/$ORG/myapp-lab/_apis/wit/workitems/\$Task?api-version=7.1"
200 401
curl -s -H "Authorization: Bearer $TOKEN" "https://dev.azure.com/$ORG/_apis/connectionData?api-version=7.1" | head -c 200; echo
In the official examples, connectionData is usually called with a preview version: if an error such as “The -preview flag must be supplied in the api-version for such requests.” is returned, the resource is still in preview at that version; change it to 7.1-preview to fix it. Whether a resource is preview is determined by the REST reference page.
unset AZURE_DEVOPS_EXT_PAT TOKEN; az devops logout (if you used az devops login).Case 1: project initialization script
Problem: Every new project needed 30 minutes of manual clicking: teams, areas, iterations, policies, groups, Wiki. Approach: A bash script chains az devops project create → team create → boards area/iteration → repos policy → security group → wiki create together, running as a service principal (steps that require PCA permissions are approved separately). Limits: Some settings (board columns, inherited-process rules) are not wrapped by the CLI, so call the work/processes API with az devops invoke .
Case 2: cleanup before global PAT retirement
Problem: Audit found 140 global PATs, many belonging to departed employees. Approach: A PCA lists and revokes them using the PAT lifecycle management API or Organization settings → Policies; turn on “Restrict global PAT creation” and “Maximum lifetime 90 days”; migrate scripts to service principals + Entra tokens; Git clients switch to GCM OAuth. Limits: The PAT list API returns only the caller's own PATs, so administrators need a dedicated management interface (follow the official documentation).
Case 3: reporting script throttled
Problem: A nightly report loops over 20,000 work items with individual GETs, which get delayed and time out. Approach: Switch to WIQL + a bulk interface with 200 IDs per batch, or use Analytics OData directly; read Retry-After with backoff and retry. Effect: Request count drops by two orders of magnitude.
Common errors and fixes
Before you can run Azure DevOps commands, you need to run the login command (az login if using AAD/MSA identity else az devops login if using PAT token) to setup credentials.
Cause: The CLI has no usable credentials: not az login, the token has expired, or AZURE_DEVOPS_EXT_PAT was not exported.
az account show -o table || az login --allow-no-subscriptions
HTTP 401 Unauthorized / VS30063: You are not authorized to access https://dev.azure.com
Cause: The PAT has expired or been revoked, its scope is insufficient, the PAT does not belong to this organization (an organization-level PAT is valid for only one organization), or organization policy prohibits this kind of PAT; or the Entra token came from the wrong tenant.
curl -s -o /dev/null -w "%{http_code}\n" -u ":$AZURE_DEVOPS_EXT_PAT" "https://dev.azure.com/$ORG/_apis/projects?api-version=7.1"
az account show --query tenantId -o tsv # Compare with the tenant connected to the organization: Organization settings → Microsoft Entra
Fix: Regenerate an organization-level PAT with minimal scope, or switch to an Entra token; in multi-tenant setups az login --tenant <id>.
HTTP 203 Non-Authoritative Information, returning an HTML sign-in page
Cause: The request was not authenticated (credentials missing or malformed, e.g. the Basic header has no colon), so the service redirects you to the sign-in page.
Fix: Check the request headers: Authorization: Basic base64(":PAT") or Bearer; for curl, use -u ":$PAT".
VssInvalidPreviewVersionException: The requested version "7.1" of the resource is under preview. The -preview flag must be supplied in the api-version for such requests.
Fix: Change it to api-version=7.1-preview (or the value specified in the documentation: -preview.N).
HTTP 429 Too Many Requests, or responses slow down with Retry-After / X-RateLimit-* response headers
Cause: Global throttling was triggered (resource consumption counted per identity).
Fix: Respect Retry-After; switch to bulk APIs; move reports to Analytics; use different identities for different automations to isolate the impact.
1. Using an Entra token, list the titles of all active PRs in the myapp repository (curl).
TOKEN=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv) curl -s -H "Authorization: Bearer $TOKEN" "https://dev.azure.com/$ORG/myapp-lab/_apis/git/repositories/myapp/pullrequests?searchCriteria.status=active&api-version=7.1" | jq -r '.value[].title'
2. Use az devops invoke to list all branch policy configurations of myapp-lab.
az devops invoke --area policy --resource configurations --route-parameters project=myapp-lab --api-version 7.1 --query "value[].{id:id, type:type.displayName}" -o tableA sync service running on an Azure VM reads Boards data every 5 minutes and currently uses an employee's global PAT. Give a migration plan.
Enable a system-assigned managed identity for the VM; in Azure DevOps Organization settings → Users, add the managed identity (assign an access level directly, since group rules do not apply to service principals or managed identities) and add it only to the Readers group of the projects it needs to read; in the service, use the Azure Identity library to obtain a token for the resource 499b84ac-1321-427f-aa17-267ca6975798 and call with Bearer; revoke the old global PAT; turn on organization policies that restrict global PATs and maximum PAT lifetime.
Verified teaching videos
No latest video that covers az devops CLI and Entra token authentication and that can be verified via YouTube oEmbed was found (earlier videos mostly use global PATs as examples, which no longer match current best practices). Follow the official documentation and this module's labs.
Official documentation
- Get started with Azure DevOps CLI
- az devops command reference
- Issue Entra tokens with Azure CLI
- Use personal access tokens
- Azure DevOps REST API reference
- Rate and usage limits
- azure-devops-cli-extension releases
Storyboard script (about 90 seconds)
This courseware cannot directly generate video or MP3 files; a storyboard and narration script are provided.
On screen: typing az login in the terminal brings up Entra sign-in and MFA in the browser.
Narration: Entra sign-in is preferred. The CLI gets a token valid for one hour, protected by multi-factor authentication and conditional access.
On screen: a URL is split into five segments (organization, project, area, resource, api-version), each highlighted in turn.
Narration: every REST address is made up of these segments; api-version must be included, and preview versions add the preview suffix.
On screen: a PAT card labelled “global” is stamped “being retired”, next to two dates.
Narration: global PATs are being retired, and the official dates are inconsistent, so follow the latest release notes. When a PAT is really needed, use only organization-level, least-privilege, short-lived ones.
On screen: two requests: WIQL returns a list of IDs, and the bulk API returns the fields.
Narration: querying work items takes two steps: first get the IDs with WIQL, then fetch the fields in bulk to avoid throttling.
Module 7 · Wiki, dashboards and service hooks
- Distinguish a project Wiki (provisioned) from a code Wiki (published as code), and know their storage, versioning, permissions and editing methods.
- Build dashboards for the team: query tiles, charts, sprint burndown, PR and build widgets, and understand the permission differences between team dashboards and project dashboards.
- Create a service hook subscription (publisher + event + filter + consumer + action), and understand delivery, retries and disabling.
What: two kinds of Wiki
| Project Wiki (Provisioned) | Code Wiki (Published as code) | |
|---|---|---|
| Storage | A hidden Git repository inside the project (named {project name}.wiki), which can be cloned | the repository + branch + folder you specify (for example myapp of /docs) |
| Quantity | One per project | Multiple allowed (per repository, per folder) |
| Editing | Saved directly in the web editor (each save is one commit) | Through the code workflow: branch + PR (protected by branch policies) |
| Versioning | Single version | Multiple branches can be published as different versions (for example release/1.0) |
| Page order | Each folder's .order file | also uses .order |
| Stakeholder | Viewable, but not editable | Not accessible in private projects (requires Repos) |
| Best for | Team handbooks, meeting notes, process descriptions | Design documents, API documents and runbooks that stay in the same version as the code |
Wiki Markdown support: table of contents [[_TOC_]], sub-page list [[_TOSP_]], Mermaid diagrams (::: mermaid … :::),#42 work item references,@ user mentions, math formulas, code block copy buttons; attachments are stored in .attachments folder.
What: dashboards
- Team dashboards and project dashboards two types; edit permissions can be set separately for each dashboard. Adding and configuring project dashboards requires Contributors or above; Stakeholders can only view them.
- Common widgets: Query tile (query count), Chart for work items (chart based on a shared query), Sprint burndown / Sprint overview, Velocity, Cumulative flow diagram, Build history, Deployment status, Pull request, Markdown, Wiki.
- Widgets such as burndown, velocity and cumulative flow are based on Analytics the service's calculations; query charts require the query to be a “flat list” saved as a shared query.
What: service hooks
| Concept | Description | Example |
|---|---|---|
| Publisher | The service that generates the event | tfs (Boards, Repos, Build), Pipelines, Release |
| Event type | Trigger condition | workitem.created,workitem.updated,git.push,git.pullrequest.created,git.pullrequest.merged,build.complete, pipeline run state changes |
| Filter (publisher inputs) | Narrows the scope | Area path, work item type, repository, branch, field changes |
| Consumer + action | Who receives the event, and how | Web Hooks (HTTP POST JSON), Azure Service Bus, Azure Storage Queue, Slack, Jenkins, Trello, Grafana, etc. |
| Subscription | A combination of the four items above; belongs to the project | “New Bug in the web area → POST to the alerting system” |
Why
Wiki keeps knowledge together with the project and under the same permission protection; dashboards let Stakeholders see progress without learning queries; service hooks connect Azure DevOps to an enterprise's chat, alerting, ITSM and automation systems without polling REST (polling is slow and easily throttled).
How: service hook delivery
- An event occurs (for example a PR is created), and the publisher generates an event object.
- It matches the event types and filter conditions of all subscriptions in the project.
- A notification is generated for each matching subscription, and the consumer action is executed (Web Hooks: HTTP POST with the event JSON as the body; basic authentication, custom request headers and resource detail level can be configured).
- A 2xx response counts as success; failures are retried,and a subscription that keeps failing enters probation and may be disabled automatically (see the official documentation for the exact retry count and interval). Each delivery's request and response can be viewed under Project settings → Service hooks → History.
When
- Team conventions and processes → project Wiki; documentation that follows the code version → code Wiki (stored in
/docs, reviewed via PR). - Only need notifications to Teams/email → consider the built-in Notifications first, which are simpler than service hooks; need to drive an external system → service hooks.
- High-reliability integration → use Azure Service Bus / Storage Queue as the consumer, and let downstream systems consume and retry on their own.
git clone. ② “Service hooks can deliver to internal addresses” — the service sends requests from the Microsoft cloud, so the target must be publicly reachable (for internal systems, relay through Service Bus / a queue, or use a gateway). ③ “The Webhook body contains the full work item” — by default it includes resource details, but how many fields are included depends on the “resource detail level” setting, so consider the risk of leaking sensitive fields. ④ “Dashboard charts can use WIQL tree queries directly” — query charts require a flat-list query.Structure diagram: the two kinds of Wiki storage
Data flow diagram: service hooks
Step-by-step animation: service hook delivery and retries
Select the endpoint behavior, then play. The animation shows event matching, the HTTP request body, the endpoint response, failure retries and changes in subscription status.
Command table
| Command | Purpose | Key parameters |
|---|---|---|
az devops wiki create | Create a project Wiki or publish a code Wiki | --type projectwiki|codewiki,--repository,--mapped-path,--version |
az devops wiki list / show | List / view Wikis | --wiki |
az devops wiki page create / show / update / delete | Create, read, update and delete pages | --path,--content or --file-path,--version (an ETag version must be supplied when updating) |
az devops invoke --area hooks --resource subscriptions | Service hook subscriptions (not wrapped by the CLI) | --http-method POST,--in-file |
az devops invoke --area dashboard --resource dashboards | Dashboards (not wrapped by the CLI) | --route-parameters project=… team=… |
# Project Wiki + one runbook page
az devops wiki create --name myapp-lab.wiki --type projectwiki
az devops wiki page create --wiki myapp-lab.wiki --path "Runbook" \
--content $'# myapp runbook\n\n[[_TOC_]]\n\n## Health check\n`GET /healthz` returns `ok`. Related story: #'"$STORY"$'\n'
# Code Wiki: publish the /docs folder of the main branch of the myapp repository (the folder must already exist and be committed)
az devops wiki create --name myapp-docs --type codewiki --repository myapp --mapped-path /docs --version main
az devops wiki list --query "[].{name:name, type:type, repo:repositoryId}" -o table
# Updating a page requires the ETag (version)
ETAG=$(az devops wiki page show --wiki myapp-lab.wiki --path "Runbook" --query eTag -o tsv)
az devops wiki page update --wiki myapp-lab.wiki --path "Runbook" --version "$ETAG" --file-path ./runbook.md
Name Type Repo -------------- ----------- ------------------------------------ myapp-lab.wiki projectWiki 5e3a2f8c-… myapp-docs codeWiki 9b1d4c77-…
Service hook: POST to the Webhook when a Bug is created in the web area
PROJ_ID=$(az devops project show --project myapp-lab --query id -o tsv)
cat > hook.json <<EOF
{
"publisherId": "tfs",
"eventType": "workitem.created",
"resourceVersion": "1.0",
"consumerId": "webHooks",
"consumerActionId": "httpRequest",
"publisherInputs": { "projectId": "$PROJ_ID", "workItemType": "Bug", "areaPath": "\\\\myapp-lab\\\\web" },
"consumerInputs": { "url": "https://example.com/hooks/azdo" }
}
EOF
az devops invoke --area hooks --resource subscriptions --http-method POST --in-file hook.json --api-version 7.1 \
--query "{id:id, status:status, eventType:eventType}"
az devops invoke --area hooks --resource subscriptions --api-version 7.1 \
--query "value[].{id:id, event:eventType, consumer:consumerId, status:status}" -o table
{ "eventType": "workitem.created", "id": "c3e0a5f2-…", "status": "enabled" }
How to verify: Create a new Bug in the web area; under Project settings → Service hooks → that subscription → History, you should see one request and a 200 response. Common errors: Backslash escaping in area paths (in JSON it is \\, and the heredoc adds another layer); if you are unsure of the input names, create one subscription in the web UI, then use GET subscriptions to inspect its publisherInputs and use it as a template (most reliable). Production use: Store subscription definitions in the repository and deploy them to each project through scripts.
Goal: Create a project Wiki and a runbook page, create a team dashboard, create a Webhook subscription, and observe the delivery history. Cost: None. Security: The Webhook endpoint can be an HTTPS service you control (for example a temporary Azure Function, or a test service such as webhook.site — do not send sensitive data, and delete the subscription after the lab). Permissions: Creating a service hook subscription requires Project Administrators (or being granted permission to edit subscriptions).
az boards query --wiql "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject]=@project AND [System.IterationPath]=@CurrentIteration('[myapp-lab]\web Team')" -o table
# In the web Queries page, save that query as Shared Queries/Current sprintaz boards work-item create --type Bug --title "healthz intermittent 500" --area 'myapp-lab\web'In the JSON received by the endpoint,
eventType is workitem.created,resource.fields contains the title and area.SUB=$(az devops invoke --area hooks --resource subscriptions --api-version 7.1 --query "value[?eventType=='workitem.created'].id | [0]" -o tsv) az devops invoke --area hooks --resource subscriptions --route-parameters subscriptionId=$SUB --http-method DELETE --api-version 7.1
Case 1: on-call runbook kept in a code Wiki
Problem: The runbook lives in the project Wiki, and it often drifts out of step with the code. Approach: Put /docs/runbook into the myapp repository and publish it as a code Wiki; changes go through PRs and branch policies; release branches release/* serve as historical versions. Limits: Stakeholders (such as an on-call manager) cannot see the code Wiki in a private project; they need Basic, or a summary placed in the project Wiki.
Case 2: Bugs enter ITSM automatically
Problem: Production Bugs must be synced to ServiceNow tickets. Approach: Service hook workitem.created / workitem.updated (filter Bug + tag prod) → Azure Service Bus queue → integration function consumes and calls the ITSM API; the ticket number is written back to a work item field (REST PATCH). Effect: Messages are kept in the queue when the endpoint fails, so consecutive Webhook failures do not get the subscription disabled.
Case 3: management dashboard
Approach: The project dashboard holds each team's Velocity, Cumulative flow, delivery plan links and Deployment status, and is opened for viewing to Stakeholders. Limits: Analytics has processing latency, so data may be several minutes behind real time; Stakeholders in private projects cannot see query charts.
Common errors and fixes
Service hook subscription status changes to “Disabled due to failures” / On probation
Cause: The endpoint keeps returning non-2xx responses, times out, or has an invalid certificate.
Fix: Check the request and response in the subscription's History; after fixing the endpoint, re-enable the subscription (Enable); the endpoint should return 2xx quickly, with long-running work moved to a queue.
The Webhook endpoint receives no requests
Cause: The event does not match the filter (area path, work item type, repository, branch); the endpoint is unreachable from the internal network; the firewall does not allow it.
Fix: Send a test notification with the “Test” button on the subscription page; loosen the filter to verify; for internal systems, switch to relaying through Service Bus.
Updating a Wiki page fails: The page '…' specified in the update operation has been changed. Please refresh and try again. (version mismatch)
Cause: The update did not supply an ETag, or supplied a stale one (--version).
Fix: First run az devops wiki page show to fetch the latest eTag, then update.
Dashboard widget shows “This widget requires a shared query” / the chart cannot select a query
Cause: The query is saved in My Queries, or it is a tree or direct-link query.
Fix: Save it as a flat-list query under Shared Queries.
1. List the contents of the Runbook page in the myapp-lab project Wiki.
az devops wiki page show --wiki myapp-lab.wiki --path "Runbook" --include-content --query page.content -o tsv
2. List all service hook subscriptions and their status.
az devops invoke --area hooks --resource subscriptions --api-version 7.1 --query "value[].{event:eventType, consumer:consumerId, status:status}" -o tableThe team wants to notify the internal release system every time a PR is merged to main (it must not be exposed to the internet). How would you design this?
Service hooks originate from the Microsoft cloud and cannot reach the internal network directly. Solution: subscribe git.pullrequest.merged (filter repository myapp, target branch main), with Azure Service Bus (or Storage Queue) as the consumer; the internal release system actively connects to the queue and consumes messages (an outbound connection is enough); alternatively, use a self-hosted agent (inside the internal network) in the pipeline to call the release system during the CI run after merge.
Verified teaching videos
No video specifically covering Azure DevOps Wikis and service hooks that can be verified via YouTube oEmbed was found. The comprehensive video has a brief tour of Wikis and dashboards:
Official documentation
- Provisioned wiki vs. published code as a wiki
- Markdown syntax for wikis
- About dashboards, charts, reports, and widgets
- Integrate with service hooks
- Service hook events
- Troubleshoot service hooks
Storyboard script (about 80 seconds)
This courseware cannot directly generate video or MP3 files; a storyboard and narration script are provided.
On screen: a Wiki page opens, revealing a Git repository icon behind it.
Narration: a project Wiki is actually a hidden Git repository, while a code Wiki publishes the documentation folder in the repository directly.
On screen: the burndown chart, query tile and PR widget appear on the dashboard one after another.
Narration: dashboards visualize queries and analytics data, so people who don't write queries can still follow progress.
On screen: after a Bug is created, an envelope flies from Azure DevOps to an external system and returns a green 200.
Narration: service hooks push events to external systems; a 200 response means success.
On screen: the envelope repeatedly hits a wall and turns red, and the subscription switch turns off automatically.
Narration: when an endpoint keeps failing, the subscription is paused or even disabled; for reliable integration, relay through a queue.
Module 8 · Collaboration readiness review and troubleshooting basics
- Use a 12-item checklist to review whether a project is “ready to hand over to the team”, and use the CLI to check most of the items automatically.
- Master the five-layer troubleshooting method: authentication → organization membership and access level → project membership → object permissions → policies / rules.
- Quickly locate the most common collaboration problems: TF401027, 403/401, project not found, insufficient license, invalid PAT.
What: the 12 items of the collaboration readiness review
| # | Check item | Standard | How to check |
|---|---|---|---|
| 1 | Organization connected to an Entra tenant | Use a work account; access ends when the person leaves | Organization settings → Microsoft Entra |
| 2 | PCA members | 2–3 people, no shared accounts | az devops security group membership list (organization level) |
| 3 | Access levels assigned through group rules | Entra group → Basic/Stakeholder | Organization settings → Users → Group rules |
| 4 | Project members added through groups | No ACEs granted directly to individuals | Security page / permission audit script |
| 5 | Valid Users default permissions unchanged | View project-level information not denied | Project settings → Permissions |
| 6 | Teams, areas and iterations configured | Each team has a default area, plus the current and next sprint | az boards area/iteration team list |
| 7 | Process customized (if needed) | Use an inherited process; do not change the system process | az devops project show |
| 8 | Branch policies for main | Reviewers, linked work items, comment resolution, merge types (build validation is added in Lesson 2) | az repos policy list |
| 9 | Branch permissions for main | Force push denied; Bypass granted only to the emergency group | Branch Security |
| 10 | PAT policy | Restrict global PATs, limit maximum lifetime; use service principals for automation | Organization settings → Policies / Entra tenant policies |
| 11 | Wiki and dashboards | Project Wiki home page, runbook, team dashboard | az devops wiki list |
| 12 | Notifications and integrations | Team notifications, necessary service hooks, no failing subscriptions | Project settings → Service hooks |
Why: why troubleshoot in layers
Reports of the form “I can't open it / can't push / can't see it” may come from five completely different layers. Ruling them out in order avoids dangerous “fixes” such as “just add him to Project Administrators and see”.
How: the five-layer troubleshooting method
| Layer | Typical symptoms | Typical errors | First diagnostic command |
|---|---|---|---|
| 1 Authentication | CLI/script 401; browser repeatedly asks for sign-in; returns HTML | VS30063, HTTP 401/203, “you need to run the login command” | az account show; curl -w "%{http_code}" |
| 2 Organization membership and access level | Organization won't open; Repos / Test Plans missing from the menu | TF400813; “You don't have access” | az devops user show --user … |
| 3 Project membership | Project “not found” | VS800075, TF200016 (project not found) | az devops project list (as that user) |
| 4 Object permissions | Can view but not edit; push rejected; query folder not visible | TF401027, HTTP 403 | az devops security permission show; Why? |
| 5 Policies / rules | Direct push rejected; PR cannot be completed; work item cannot be saved | TF402455, TF401320 (rule validation) | az repos pr policy list; work item rules |
When
Hold a review before project handover, every quarter, and after organization restructuring; for any access ticket, first locate the layer using the five-layer method, then change the smallest layer possible.
Layer diagram: the five gates an access must pass
Review flow chart
Interactive: collaboration readiness review scorer
Tick off the conditions that myapp-lab currently meets, one by one. The scorer gives the total score, the highest-risk missing items, and the corresponding fix commands. Tick states are saved in this browser.
Command table (common for troubleshooting)
| Command | Layer it is used for | Description |
|---|---|---|
az account show | 1 Authentication | Current signed-in identity and tenant |
curl -s -o /dev/null -w "%{http_code}" … | 1 Authentication | Quick check of 200/203/401/403 |
az devops user show --user | 2 Licensing | Access level, source, status, last access time |
az devops security group membership list --id <user> --relationship memberof | 3 Membership | Which groups the user belongs to |
az devops security permission show | 4 Permissions | Effective permissions and inheritance source |
az repos policy list / az repos pr policy list | 5 Policies | Branch policies and PR evaluation |
az ... --debug | All | Print the actual REST requests and responses, to locate CLI problems |
Readiness review check script (checks 8 items automatically)
#!/usr/bin/env bash
# ready-check.sh — read-only check, makes no changes
set -u
P=myapp-lab; R=myapp
ok(){ echo " [OK] $1"; }; bad(){ echo " [MISS] $1"; }
echo "== myapp-lab collaboration readiness review =="
PROC=$(az devops project show --project $P --query capabilities.processTemplate.templateName -o tsv)
[ -n "$PROC" ] && ok "Process: $PROC" || bad "Cannot read project"
[ "$(az devops team list --query 'length(@)' -o tsv)" -ge 2 ] && ok "Teams ≥ 2" || bad "Only the default team"
[ "$(az boards area team list --team web --query 'length(values)' -o tsv 2>/dev/null || echo 0)" -ge 1 ] && ok "web team has areas" || bad "web team has no areas"
[ "$(az boards iteration team list --team web --query 'length(@)' -o tsv 2>/dev/null || echo 0)" -ge 2 ] && ok "web team has ≥2 sprints" || bad "Not enough sprints"
RID=$(az repos show --repository $R --query id -o tsv)
N=$(az repos policy list --repository-id $RID --branch main --query "length([?isBlocking])" -o tsv)
[ "$N" -ge 3 ] && ok "main has $N required policies" || bad "main has only $N required policies"
[ "$(az devops wiki list --query 'length(@)' -o tsv)" -ge 1 ] && ok "Wiki exists" || bad "No Wiki"
PCA=$(az devops security group list --scope organization --query "graphGroups[?displayName=='Project Collection Administrators'].descriptor" -o tsv)
C=$(az devops security group membership list --id "$PCA" --query 'length(keys(@))' -o tsv)
[ "$C" -le 3 ] && ok "$C PCA members" || bad "$C PCA members (≤3 recommended)"
F=$(az devops invoke --area hooks --resource subscriptions --api-version 7.1 --query "length(value[?status!='enabled'])" -o tsv)
[ "$F" -eq 0 ] && ok "All service hooks enabled" || bad "$F service hooks not enabled"
echo "Manual checks: Entra connection, group rules, Valid Users default permissions, PAT policy"
== myapp-lab collaboration readiness review == [OK] Process: Agile [OK] Teams ≥ 2 [OK] web team has areas [OK] web team has ≥2 sprints [OK] main has 4 required policies [OK] Wiki exists [OK] 1 PCA member [OK] All service hooks enabled Manual checks: Entra connection, group rules, Valid Users default permissions, PAT policy
PCA group members may include other groups (for example, the group the organization owner belongs to); expand nested groups when counting. --debug The output includes request headers; remove tokens before sharing logs.
Goal: Deliberately create 3 typical faults, locate them with the five-layer method, and fix them. Environment: myapp-lab + alice (Basic) + pm (can be re-added as Stakeholder). Cost: None.
AZURE_DEVOPS_EXT_PAT=invalid az devops project list -o table 2>&1 | tail -2
curl -s -o /dev/null -w "%{http_code}\n" -u ":invalid" "https://dev.azure.com/$ORG/_apis/projects?api-version=7.1"
Observe 401 (or 203). Fix: unset the variable and switch to az login. Note: a PAT in an environment variable takes precedence over the credentials of az login credentials are used.
az devops user update --user alice@contoso.com --license-type stakeholder
alice's Repos menu disappears and the clone fails. Use az devops user show to locate it, then change it back to express.
ready-check.sh, tick the results in the scorer on the “Animation” page, and write the score to the Wiki page “Readiness review”.Case 1: everyone gets 401 on Monday morning
Symptom: The CI scripts and developers' npm and Git all get 401. Diagnosis: Layer 1; all the credentials came from one service account's global PAT, which expired over the weekend. Fix: Reissue an organization-level PAT in the short term; in the long term switch to service principals + Entra tokens, use GCM OAuth for Git, and use System.AccessToken for pipelines. Prevention: PAT expiry alerts; organization policy restricting global PATs.
Case 2: new employee “can't see the project”
Diagnosis: Layer 2 is fine (Basic, from a group rule); Layer 3: the group rule assigned only the access level, without the project membership option ticked. Fix: Edit the group rule, add myapp-lab → Contributors, and Re-evaluate.
Case 3: a PR can never be completed
Diagnosis: Layers 1–4 are all fine; Layer 5: az repos pr policy list shows “Comment requirements: rejected”, because a comment that had been marked “Won't fix” was reactivated. Fix: Resolve the comment; the team agrees to close comment threads with “Resolved / Won't fix”.
Interactive troubleshooting tree: collaboration issues
Answer the questions step by step, starting from the symptom; the tree gives the diagnosis, commands and fix.
Quick reference: common errors
TF401027: You need the Git 'GenericContribute' permission to perform this action.
Layer 4. Use the Module 2 method to view effective permissions and Why?; check branch-level Deny and Readers-only memberships.
TF200016: The following project does not exist: myapp-lab. Verify that the name of the project is correct and that the project exists on the specified Azure DevOps Server.
Layer 3 (or the project name is misspelled / renamed / deleted). az devops project list Run as that user; a project administrator adds the user to Readers/Contributors; a deleted project can be recovered from the recycle bin within 28 days.
HTTP 403 Forbidden (REST), while the same user can see the resource in the web UI
Layer 4 or token scope: the PAT lacks the scope the API requires (for example, it was given only Work Items Read but calls the Code API); or a management interface requiring higher permissions was called. Retry with an Entra token to compare.
Insufficient license: the user can sign in but lacks Repos / Test Plans / backlog ordering
Layer 2. az devops user show Check the access level and its source; Stakeholder → Basic; Test Plans → Basic + Test Plans.
1. Check alice's access level and license source.
az devops user show --user alice@contoso.com --query "accessLevel.{level:licenseDisplayName, source:assignmentSource, status:status}"2. Use --debug to find out az repos list the REST URLs that are actually called.
az repos list --debug 2>&1 | grep -Eo "https://dev.azure.com/[^ ']+_apis/git/repositories[^ ']*" | head -1
An outsourced developer reports: “I could push yesterday; today the push reports TF401027, and Repos looks normal in the web UI.” Give the troubleshooting order using the five-layer method, and the most likely cause.
Layer 1: they can see Repos, so authentication is fine; Layer 2: the Repos menu is present, so the access level is at least Basic; Layer 3: they can open the repository, so project membership is fine; Layer 4 (most likely): yesterday they were added to a group that denies Contribute on the repository or branch (for example, the Entra group sg-vendors synced to Contractors), or an administrator set an explicit Deny on the branch. Use Security → Why? or az devops security permission show to confirm the source and correct it. Layer 5 policies affect only direct pushes to main (TF402455), which is different from TF401027.
Verified teaching videos
No video specifically covering Azure DevOps collaboration troubleshooting that can be verified via YouTube oEmbed was found. For review, you can watch:
Official documentation
- Troubleshoot permissions
- Troubleshoot access with Microsoft Entra ID
- Access, export, and filter audit logs
- Manage PATs with policies
Storyboard script (about 90 seconds)
This courseware cannot directly generate video or MP3 files; a storyboard and narration script are provided.
On screen: five doors lined up in order: authentication, licensing, project, permissions, policies.
Narration: every access problem has to pass through these five doors; start from the first one when troubleshooting.
On screen: curl in the terminal returns 401, with “Layer 1” written beside it.
Narration: a 401, or a sign-in page returned, is an authentication problem; check whether the token has expired or belongs to another organization.
On screen: the TF401027 error and the Why? pop-up side by side.
Narration: TF401027 is a permission problem; click Why to find which group the denial comes from.
On screen: the twelve checklist items are ticked off one by one, and the score bar turns green.
Narration: run the twelve-item review before handing over to the team, and write the results into the Wiki.
Command cheat sheet
1. Install and sign in
az extension add --name azure-devops az login --allow-no-subscriptions az devops configure --defaults \ organization=https://dev.azure.com/$ORG project=myapp-lab az devops configure --list # PAT scenarios only export AZURE_DEVOPS_EXT_PAT=*** # or az devops login
2. Projects and teams
az devops project create --name myapp-lab --process Agile \ --visibility private --source-control git az devops project list -o table az devops team create --name web az devops team list-member --team web -o table
3. Security groups and permissions
az devops security group list --project myapp-lab az devops security group create --name Contractors --project myapp-lab az devops security group membership add --group-id $GRP --member-id u@x.com GIT_NS=2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87 az devops security permission show --id $GIT_NS --subject u@x.com \ --token "repoV2/$PROJ_ID/$REPO_ID" az devops security permission update --id $GIT_NS --subject $GRP \ --token "repoV2/$PROJ_ID/$REPO_ID" --deny-bit 4 az devops security permission reset ... --permission-bit 4
4. Users and licensing
az devops user list --top 100 -o table az devops user add --email-id u@x.com --license-type stakeholder az devops user update --user u@x.com --license-type express # Basic az devops user update --user u@x.com --license-type advanced # +Test Plans az devops user remove --user u@x.com --yes
5. Boards
az boards area project create --name web az boards area team add --team web --path '\myapp-lab\web' --set-as-default az boards iteration project create --name "Sprint 1" \ --start-date 2026-11-16 --finish-date 2026-11-27 az boards iteration team add --team web --id $ITER_GUID az boards work-item create --type "User Story" --title "..." \ --area 'myapp-lab\web' --iteration 'myapp-lab\Sprint 1' az boards work-item relation add --id 3 --relation-type parent --target-id 1 az boards query --wiql "SELECT [System.Id] FROM WorkItems WHERE ..."
6. Repos and PRs
az repos create --name myapp az repos import create --git-source-url https://github.com/o/r.git --repository myapp C="--repository-id $REPO_ID --branch main --blocking true --enabled true" az repos policy approver-count create $C --minimum-approver-count 1 \ --creator-vote-counts false --allow-downvotes false --reset-on-source-push true az repos policy work-item-linking create $C az repos policy comment-required create $C az repos policy merge-strategy create $C --allow-squash true az repos pr create --source-branch feature/x --target-branch main \ --work-items 3 --auto-complete true --squash true --transition-work-items true az repos pr set-vote --id 7 --vote approve az repos pr policy list --id 7 -o table
7. REST templates
TOKEN=$(az account get-access-token \ --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv) H="Authorization: Bearer $TOKEN" B=https://dev.azure.com/$ORG curl -s -H "$H" "$B/_apis/projects?api-version=7.1" curl -s -H "$H" -H "Content-Type: application/json" -d @wiql.json \ "$B/myapp-lab/_apis/wit/wiql?api-version=7.1" curl -s -H "$H" "$B/myapp-lab/_apis/wit/workitems?ids=1,3&api-version=7.1" curl -s -H "$H" "$B/myapp-lab/_apis/git/repositories/myapp/pullrequests?api-version=7.1" curl -s -H "$H" "$B/myapp-lab/_apis/policy/configurations?api-version=7.1" # PAT: curl -u ":$PAT" ...
8. Wiki and service hooks
az devops wiki create --name myapp-lab.wiki --type projectwiki az devops wiki create --name myapp-docs --type codewiki \ --repository myapp --mapped-path /docs --version main az devops wiki page create --wiki myapp-lab.wiki --path Runbook --file-path runbook.md az devops invoke --area hooks --resource subscriptions \ --http-method POST --in-file hook.json --api-version 7.1 az devops invoke --area hooks --resource subscriptions --api-version 7.1 -o table
Quick troubleshooting table
| Symptom / error | Layer | Most likely cause | First step |
|---|---|---|---|
| HTTP 401, VS30063, HTML sign-in page returned (203) | Authentication | PAT expired / revoked / wrong organization; malformed request header | curl -w "%{http_code}"; switch to an Entra token |
| “you need to run the login command” | Authentication | CLI has no credentials | az login --allow-no-subscriptions |
| TF400813 not authorized to access this resource | Organization | User is not in the organization, or the wrong account was used | Administrator az devops user show |
| Repos / Test Plans menu missing | Licensing | Stakeholder; no Test Plans license; service turned off | az devops user show; Project settings → Overview |
| No hosted parallelism has been purchased or granted | Billing | Billing not set up; hosted free allowance not enabled | Set up billing or use a self-hosted agent |
| VS800075 / TF200016 project does not exist | Project membership | No View project-level information; wrong project name | Add to Readers/Contributors |
| TF401027 GenericContribute / PullRequestContribute | Permissions | A group is denied on the repository / branch | Security → Why? |
| TF402455 Pushes to this branch are not permitted | Policies | Branch has a required policy | Go through a PR |
| TF401347 Invalid tree name | Data | Area / iteration path does not exist or has the wrong format | az boards area project list |
| -preview flag must be supplied | API | Preview resource missing -preview | Change api-version=7.x-preview |
| HTTP 429 / Retry-After | API | Throttling | Back off and retry; bulk APIs |
| Service hook Disabled / probation | Integration | Endpoint keeps failing | Check History; enable again after fixing |
Recommended configuration snippets
main branch baseline (policy configuration file, used with az repos policy create)
{
"isEnabled": true,
"isBlocking": true,
"type": { "id": "fa4e907d-c16b-4a4c-9dfa-4906e5d171dd" },
"settings": {
"minimumApproverCount": 1,
"creatorVoteCounts": false,
"allowDownvotes": false,
"resetOnSourcePush": true,
"scope": [ { "repositoryId": null, "refName": "refs/heads/main", "matchKind": "Exact" } ]
}
}fa4e907d-… is the “Minimum number of reviewers” policy type ID; repositoryId: null means all repositories in the project. You can first az repos policy show --id 1 export existing policies as a template.
Team and permission baseline
Organization
PCA: 2–3 protected administrator accounts
Group rules: sg-eng → Basic + project Contributors
sg-business → Stakeholder + project Contributors
Policies: restrict global PATs, PAT maximum 90 days, disallow public projects
Project myapp-lab (Agile-myapp inherited process)
Teams: web, api (each with its default area + Sprint 1..n)
Group: Contractors (repository-level Allow for specified repositories)
Hotfix Approvers (main: Bypass policies, audited)
main: reviewers ≥1, linked work items, comment resolution, Squash,
Force push = Deny (Contributors, Project Admins)
Wiki: project Wiki (handbook) + code Wiki /docs (runbooks)Capstone lab + final quiz
myapp-final, for the web team. Requirements: Agile process; the web team owns areas myapp-final\web and two sprints; the Contractors group can only read the myapp repository; main has 4 required policies; one user story is implemented through a PR and resolved automatically; finally, generate an acceptance report with REST. All steps must be scriptable (no web UI, except for review votes).set -euo pipefail ORG=contoso-lab; P=myapp-final az devops configure --defaults organization=https://dev.azure.com/$ORG project=$P az devops project create --name $P --process Agile --visibility private --source-control git az repos create --name myapp az repos import create --git-source-url https://github.com/<your-account>/myapp.git --repository myapp az devops team create --name web
az boards area project create --name web az boards area team add --team web --path "\\$P\\web" --set-as-default --include-sub-areas true for s in "Sprint 1:2026-11-16:2026-11-27" "Sprint 2:2026-11-30:2026-12-11"; do IFS=: read -r name start end <<< "$s" az boards iteration project create --name "$name" --start-date $start --finish-date $end -o none id=$(az boards iteration project list --depth 1 --query "children[?name=='$name'].identifier" -o tsv) az boards iteration team add --team web --id $id -o none done az boards iteration team list --team web -o table
PROJ_ID=$(az devops project show --project $P --query id -o tsv) REPO_ID=$(az repos show --repository myapp --query id -o tsv) GIT_NS=2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87 az devops security group create --name Contractors --project $P -o none GRP=$(az devops security group list --project $P --query "graphGroups[?displayName=='Contractors'].descriptor" -o tsv) az devops security permission update --id $GIT_NS --subject "$GRP" --token "repoV2/$PROJ_ID/$REPO_ID" --allow-bit 2 -o none # Read az devops security permission update --id $GIT_NS --subject "$GRP" --token "repoV2/$PROJ_ID/$REPO_ID" --deny-bit 4 -o none # Contribute
C="--repository-id $REPO_ID --branch main --blocking true --enabled true" az repos policy approver-count create $C --minimum-approver-count 1 --creator-vote-counts false --allow-downvotes false --reset-on-source-push true -o none az repos policy work-item-linking create $C -o none az repos policy comment-required create $C -o none az repos policy merge-strategy create $C --allow-squash true --allow-no-fast-forward false -o none
EPIC=$(az boards work-item create --type Epic --title "Observability" --area "$P\\web" --query id -o tsv) STORY=$(az boards work-item create --type "User Story" --title "Provide /healthz" --area "$P\\web" --iteration "$P\\Sprint 1" \ --fields "Microsoft.VSTS.Scheduling.StoryPoints=3" --query id -o tsv) az boards work-item relation add --id $STORY --relation-type parent --target-id $EPIC -o none
git clone "$(az repos show --repository myapp --query remoteUrl -o tsv)" myapp-final && cd myapp-final git switch -c feature/healthz-$STORY printf '\n## Health\n`GET /healthz` -> ok\n' >> README.md git commit -am "docs: healthz (#$STORY)" && git push -u origin HEAD PR=$(az repos pr create --source-branch feature/healthz-$STORY --target-branch main --title "healthz docs" \ --work-items $STORY --auto-complete true --squash true --delete-source-branch true --transition-work-items true \ --query pullRequestId -o tsv) echo "Ask a reviewer to approve PR !$PR"
TOKEN=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv)
H="Authorization: Bearer $TOKEN"; B="https://dev.azure.com/$ORG/$P/_apis"
echo "Teams:"; curl -s -H "$H" "https://dev.azure.com/$ORG/_apis/projects/$P/teams?api-version=7.1" | jq -r '.value[].name'
echo "Policies:"; curl -s -H "$H" "$B/policy/configurations?api-version=7.1" | jq -r '.value[] | "\(.type.displayName)\tblocking=\(.isBlocking)"'
echo "PR:"; curl -s -H "$H" "$B/git/repositories/myapp/pullrequests/$PR?api-version=7.1" | jq -r '"\(.pullRequestId) \(.status) \(.mergeStatus // "")"'
echo "Story:"; curl -s -H "$H" "$B/wit/workitems/$STORY?\$expand=relations&api-version=7.1" \
| jq -r '"\(.id) \(.fields."System.State") links=\([.relations[]?.attributes.name] | join(","))"'
Teams: myapp-final Team web Policies: Minimum number of reviewers blocking=true Work item linking blocking=true Comment requirements blocking=true Require a merge strategy blocking=true PR: 12 completed succeeded Story: 2 Resolved links=Parent,Pull Request,Commit
PID=$(az devops project show --project myapp-final --query id -o tsv) az devops project delete --id $PID --yes # Goes to the recycle bin; recoverable within 28 days
Acceptance checklist
Open-ended self-check
1. Why is it said that “a team is not a security boundary”? If the web team should be able to edit only work items in its own area, what should you do?
A team only decides the view and cadence. To restrict editing, set permissions on the area paths: make Contributors read-only on the root area (or deny “Edit work items in this node” to the relevant group), and on web area, explicitly allow the web team's security group; note that a Deny from another group on the same scope still takes precedence.
2. A user belongs to both Readers and Contributors, and Readers has no settings at the repository level. Can they push? What if Readers is denied Contribute at the repository level?
In the first case, yes: Readers is Not set, which does not override Contributors' Allow. In the second case, no: Deny takes precedence on the same scope.
3. A team of 50 has 20 business users who only look at boards. How can you minimize licensing cost without hurting collaboration?
Set business users to Stakeholder (free; in private projects they have no Repos, cannot reorder the backlog, and cannot view query charts; upgrade those who need it to Basic); developers preferably use the access included with VS / GitHub Enterprise; assign automatically with Entra group rules; regularly downgrade idle Basic users.
4. Explain the significance of the pre-merge commit (refs/pull/{id}/merge) for build validation.
Build validation builds the “result of merging the source branch into the target branch”, which catches merge conflicts and integration problems early; when the target branch changes, the result may expire and must be rebuilt according to the policy.
5. Why call the workitems API again after a WIQL query?
WIQL returns only IDs (and links); the fields must be fetched with a bulk API (up to 200 IDs per batch), which reduces load and avoids throttling.
6. The company requires that no automation uses a PAT. Give an authentication scheme for each of three scenarios: “creating work items inside a pipeline”, “an external service reading Boards”, and “an administrator's temporary script”.
Inside a pipeline: use the job access token $(System.AccessToken) (and grant the build service identity the required permissions), or an Azure DevOps service connection with workload identity federation; external service: a service principal or managed identity to obtain an Entra token (the identity must be added to the organization and assigned an access level directly); administrator script: az login + az account get-access-token --resource 499b84ac-….
Sources and version notes
| Topic | Verified conclusion | Source (accessed 2026-11-15) |
|---|---|---|
| Permission states and inheritance | Seven states; within the same scope, Deny generally takes precedence over Allow; an explicit value for the same identity on a child node replaces the value inherited from the parent; Not set neither grants nor overrides; do not change the default permissions of Valid Users; Entra group changes sync within about 1 hour | About permissions and security groups(ms.date 2026-09-18) |
| Default security groups | List of default groups at project and organization level; PCA manages projects, policies, processes, retention, agent pools and extensions | Same as above;Default permissions quick reference |
| Stakeholder capabilities | Private projects: Boards part, no Repos, full Pipelines, no Test Plans, full Artifacts, project Wiki read-only, no code Wiki | Stakeholder access quick reference(ms.date 2026-04-13) |
| Prices | Basic: first 5 free, then $6/user/month; Basic + Test Plans $52; hosted parallel jobs $40/month; self-hosted $15/month; Artifacts tiered after 2 GiB free | Azure DevOps Services pricing;Billing overview |
| Parallel jobs | Hosted free tier for private projects: 1 job, 1 hour per run, 1,800 minutes per month, enabled automatically once billing is set up; paid jobs up to 31 hours; new organizations capped at 25; self-hosted: 1 free + 1 per VS Enterprise subscriber | Configure and pay for parallel jobs(ms.date 2026-06-19) |
| Public projects | Retired, can no longer be created; existing public projects become private from 2027 | Same as above;Public projects retirement |
| Group rules | The highest of multiple rules applies; automatic re-evaluation every 24 hours; takes effect after first sign-in; does not apply to service principals and managed identities; GitHub Enterprise access equals Basic, recognized within ≤24h after sign-in | Add group rule, assign access levels(ms.date 2026-03-03) |
| Entra tokens | Resource ID 499b84ac-1321-427f-aa17-267ca6975798; token lasts about 1 hour; Azure DevOps OAuth no longer accepts new registrations | Issue Entra tokens with Azure CLI;Authenticate with Microsoft Entra ID |
| Global PAT retirement | Official dates are inconsistent: the sprint 270 release notes and the PAT documentation's best-practices section say 2026-12-01, while the top of the PAT documentation says 2027-01-27; this lesson states both and notes that the latest release notes take precedence | Use personal access tokens; Azure DevOps release notes (sprint 270), verified by the course writer |
| REST api-version | Format {major}.{minor}[-{stage}[.{resource-version}]]; Server 2022.1 corresponds to 7.1, vNext to 7.2 | REST API get started |
| azure-devops CLI extension | 1.0.11 (2026-11-10), requires Azure CLI 2.30.0+; az boards area team add and other parameters | GitHub releases;az boards area team;az repos policy |
| Azure DevOps Server | Latest is Azure DevOps Server (25H2), RTW 2025-12-09, Patch 9 on 2026-10-13; area and iteration paths can be deleted only when no work items use them | Azure DevOps Server release notes |
| Azure Repos limits and migration | Repositories 250 GB, 5 GB per push, SSH supports RSA only, no built-in “require signed commits” policy; GEI migrates code / PRs / branch policies but not pipelines and LFS | Verified by other course writers in the same repository (see the sources page of Lesson 3 of the Git course) |
Video verification notes
This lesson lists only videos verified via YouTube oEmbed (https://www.youtube.com/oembed?url=…&format=json), with titles and channels verified on 2026-11-15:
- Azure DevOps: Zero to Hero Tutorial — DevOps on Azure (@AzureDevOps)
- Azure DevOps Tutorial for Beginners | CI/CD with Azure Pipelines — TechWorld with Nana
- Azure DevOps Tutorial for Beginners | Azure DevOps | Azure DevOps Boards | Intellipaat — Intellipaat
No verifiable dedicated videos were found for permission evaluation, licensing and billing, CLI/REST authentication, service hooks, and collaboration troubleshooting; the corresponding modules state “no verified video found” and provide storyboard scripts. The videos above were recorded around 2023; for the interface, prices and authentication guidance, follow this lesson.
Narration notes
The “Narration” page uses the browser's built-in Web Speech API to read the Chinese narration script (zh-CN) and English terms (en-US), without depending on the network or external scripts. This courseware cannot embed MP3 files or generate video; the narration script and storyboard can be given to a TTS or video tool to produce audio and video.
Known limitations
- IDs, GUIDs, timestamps, organization names (contoso-lab) and emails in the expected outputs are sample values; the lab commands have not been run against a real organization, and CLI output column names may differ slightly between extension versions.
- Azure DevOps Services is updated about every three weeks, so menu positions and wording may change; follow the official pricing page for prices.
- Details such as the number and interval of service hook retries and PAT administration APIs are not given with specific values in this lesson; follow the official documentation.
- The permission evaluation animation is a simplified implementation of the rules described in the official documentation; it does not cover all special rules of every namespace (such as system permissions and some administrator exceptions); the Why? result is authoritative.
- Features such as group rules and limiting user visibility require the organization to be connected to Microsoft Entra ID; organizations created with a personal Microsoft account cannot complete these lab steps.