Azure DevOps Hour 8 (Optional): 50 Production Issues + 50 Interview Questions

Turn the knowledge from the first seven lessons into two skills: when you see a TF/VS/AADSTS error, know which layer to check first; in an interview, explain the mechanism clearly in two minutes
A: 50 Production IssuesB: 50 Interview QuestionsAzure DevOps Services · Azure PipelinesVerified date 2026-11-15
Overall learning objectives
  • When you see the raw text of an error, determine which organization/permissions/Repos, Pipelines/agents/YAML, service connections/deployments/cloud, security/governance/artifacts/billing layer it belongs to, and state the first diagnostic action.
  • Understand the mechanism: permission inheritance and “deny takes precedence”, build service identity and job authorization scope, YAML compile time vs. run time, resource authorization and checks, the issuer/subject of workload identity federation, and how parallel jobs are metered, rather than just memorizing “where to click”.
  • In a free organization (project myapp-lab) you can reproduce, diagnose, fix, and clean up 14 typical failures; cloud-related failures come with read-only diagnostic commands and disposable resource groups rg-ado-lab and their reproduction steps.
  • Answer the 50 high-frequency Azure DevOps interview questions using the structure “30-second short answer → principle → code/config → production experience”, and handle common follow-up questions.
  • Use mock interviews (timed + self-assessment) to quantify your mastery rate and find weak modules.
Prerequisites Git-side issues (accidentally deleted commits, merge conflicts, common SSH/HTTPS authentication, LFS, shallow clones, etc.) have already been covered in Git course lesson 8 , so this lesson does not repeat them and keeps only Azure DevOps-specific errors and mechanisms; for a comparison with GitHub Actions, refer to the GitHub course.

1-hour time allocation table

#TimeModuleCore contentAnimation · interactionLab
0Before classUsage notes and troubleshooting lab environmentFree organization + project myapp-lab + az devops extension + optional self-hosted agent; safety rulesEnvironment self-checkCreate lab8 repo and pipeline
100–08A · Organization, Permissions and ReposIssues 1–12: TF400813, Stakeholder access level, Deny inheritance, TF401027, TF402455 (automated push), build validation expired, required reviewers, PAT expired, SSH key type, external guest, TF237111, cross-project TF401019Permission decision treeDeny takes precedence · build service push · cross-project checkout
208–16A · Pipelines, Agents and YAMLIssues 13–25: No hosted parallelism, unmet demands, 1-hour timeout, stopped hearing from agent, disk full, VS30063, agent CDN, image retirement, YAML compile errors, compile-time/run-time variables, no trigger, empty output variable, template limit“Pipeline didn’t run / failed” decision treeCompile errors · output variables · trigger overrides
316–24A · Service Connections, Deployments and CloudIssues 26–38: resource authorization issue, authorization required, AADSTS700213/70021, expired secret, disabled after 100 days unused, AuthorizationFailed, AADSTS700024, --federated-token, task does not support WIF, Key Vault permissions, AWS AssumeRoleWithWebIdentity, AKS Forbidden“Deployment authentication failed” decision treeResource authorization · WIF subject mismatch · RBAC
424–30A · Security, Governance, Artifacts and BillingIssues 39–50: Artifacts 2 GiB limit, 409 version already exists, source 401, upstream retention, fork secrets, empty secret variable, push protection, classic disabled, audit 90 days, buying parallel jobs still gives 1, licensing billing, public project retirementFull-chain failure simulator for one runSource permissions · secret mapping · metering
530–37B · Platform and Boards/ReposInterview 1–13Mock interview2 scenario questions
637–44B · Pipelines and CI/CDInterview 14–25Mock interview2 scenario questions
744–52B · Cloud Deployment and SecurityInterview 26–38Mock interview3 scenario questions
852–60B · Enterprise Governance and Scenario DesignInterview 39–50Mock interview3 scenario questions
—After classCheat sheet · Comprehensive exercises50 “error → first step → fix” entries; 50 flash cards; 8 mixed failures; full mock interviewsFull mock interviewsFinal quiz, 12 questions

Knowledge coverage matrix

Topicm1m2m3m4m5m6m7m8
Organization / project / access level / billing●——●●——●
Permission model / build service identity / job scope●●—●●—●●
Boards / Repos / branch policies●——●●●——
YAML / templates / variables / triggers—●———●●●
Agents / parallel jobs / Managed DevOps Pools—●—●—●●●
Service connections / WIF / Azure & AWS deployments——●———●●
Environments / approvals and checks——●——●●●
Secrets / GHAzDO / audit / artifacts●—●●●●●●

What this course does not cover (where to learn it)

  • Platform concepts, Boards, and basic Repos operations → Lesson 1 Core Foundations.
  • Systematic explanation of YAML structure, agents, variables, and triggers → Lesson 2 Azure Pipelines Core.
  • Complete Azure / AWS deployment steps → Lesson 3 / Lesson 4.
  • Template deep dive, Artifacts, deployment strategies → Lesson 5; enterprise security governance → Lesson 6; diagnostic logs and agent pools → Lesson 7.
  • Installation, upgrades, and data-layer operations of Azure DevOps Server (on-premises) → refer to the Microsoft Learn Server documentation; not covered in this course.
  • Troubleshooting containers and Kubernetes itself → next course Docker course and Kubernetes course.

How to use this course

When troubleshooting (Part A)
  • Open the overview, and paste the most distinctive words in the error (such as TF401027,parallelism,AADSTS,409) into the filter box.
  • Click a table row to jump directly to issue details, and follow “diagnose → compare with output → fix”.
  • Not sure which layer? Use the animation tab for the decision tree or simulator.
Before the interview (Part B)
  • First read the overview, and pick out the questions you are less sure of by difficulty.
  • Mock interview: random question selection, 2-minute countdown, answer first then check, self-rate “answered / partial / didn’t know”; scores are saved in this browser.
  • Answer structure: one-sentence conclusion → mechanism → YAML/commands → pitfalls encountered.
After class
  • Cheat sheet Suitable for printing and posting at your desk.
  • Comprehensive exercises: 8 mixed failures + full mock interview (choose 10 of 50) + final quiz.
  • Each question links back to the corresponding module in Lessons 1–7, so you can revisit it.

Entry structure for Parts A and B

Part A · 50 Production Issues

Symptom → root cause (mechanism level) → diagnostic command → sample expected output → fix → prevention and best practices → see Lesson N. Titles use the raw error text from Azure DevOps / Microsoft Entra / cloud APIs where possible; server-side error wording changes as the service is updated,so any wording not found verbatim on Microsoft Learn is marked in the entry as “wording may differ”.

Part B · 50 Interview Questions

Question → 30-second short answer → in-depth answer (principles, YAML/commands) → common follow-ups → bonus points → common wrong answers. Difficulty:BeginnerIntermediateAdvanced.

Relationship to the first seven lessons

LessonMost-referenced content in this lesson
Lesson 1 Core FoundationsOrganization/project/security groups and permissions, access levels and billing, Boards, Repos branch policies, az devops CLI
Lesson 2 Pipelines CoreRun mechanics, YAML structure, triggers, agents and agent pools, variables and expressions, artifacts and caching, template basics
Lesson 3 Azure · Lesson 4 AWSWorkload identity federation, Environments approvals and checks, Container Apps / AKS / App Service, AWS OIDC, ECR/ECS/EKS
Lesson 5 Production-grade pipelinesincludes/extends templates, multi-stage promotion, deployment strategies, Azure Artifacts upstreams and retention, classic release migration
Lesson 6 Enterprise Security and GovernanceEntra integration, PAT governance, protected resources and checks, Key Vault variable groups, GHAzDO, enforced templates, audit streaming
Lesson 7 Deep Troubleshooting and OptimizationDiagnostic logs, self-hosted agents / VMSS / Managed DevOps Pools, parallel jobs and cost, REST API, migration to GitHub
Version and currency notes The figures in this lesson are as of 2026-11-15 Azure DevOps Services and are the reference: the Microsoft-hosted free tier gives private projects 1 parallel job, 1 hour per job, and 1,800 minutes per month (requires linking an Azure subscription to enable; new organizations often need to apply through aka.ms/azpipelines-parallelism-request a request); paid hosted jobs run up to 31 hours each; the free self-hosted tier gives 1 parallel job with no time limit. Artifacts are free up to 2 GiB per organization. ubuntu-latest = Ubuntu 24.04,windows-latest = Windows Server 2025 (official notes point to the VS 2026 image); windows-2019 was retired on 2025-12-31, and ubuntu-22.04 is deprecated and scheduled for removal on 2027-04-17. Official retirement date for global PATs is inconsistent: the PAT doc header says they stop working on 2027-01-27, while the “Best practices” section of the same doc and the sprint 270 release notes say 2026-12-01; follow the latest release notes. Public projects have been retired, existing public projects will become private in 2027. All “expected outputs” are examples, and IDs, timestamps, and GUIDs will differ in your environment.

Module 0 · Usage notes and troubleshooting lab environment (before class)

Most Azure DevOps failures can be reproduced in one free organization; cloud-related issues use disposable resource groups
Before class ≈ 10 minDo not run experiments in a production organization
Prerequisites
  • Lessons 1 and 2 completed (Lessons 3–7 optional; cloud-related entries include links and read-only diagnostic commands).
  • A lab-only Azure DevOps organization (https://dev.azure.com/<your-lab-org>), and you are a member of Project Collection Administrators; project myapp-lab (private, Git).
  • Local machine or Azure VM: Ubuntu 24.04 LTS, with Azure CLI and Git installed; optional Docker Engine (for the myapp example from the Docker course).
  • Cloud reproduction (some Module 3 entries): a disposable Azure subscription, resource group rg-ado-lab (canadacentral); AWS region ca-central-1.

Environment: Azure CLI + azure-devops extension

# Azure CLI (Microsoft official install script, Ubuntu)
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az extension add --name azure-devops          # if already installed, use az extension update --name azure-devops
az login                                       # use an account in the tenant that hosts the lab organization
az devops configure --defaults organization=https://dev.azure.com/<your-lab-org> project=myapp-lab
az devops project show --project myapp-lab --query "{name:name,visibility:visibility}" -o table
Name       Visibility
---------  ------------
myapp-lab  private

az devops The extension version number follows the az extension list -o table output; this lesson only uses long-term stable subcommands (repos,pipelines,security,user,devops invoke).

Lab repo lab8 and basic pipeline

az repos create --name lab8 -o table
git clone https://dev.azure.com/<your-lab-org>/myapp-lab/_git/lab8 && cd lab8
cat > azure-pipelines.yml <<'EOF'
trigger:
  branches: { include: [ main ] }
pool:
  vmImage: ubuntu-latest
steps:
- checkout: self
- script: echo "lab8 ok on $(Agent.OS) / build $(Build.BuildId)"
  displayName: smoke
EOF
git add . && git commit -m "lab8: smoke pipeline" && git push -u origin main
az pipelines create --name lab8-smoke --repository lab8 --repository-type tfsgit --branch main --yml-path azure-pipelines.yml
What if there are no hosted parallel jobs? A new organization often hits No hosted parallelism has been purchased or granted (issue #13). You can first submit a free-tier request, and at the same time register a self-hosted agent (free self-hosted: 1 parallel job, no time limit), and change the pool: to use name: lab8-pool.

Optional: self-hosted agent (Ubuntu 24.04, agent pool lab8-pool)

# 1) Organization settings → Agent pools → Add pool → Self-hosted, name: lab8-pool
# 2) Download the agent package from download.agent.dev.azure.com (use the version shown in the “New agent” dialog)
mkdir ~/agent && cd ~/agent
curl -fsSLo agent.tar.gz "<download link copied from the New agent dialog>"
tar zxf agent.tar.gz
./config.sh --unattended --url https://dev.azure.com/<your-lab-org> --auth pat --token "$AZDO_PAT" \
  --pool lab8-pool --agent lab8-agent-01 --acceptTeeEula
sudo ./svc.sh install && sudo ./svc.sh start
unset AZDO_PAT     # the PAT is only for registration; afterwards the agent uses its own credentials

The registration PAT only needs the Agent Pools (Read & manage) scope, organization-level, short expiry; you can also register the agent with a service principal, per Microsoft Learn.

Environment self-check checklist

Connection to the previous lesson

The troubleshooting method from Lesson 7 (check logs → system.debug → resource utilization → agent diagnostics _diag) runs through this lesson; the service connections and environments created in Lessons 3 and 4 (myapp-dev,myapp-prod) are deliberately “broken” in Module 3. If you did not keep them, the Module 3 reproduction labs will walk you through rebuilding a minimal version.

Safety rules (must read)

Do not run experiments in a production organization Part A deliberately creates Deny permissions, disables service connections, deletes federated credentials, and turns on system.debug. In a real organization, before changing permissions for groups such as “Project Collection Valid Users”, organization policies, or service connections, take a screenshot or export the current state, and make changes within a change window.
  • Use only fake secrets in experiments (such as FAKE-SECRET-123); system.debug=true Logs produced may contain sensitive information; delete the run records after the lab.
  • Each cloud lab ends with cleanup steps (az group delete -n rg-ado-lab --yes --no-wait, deleting app registrations / federated credentials). Estimated cost: read-only diagnostics are 0; deployment labs use the smallest SKUs and typically cost less than US$1 within a few hours (check Azure pricing for current rates).

Five-step general troubleshooting method (used throughout Part A)

StepActionQuestion answered
1 Read the full errorError on the run summary page → task log → View raw log; note the TF/VS/AADSTS numberWhich stage (compile / authorization / queue / agent / task / check)?
2 Check identityWho is executing? A user,<Project> Build Service (<Organization>),Project Collection Build Service, or the app/managed identity behind a service connectionIs it the permission of a “person” or of the “pipeline”?
3 Check resources and policiesService connection / agent pool / variable group / environment Security and Approvals and checks; Organization settings → Policies / Pipelines → SettingsIs the resource authorized for this pipeline? Is an organization policy blocking it?
4 Check the compiled resultRun page ⋯ → Download logs, view the azure-pipelines-expanded.yaml (expanded YAML)After template expansion and compile-time expressions, what actually runs?
5 Enable diagnosticsRe-run with “Enable system diagnostics” or set the variable system.debug: true; for self-hosted agents, check the _diag directoryWhat requests did the task send? Is agent-to-service communication working? (Logs may contain sensitive information.)

Module 1 · Part A: Organization, Permissions and Repos (Issues 1–12)

00:00 – 08:00 · Access levels, permission inheritance, build service identity, branch policies, PAT, cross-project access
8 minTF400813 · TF401027 · TF402455 · TF40101912 issues
Learning objectives
  • Distinguish three things: whether you can enter the organization (membership / Entra tenant),which features you can use (access level Stakeholder / Basic),what you can do with a given object (security group permission Allow / Deny / Not set).
  • Be clear about permission evaluation: group membership permissions are merged,Deny takes precedence, object-level inheritance, explicit settings override inheritance, and the Project Collection Administrators exception.
  • Recognize the two build service identities that pipelines use, and how the settings “Limit job authorization scope” and “Protect access to repositories in YAML pipelines” change which repositories they can access.

Enter keywords from the error (such as TF401027,Stakeholder,reviewer,PAT) to filter; click a row to jump to the matching entry in Issue details.

#1 TF400813: The user '…' is not authorized to access this resource.
TF400813: The user 'aad.ZmM2Yjk4…' is not authorized to access this resource.
TF400813: Resource not available for anonymous access. Client authentication required.

Symptom: A new team member opens https://dev.azure.com/contoso is denied, or a script/tool calling the REST API gets a 401; the second form means the request carried no valid credentials at all (anonymous).

Root cause: Azure DevOps first performs identity authentication (who this person is and which Entra tenant they come from), then checks organization membership. Common causes: (1) the user signed in with a different account (personal MSA vs. work account; the browser cached the wrong identity); (2) the organization is connected to tenant A, and the user is in tenant B without being invited as a guest; (3) the user was removed from the organization or the account is disabled; (4) a conditional access policy (IP, device compliance) denies access; (5) the tool does not send an Authorization header (empty PAT, malformed Base64).

Diagnostic commands
# Admin: confirm whether this person is an organization member and what their access level is
az devops user show --user alice@contoso.com --query "{user:user.principalName,license:accessLevel.accountLicenseType,status:accessLevel.status}" -o table
# Check the Entra tenant connected to the organization (Organization settings → Microsoft Entra)
az devops invoke --area core --resource projects -o none   # only verifies whether the current sign-in works
# User side: confirm which identity the browser/CLI is currently signed in with
az account show --query "{user:user.name,tenant:tenantId}" -o table
User                Licence     Status
------------------  ----------  --------
alice@contoso.com   express     active
Fix
  • Sign in with the correct account (verify in an InPrivate window); on the tool side, confirm the PAT belongs to this organization and has not expired (see #8).
  • If the user is not in the organization, an admin az devops user add --email-id alice@contoso.com --license-type express adds them, or access is granted automatically via Entra group rules.
  • Cross-tenant user: first invite them as a guest in the connected tenant (the organization policy must also allow external guests; see #10).
  • Conditional access: an Entra admin checks the sign-in logs for the failure reason.
Prevention and best practices
  • Connect the organization to Entra ID and use group rules to manage membership and access levels, so access is revoked automatically when someone leaves.
  • For automation, do not use personal accounts; use service principals or managed identities instead (Lesson 6).

See Lesson 1 Module 2 Organization, Projects, Security Groups and Permissions,Lesson 6 Module 1 Organization Governance and Entra ID Integration.

#2 User can sign in but cannot see Repos / cannot create PRs / can only view pipelines (access level is Stakeholder)

Symptom: There is no Repos entry in the left navigation, or opening a repo link says access is denied; Boards works but many fields are read-only. The person’s group on the permissions page is Contributors, though.

Root cause:Access level and security group permissions are two independent layers of control: the access level determines “which features this user can use”, while permissions determine “what they can do with a given object”. Stakeholder is free but cannot access code repositories in private projects; Basic is what includes Repos and full Boards. The first 5 Basic users are free; beyond that, if billing is not configured or the purchased count is used up, new users are often assigned Stakeholder (depending on group rules and the default access level setting).

Diagnostic commands
az devops user show --user bob@contoso.com --query "accessLevel.{type:accountLicenseType,source:licensingSource,status:status}" -o table
az devops user list --query "items[?accessLevel.accountLicenseType=='stakeholder'].user.principalName" -o tsv | head
Type         Source    Status
-----------  --------  --------
stakeholder  account   active
Fix
az devops user update --user bob@contoso.com --license-type express   # express = Basic

If the user’s access level is granted by an Entra group rule, changing the individual setting will be overridden by the group rule; change the group rule or add the user to the matching Entra group instead.

Prevention and best practices
  • Design group rules by role: developer groups → Basic; business stakeholders → Stakeholder; Visual Studio subscribers automatically receive the corresponding entitlements (no need to buy Basic).
  • Periodically run the “inactive users” cleanup (m4 #49).

See Lesson 1 Module 3 Access Levels, Licensing and Billing.

#3 Allow is already granted, but access is still denied (the permissions page shows “Deny (inherited)” or a Deny from some group)

Symptom: Alice has been explicitly granted Allow “Contribute” on the repo, yet pushes still fail with TF401027; on Alice’s permissions page, the permission shows “Deny (inherited)” or “Deny” coming from a group she belongs to.

Root cause: Azure DevOps effective permissions are determined by two rules: (1) group merging: when a user is a member of several groups, a Deny on any one of those groups takes precedence over Allow; (2) object inheritance: permissions that are not explicitly set (Not set) inherit from the parent object (for example, all project repos → a repo → a branch); an explicit setting on a child object overrides the inherited value. In addition, Project Collection Administrators members with organization-level full permissions are not subject to ordinary Deny restrictions, which is also why admins often cannot “reproduce” the user’s problem.

Diagnostic commands
# Web: Project settings → Repositories → lab8 → Security → select the user → click the “i” / Why? next to the permission to see its source
# CLI: view a principal’s Git permissions on a repo (Git Repositories namespace)
NS=2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87
PROJ=$(az devops project show --project myapp-lab --query id -o tsv)
REPO=$(az repos show --repository lab8 --query id -o tsv)
DESC=$(az devops user show --user alice@contoso.com --query user.descriptor -o tsv)
az devops security permission show --id $NS --subject "$DESC" --token "repoV2/$PROJ/$REPO" -o jsonc
"Contribute": "Deny (inherited)",
"Create branch": "Allow",
"Read": "Allow (inherited)"
Fix
  • Find the group that is the source of the Deny: if it is an intentional Deny on a “restrictive” group (such as a contractor group), adjust group membership rather than adding Allow everywhere.
  • If an accidental Deny was set on a parent object (all repos), change it to Not set so it inherits again.
Prevention and best practices
  • Where possible, express permissions only with Allow + group membership,and use Deny sparingly; use Deny only for clearly defined “guardrail” groups.
  • Make permission changes through groups rather than individuals; track them with audit logs Security.ModifyPermission events.

See Lesson 1 Module 2 (permission inheritance and Deny-precedence animation).

#4 TF401027: You need the Git 'GenericContribute' permission to perform this action. (pipeline pushing tags/commits)
remote: TF401027: You need the Git 'GenericContribute' permission to perform this action.
Details: identity 'Build\6a1f…', scope 'repository'.
To https://dev.azure.com/contoso/myapp-lab/_git/lab8
 ! [remote rejected] v1.4.0 -> v1.4.0 (TF401027: You need the Git 'GenericContribute' permission to perform this action. ...)

Symptom: In the pipeline, git tag + git push (tagging versions, writing back the changelog) fails; the same command succeeds on a local machine.

Root cause: The pipeline does not run as “the person who triggered it”; instead it runs as the Build Service identity: when the job authorization scope is the current project, it is myapp-lab Build Service (contoso), otherwise it is Project Collection Build Service (contoso). These two identities have only read permission on repositories by default. The Build\<GUID> in the error is that identity.

Diagnostic commands
steps:
- checkout: self
  persistCredentials: true       # lets later git commands reuse System.AccessToken
- script: |
    echo "Job scope token user:"; git config --get-all http.extraheader | sed 's/AUTHORIZATION: .*/AUTHORIZATION: ***/'
    git tag v$(Build.BuildNumber) && git push origin v$(Build.BuildNumber)

In Project settings → Repositories → lab8 → Security, search for the GUID in the error or “Build Service” to see which identity it is and whether Contribute is Not set.

Fix
  • Grant the correct Build Service identity Contribute permission on that repository (tagging also needs Create tag; for pushes to protected branches, see #5).
  • When unsure which identity it is, go by the GUID in the error; granting both widens the permission surface and is not recommended.
Prevention and best practices
  • Grant access only to the one repository that needs write-back; for version numbers, pipeline variables or artifact metadata are preferred over writing back to the repo.
  • Enable “Limit job authorization scope to current project” to make the identity more predictable (#12).

See Lesson 5 Module 5 Version Numbers, Tags and Release Notes,Lesson 6 Module 3 Pipeline Security.

#5 TF402455: Pushes to this branch are not permitted; you must use a pull request to update this branch. (automation/bot pushes)

Symptom: A release pipeline writing back CHANGELOG.md to main is rejected; or a dependency-update bot pushing directly to main fails. (For the Git-side handling when a developer’s own push is rejected, see Git course #29.)

Root cause: As soon as any branch policy is enabled on a branch (minimum reviewers, build validation, linked work items, etc.), that branch can only be updated through a PR. Bypassing requires a separate permission “Bypass policies when pushing” (bypass when pushing), or “Bypass policies when completing pull requests” (bypass when completing PRs); by default, no one has them.

Diagnostic commands
az repos policy list --repository-id $(az repos show -r lab8 --query id -o tsv) --branch main \
  --query "[].{type:type.displayName,blocking:isBlocking,enabled:isEnabled}" -o table
Type                              Blocking    Enabled
--------------------------------  ----------  ---------
Minimum number of reviewers       True        True
Build                             True        True
Fix
  • Recommended: have the pipeline create a branch and use REST/CLI to create a PR with auto-complete enabled, so the write-back also goes through policy (az repos pr create --auto-complete true).
  • When truly necessary, grant the Build Service identity, on that branch, Allow for “Bypass policies when pushing”, and monitor the Git.RefUpdatePoliciesBypassed events in the audit log.
Prevention and best practices
  • Grant bypass permissions to only a very small number of identities, and pair them with audit alerts.
  • Where possible, change write-back automation to “produce artifacts/variables” to keep bots from writing to main.

See Lesson 1 Module 5 Azure Repos Branch Policies and PRs,Lesson 6 Module 6 Scaling Branch Policy Governance.

#6 PR cannot be completed: build validation shows “Expired” / “Build expired” or “not started” (build validation policy)

Symptom: A PR turned green once, but after a while the “Complete” button is grey again and the policy area shows the build has expired and needs to be re-queued; or a folder was changed, build validation never triggered, and the status stays required but not started.

Root cause: The build validation policy has three key settings: (1) Build expiration— expire immediately when the target branch is updated / expire after N hours / never expire. If the target branch is merged into often, “expire immediately” makes the PR re-queue repeatedly; (2) Path filter— it triggers only when changes match the path filter, but if the policy is still Required, you can end up with the combination “does not trigger yet must pass” (check the actual configuration); (3) Trigger— automatic or manual. In addition, the PR build runs on the merge commit of the source and target branches, so if the target branch changes, the result may differ, which is why the concept of “expired” exists.

Diagnostic commands
az repos policy list --repository-id $(az repos show -r lab8 --query id -o tsv) --branch main \
  --query "[?type.displayName=='Build'].settings.{pipeline:buildDefinitionId,expire:validDuration,queueOnSourceUpdateOnly:queueOnSourceUpdateOnly,filenamePatterns:filenamePatterns}" -o jsonc
[{ "pipeline": 12, "expire": 0.0, "queueOnSourceUpdateOnly": false, "filenamePatterns": ["/src/*"] }]

validDuration The unit of the expiry setting and the meaning of “0 means expire immediately” are defined in the Policy REST API documentation.

Fix
  • For branches with high merge frequency: set expiry to “after N hours”, or enable automatic re-queue.
  • For required checks with path filters: confirm the filter matches the repo structure; if you need “skip if nothing changed”, consider an optional policy plus a path check inside the pipeline.
Prevention and best practices
  • Keep trunk-based short-lived branches with automatic revalidation before merge; keep PR builds under 10 minutes.
  • Draft PRs do not trigger build validation, which reduces wasted queueing.

See Lesson 1 Module 5,Lesson 2 Module 3 Triggers.

#7 PR stuck at “Waiting on required reviewers” / the author’s approval doesn’t count / approvals are cleared after a push

Symptom: Two people have approved, but the PR still cannot be completed; or the author’s own approval does not change the count; or every new push resets everyone’s votes.

Root cause: Sub-options of the “Minimum number of reviewers” policy: Allow requestors to approve their own changes (whether the author counts),Prohibit the most recent pusher from approving their own changes (the last pusher cannot approve),When new changes are pushed (reset all votes / reset only rejected votes). In addition, Automatically included reviewers you can set a group as a required reviewer by path: as long as nobody in that group has approved, the PR cannot be completed even if the total count is met.

Diagnostic commands
PR=42
az repos pr show --id $PR --query "reviewers[].{name:displayName,vote:vote,required:isRequired}" -o table
az repos policy list --repository-id $(az repos show -r lab8 --query id -o tsv) --branch main \
  --query "[?type.displayName=='Required reviewers'].settings.{reviewers:requiredReviewerIds,path:filenamePatterns}" -o jsonc
Name                Vote    Required
------------------  ------  ----------
Platform Team       0       True
alice               10      False
bob                 10      False

vote: 10 = approved, 5 = approved with suggestions, 0 = no vote, -5 = waiting for author, -10 = rejected.

Fix
  • Have a member of the required group (such as Platform Team) approve; check whether the path filter accidentally covers the entire repo.
  • Adjust “whether the author counts / whether votes reset after a push” according to team agreements.
Prevention and best practices
  • Configure required reviewers precisely by folder (similar to CODEOWNERS), to avoid “every change in the whole repo needs Platform team approval”.
  • Enabling “reset votes on push” prevents code from being slipped in after approval.

See Lesson 1 Module 5.

#8 PAT suddenly stops working: 401 Unauthorized / Authentication failed (expired, automatically revoked after a leak, inactive after 90 days unused, global PAT retirement)

Symptom: Scripts, package restores, and third-party tools that worked yesterday return 401 today; some HTTP clients even receive a 203 and a sign-in page HTML instead of a 401 (depending on the client and request headers; wording and behavior may differ).

Root cause (check each item): (1) the PAT expired or was revoked by the user/admin; (2) the PAT was found in a public GitHub repository, and Azure DevOps automatically revoked it (audit event Token.PatPublicDiscoveryEvent / Token.PatSystemRevokeEvent, unless tenant policy turns off automatic revocation); (3) in Entra-backed organizations, a new PAT not used within 90 days becomes inactive; (4) global PATs (All accessible organizations) are being retired— the Microsoft Learn PAT doc header says all stop working from 2027-01-27, while the “Best practices” section of the same doc and the sprint 270 release notes say 2026-12-01; follow the latest release notes; (5) PAT scope is insufficient or the owner’s permissions have changed.

Diagnostic commands
# Call a read-only API directly with the PAT and observe the status code
curl -s -o /dev/null -w "%{http_code}\n" --user ":${AZDO_PAT}" \
  "https://dev.azure.com/contoso/_apis/projects?api-version=7.1"
# Admin: filter Token.* events in the audit log (Organization settings → Auditing)
401
Fix
  • Create a new organization-level PAT with minimal scope and a short expiry; update it in the key vault, and revoke the old PAT after testing.
  • Where possible, for scenarios that can use Entra tokens (Azure CLI az account get-access-token, service principals, managed identities), migrate directly and stop renewing PATs.
Prevention and best practices
  • Maintain a PAT inventory (owner, purpose, scope, expiry date); use tenant policy to restrict full-scope PATs and maximum lifetime.
  • For Git, use Git Credential Manager (since GCM 3.0, Azure Repos uses OAuth tokens by default); for package management, use the Artifacts Credential Provider.

See Lesson 6 Module 2 PATs, Identity and Access Governance.

#9 git@ssh.dev.azure.com: Permission denied (publickey) (using an ed25519 key / only the wrong key type was uploaded)
git@ssh.dev.azure.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Symptom: On the same machine, SSH to GitHub works but SSH to Azure Repos fails; when adding an SSH key on the Azure DevOps SSH public key page, id_ed25519.pub the key is rejected, or authentication still fails after adding it.

Root cause: Azure DevOps SSH only supports RSA RSA keys (the server uses rsa-sha2-256/512 signatures), not ed25519/ECDSA; many people’s default key is ed25519. In addition, SSH to Azure Repos does not support Git LFS. (For general SSH troubleshooting on the GitHub side, see Git course #27.)

Diagnostic commands
ssh -vT git@ssh.dev.azure.com 2>&1 | grep -E "Offering|Authentications|denied"
debug1: Offering public key: /home/me/.ssh/id_ed25519 ED25519 SHA256:… explicit
debug1: Authentications that can continue: password,publickey
git@ssh.dev.azure.com: Permission denied (publickey).
Fix
ssh-keygen -t rsa-sha2-512 -b 4096 -f ~/.ssh/id_rsa_azdo -C "me@contoso.com"   # generate an RSA key (same as ssh-keygen -t rsa)
cat >> ~/.ssh/config <<'EOF'
Host ssh.dev.azure.com
  IdentityFile ~/.ssh/id_rsa_azdo
  IdentitiesOnly yes
EOF
# Add id_rsa_azdo.pub under User settings → SSH public keys

In newer OpenSSH versions, -t rsa-sha2-512 and -t rsa generate the same type of RSA key; if your ssh-keygen does not accept this syntax, use -t rsa -b 4096.

Prevention and best practices
  • Document in the team guide that Azure Repos uses RSA, or use HTTPS + GCM directly (OAuth, supports LFS).
  • Organization policy can disable SSH authentication; in that case, only HTTPS can be used.

See Lesson 1 Module 5, and for Git-side details see Git course Lesson 3.

#10 Inviting external partners fails / guest users cannot join (organization policy turns off external guest access, or the user is not in the connected Entra tenant)

Symptom: Entering a partner’s email under “Add users” returns no results in the people picker, or an error on save; the partner receives the invitation but is told after signing in that they lack access (wording varies by scenario, often accompanied by TF400813).

Root cause: After the organization is connected to an Entra tenant, members must be users or guests of that tenant. In Organization settings → Policies, the External guest access setting being off means users outside the tenant cannot be added; even when it is on, Entra external collaboration settings (who can invite guests, allowed/blocked domains) may still block it.

Diagnostic commands
# Organization policy: in the web UI, view Organization settings → Policies → Security policies → External guest access
# Confirm the connected tenant: Organization settings → Microsoft Entra (https://dev.azure.com/contoso/_settings/organizationAad)
# Entra side: confirm whether the guest already exists in the tenant
az ad user list --filter "mail eq 'partner@fabrikam.com'" --query "[].{upn:userPrincipalName,type:userType}" -o table
Upn                                         Type
------------------------------------------  ------
partner_fabrikam.com#EXT#@contoso.onmicrosoft.com  Guest
Fix
  • Have an Entra admin invite the guest first (or configure cross-tenant access settings), then grant access in Azure DevOps via group rules.
  • If you must invite directly from Azure DevOps, have the organization owner turn on External guest access (after assessing the risk).
Prevention and best practices
  • Put external partners in separate groups and projects, combined with “limit user visibility to specific projects” (Project-Scoped Users).
  • Review guest access periodically (Entra Access Reviews).

See Lesson 6 Module 1.

#11 TF237111: The current user does not have permissions to save work items under the specified area path.

Symptom: Saving a work item in Boards fails; or automation (service hooks, REST calls in pipelines) fails to create work items with the error above (wording may vary slightly by client).

Root cause: Edit permission for work items is attached to the Area Path node: “Edit work items in this node”. After a team reorganizes the area tree and tightens permissions on a sub-area (or breaks inheritance), Contributors can no longer save under that node. In automation, the executing identity may be the PAT owner or the Build Service identity, which may not be in Contributors.

Diagnostic commands
az boards area project list --project myapp-lab --depth 3 -o table
# Web: Project settings → Project configuration → Areas → select the node → Security, and check “Edit work items in this node”
ID    Identifier                            Name          Path
----  ------------------------------------  ------------  ------------------------------
12    5d2c…                                 Payments      \myapp-lab\Area\Payments
Fix
  • On that area node, grant the relevant group Allow for “Edit work items in this node”, or restore inheritance.
  • Automation identity: add the Build Service identity or service principal to a suitable group, rather than granting permissions to a personal PAT.
Prevention and best practices
  • Organize the area tree by product/team, set permissions only at the top level, and keep child nodes inheriting.
  • When changing area structure, first rehearse bulk moves of work items in a test project.

See Lesson 1 Module 4 Azure Boards.

#12 Git fetch failed with exit code 128 … TF401019 (pipeline checks out a repo from another project: job authorization scope / protect access to repositories)
##[error]Git fetch failed with exit code 128
remote: TF401019: The Git repository with name or identifier shared-templates does not exist or you do not have permissions for the operation you are attempting.

Symptom: The pipeline checkout of platform/shared-templates (another project) fails; or in a script, a git clone of git clone another repo in the same project fails, while a checkout step succeeds.

Root cause: Two settings: (1) Limit job authorization scope to current project (with separate toggles for “non-release pipelines” and “release pipelines”): when enabled, the job token is valid only for the current project, and the Build Service identity is myapp-lab Build Service, which has no permissions in the platform project by default; (2) Protect access to repositories in YAML pipelines (enabled by default for organizations and projects created after 2020-05): when enabled, YAML pipelines can only access repositories in a checkout step or uses statement that explicitly references an Azure Repos repository; a script that temporarily clones an unreferenced repository will be rejected.

Diagnostic commands
resources:
  repositories:
  - repository: shared
    type: git
    name: platform/shared-templates   # project/repo
steps:
- checkout: self
- checkout: shared                    # authorized only after explicit reference
- script: echo "System.CollectionUri=$(System.CollectionUri)"

Also check the two toggles above under Project settings → Pipelines → Settings; in the platform project → Repositories → shared-templates → Security, search for “myapp-lab Build Service”.

Fix
  • Keep “Limit job authorization scope” enabled (safer), and on the target repository, grant the myapp-lab Build Service (contoso) Build Service identity Read access.
  • Change script access to a checkout or uses explicit reference; on the first run, approve the repository resource when prompted with “Permit”.
Prevention and best practices
  • Grant read-only access to shared template repositories for all project Build Service identities; reference templates via resources.repositories + pinned ref (tag/commit) references.
  • Do not turn off these two protection toggles just for convenience.

See Lesson 2 Module 1 Pipelines Architecture,Lesson 6 Module 3 Pipeline Security.

Figure 1-1 · The four checkpoints an access request passes through

① AuthenticationEntra / MSA / PAT ② Organization membershipTenant · guest · conditional access ③ Access levelStakeholder / Basic ④ Object permissionsGroup merge · Deny precedence · inheritance Action allowed TF400813 anonymous / #8PAT expired TF400813 / #1 #10Not in organization / guest blocked #2 Cannot see ReposStakeholder #3 #4 #5 #11 #12TF401027 / TF402455 …
First identify which checkpoint you are stuck at, then go to the matching settings page; checkpoint ④ applies equally to “people” and “pipeline identities”.

Figure 1-2 · Which identity a pipeline uses to access a repo

YAML pipeline runSystem.AccessToken Limit job authorization scope?Project settings / Organization settings Yes: <Project> Build ServiceToken valid only for the current project No: Project Collection Build ServiceToken valid across the whole organization (larger permission surface) Protect access to repositoriesOnly explicit references
The identity in the TF401027 error is Build\<GUID> one of the identities here; TF401019 is often “the identity is right, but the repo was not explicitly referenced or not authorized”.

Interactive troubleshooting decision tree: choose step by step based on the symptom, and finally pinpoint the specific issue number.

Run in the myapp-lab project of the lab organization; all steps only affect the lab8 repo and the test user.

Lab 1: Deny takes precedence (#3)
# Reproduce: create group lab8-guardrail, set Deny for Contribute on the lab8 repo, and add test user bob to it (bob is also in Contributors)
az devops security group create --name lab8-guardrail --project myapp-lab --query descriptor -o tsv
# Web: Repositories → lab8 → Security → lab8-guardrail → Contribute = Deny; add bob under Members
# Diagnose: bob pushes → TF401027; on the permissions page, check bob’s Contribute → "Deny" (from lab8-guardrail)
# Fix: remove bob from lab8-guardrail, or change Deny to Not set
# Cleanup
az devops security group delete --id <descriptor from the output above> --yes
Lab 2: Build Service pushes a tag (#4)
# Reproduce: add tag-pipeline.yml to lab8 and create a pipeline run
steps:
- checkout: self
  persistCredentials: true
- script: |
    git tag lab8-$(Build.BuildId)
    git push origin lab8-$(Build.BuildId)
# Diagnose: the log shows TF401027 … identity 'Build\<GUID>'
# Fix: lab8 → Security → "myapp-lab Build Service (Organization)" → Contribute / Create tag = Allow, then re-run successfully
# Cleanup: git push origin --delete lab8-<id>; restore the permission to Not set
Lab 3: Cross-project checkout (#12)
# Prepare: create project lab8-platform and repo shared; confirm that “Limit job authorization scope” is enabled for myapp-lab
az devops project create --name lab8-platform --visibility private -o none
az repos create --name shared --project lab8-platform -o none
# Reproduce: in the lab8 pipeline, script: git clone https://dev.azure.com/<organization>/lab8-platform/_git/shared → TF401019
# Fix: switch to resources.repositories + checkout: shared; on shared, grant "myapp-lab Build Service" Read; on the first run, click Permit
# Cleanup
az devops project delete --id $(az devops project show -p lab8-platform --query id -o tsv) --yes
Lab 4: Access level (#2)
az devops user update --user bob@<your-tenant> --license-type stakeholder   # reproduce: bob cannot see Repos
az devops user update --user bob@<your-tenant> --license-type express       # fix (uses one Basic seat)
Acceptance checklist

Instructional videos (titles and channels verified via YouTube oEmbed)

▶
Azure DevOps | Branch Policies — Code Doge
English · Branch policy setup (corresponding to #5, #6, #7)
▶
AZ-400 Lesson 3: Branching Strategies and Pull Requests | Branch Policies, Protection Rules — Cert Espresso
English · PR and branch protection concepts

No verified video was found that specifically covers permission inheritance / Deny precedence or Build Service identity troubleshooting. A 3-minute storyboard is below, which you can record yourself:

Shot 1 (0:00) Figure 1-1: the four checkpoints light up one by one, and under each checkpoint the matching error pops up (TF400813 → Stakeholder → TF401027).
Shot 2 (0:50) Permissions page: bob is in both Contributors (Allow) and guardrail (Deny), and the result shows Deny; narration: “Deny takes precedence”.
Shot 3 (1:40) Pipeline log highlighted Build\GUID, search the repo Security settings for “myapp-lab Build Service”, grant Contribute, and re-run to pass.

Official documentation:About permissions · Job access tokens · Branch policies

A quiz score of ≥ 70% also marks it complete automatically.

Module 2 · Part A: Pipelines, agents and YAML (Issues 13–25)

08:00 – 16:00 · Parallel jobs, agents, images, compile time vs. run time, triggers, output variables, template limits
8 minparallelism · demands · Unexpected value13 issues
Learning objectives
  • Break a run down into stages: trigger → compile (template expansion,${{ }} evaluation) → resource authorization and checks → queue (parallel jobs) → agent pickup (demands matching) → task execution → logs/artifacts, and be able to place any error into one of these stages.
  • Distinguish when the three variable syntaxes are evaluated: ${{ }} compile time,$[ ] run time (before the job/stage starts),$( ) and macro substitution before task execution.
  • Know the hard limits of Microsoft-hosted agents (2 cores / 7 GB / about 10 GB of free disk, 1-hour limit on the free tier), and when to switch to self-hosted or Managed DevOps Pools.

Enter keywords (such as parallelism,demands,Unexpected,trigger) to filter; click a row to jump to the details.

#13 ##[error]No hosted parallelism has been purchased or granted. To request a free parallelism grant, please fill out the following form https://aka.ms/azpipelines-parallelism-request

Symptom: The first run in a new organization of a pipeline using vmImage fails its job immediately and shows the message above.

Root cause: The Microsoft-hosted agent free tier (1 parallel job for private projects, 1 hour per job, 1,800 minutes per month) is not granted automatically: official documentation requires the organization to link a valid Azure subscription (set up billing) before it is enabled; in practice, new organizations often need to apply through the form above, which is manually reviewed and may take several business days (an anti-abuse measure). The free self-hosted parallel job, however, is granted automatically.

Diagnostic commands
# Web: Organization settings → Pipelines → Parallel jobs; check the “Free tier / Paid” counts for Microsoft-hosted
# URL: https://dev.azure.com/<organization>/_settings/buildqueue?_a=concurrentJobs
az pipelines runs list --pipeline-ids $(az pipelines show --name lab8-smoke --query id -o tsv) --top 1 \
  --query "[0].{result:result,reason:reason}" -o table
Result    Reason
--------  ------------
failed    individualCI
Fix
  • Submit a free-tier request, or set up billing for the organization and then buy Microsoft-hosted parallel jobs.
  • An immediately available alternative: register a self-hosted agent (Module 0) and change the pool pool setting to use name: lab8-pool.
Prevention and best practices
  • Handle billing and parallel job quota right after creating a new organization; for course/training environments, apply one week in advance.
  • Public projects have been retired, so do not rely on the old assumption of “more free minutes for public projects” (see #50).

See Lesson 2 Module 4 Agents and Agent Pools,Lesson 7 Module 5 Parallel Jobs and Cost Optimization.

#14 Job stays queued: No agent found in pool … which satisfies the specified demands / parallel job limit reached (wording may differ)
No agent found in pool lab8-pool which satisfies the specified demands: docker, Agent.Version -gtVersion 3.248.0
The agent request is not running because you have reached the maximum number of requests that can run for parallelism type 'Self-Hosted'.

Symptom: The run sits at “Queued / Waiting for an available agent” for minutes or even hours.

Root cause: Queuing has two gates: (1) parallel job gate— the organization-level parallel job quota is used up (shared across all projects, not divided by project), so new jobs must wait; (2) agent matching gate— the job’s demands (capabilities that tasks implicitly require, such as docker,npm, or explicitly demands:, plus the minimum agent version a task requires) do not match the capabilities of online and idle agents in the pool. Agents that are offline, disabled, or running other jobs also cause the match to fail.

Diagnostic commands
POOL=$(az pipelines pool list --pool-name lab8-pool --query "[0].id" -o tsv)
az pipelines agent list --pool-id $POOL --include-capabilities \
  --query "[].{name:name,status:status,enabled:enabled,ver:version,docker:systemCapabilities.docker}" -o table
# Web: Pool → Analytics (Pool consumption report) to view queueing and the parallel limit curve
Name           Status    Enabled    Ver        Docker
-------------  --------  ---------  ---------  --------
lab8-agent-01  online    True       4.264.2    None
Fix
  • Missing capability: after installing the tool on the agent machine,restart the agent service (capabilities are scanned at startup), or add user capabilities on the agent; remove unnecessary explicit demands.
  • Agent version too old: upgrade agents (Pool → Update all agents), and note the download domain in #19.
  • Not enough parallel jobs: add self-hosted parallel jobs or reduce simultaneous triggers (batch CI, path filters).
Prevention and best practices
  • Bake agent images (Packer / Managed DevOps Pools custom images) to keep capabilities consistent.
  • Review parallel job quota monthly using the Pool consumption report.

See Lesson 2 Module 4,Lesson 7 Module 3 Self-Hosted Agents, VMSS and Managed DevOps Pools.

#15 ##[error]The job running on agent … ran longer than the maximum time of 1 hour. (job timeout; wording may differ)

Symptom: The build is cancelled exactly at the 1-hour mark; it finishes locally in 40 minutes, but the hosted agent is slower.

Root cause: Microsoft-hosted free tier jobs run for up to 1 hour; after buying hosted parallel jobs, a single job can run up to 31 hours; self-hosted agents are not subject to platform time limits. In addition, the job’s own timeoutInMinutes timeout (default 60) also applies —whichever is smaller takes effect, so if you bought paid jobs but did not change timeoutInMinutes it will still be cancelled at 1 hour.

Diagnostic commands
jobs:
- job: build
  timeoutInMinutes: 120          # paid hosted jobs: max 360; 0 means use the maximum the platform allows (see the docs)
  cancelTimeoutInMinutes: 5
  steps:
  - script: echo "##vso[task.logissue type=warning]step timing check"

On the run page, check the duration of each step; with system.debug enabled, search for Agent environment resources to see whether CPU, memory, or disk is the bottleneck.

Fix
  • Split the job (build / unit tests / integration tests in parallel), and use caching (Cache@2) and incremental builds.
  • Buy hosted parallel jobs and raise timeoutInMinutes, or switch to self-hosted / Managed DevOps Pools (larger SKUs).
Prevention and best practices
  • Set a reasonable timeout explicitly for every job, so hung jobs fail early and use up less parallel quota.

See Lesson 7 Module 4 Performance: Parallelism, Caching and Agent Specs.

#16 We stopped hearing from agent <agent name>. Verify the agent machine is running and has a healthy network connection.

Symptom: The job fails midway and the log stops abruptly; it mostly happens with memory-intensive tests, Docker builds, or self-hosted agents.

Root cause: Agents keep in touch with the service through long polling/heartbeats. If the agent machine runs out of memory (the Linux OOM killer kills Agent.Worker), CPU is maxed out, the disk fills up, the machine sleeps or is scaled in (VMSS/Spot reclaim), the network drops, or the agent is restarted mid-job, the service marks the agent as lost after a timeout. Steps on a hosted Linux agent run in a cgroup with about 6 GB of physical memory.

Diagnostic commands
# Re-run with system.debug=true and search for resource utilization
grep "Agent environment resources" ~/Downloads/logs_*/**/*.txt | tail -3
# Self-hosted agent: check the agent diagnostic logs and system logs
ls -t ~/agent/_diag | head; sudo journalctl -k | grep -i -E "oom|killed process" | tail
##[debug]Agent environment resources - Disk: / Available 812.00 MB out of 74000.00 MB, Memory: Used 6890.00 MB out of 7167.00 MB, CPU: Usage 99.10%
kernel: Out of memory: Killed process 4122 (Agent.Worker)
Fix
  • Reduce concurrency (test -j, Gradle/Maven threads,dotnet test parallelism), and set memory caps for JVM/Node.
  • Self-hosted: use larger specs, keep spare memory, and disable sleep; set reasonable scale-in delays for VMSS/Managed DevOps Pools so agents in the middle of a job are not reclaimed.
Prevention and best practices
  • Use separate pools for heavy jobs; monitor agent machine memory and disk.

See Lesson 7 Module 1 Troubleshooting Methodology and Diagnostic Logs,Module 3.

#17 No space left on device (Microsoft-hosted agent disk full)

Symptom:docker build,npm ci or extracting a large file fails with No space left on device / There is not enough space on the disk.

Root cause: Microsoft-hosted Windows/Linux agents have roughly 10 GB (the VM has a 14 GB SSD, and the rest is taken by the image), and cannot be expanded. Checking out large repos, pulling multiple base images, or generating intermediate artifacts will quickly exhaust it.

Diagnostic commands
steps:
- script: |
    df -h / "$(Agent.TempDirectory)" "$(Build.SourcesDirectory)"
    docker system df || true
    du -sh "$(Pipeline.Workspace)"/* 2>/dev/null | sort -h | tail
  displayName: disk report
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        73G   63G   10G  87% /
Fix
  • Reduce inputs: fetchDepth/fetchFilter/sparse checkout (agent 3.253.0/4.253.0+ supports sparseCheckoutDirectories), pull only the images you need, and after the build docker image prune -af.
  • Split the job and pass outputs via pipeline artifacts instead of piling everything into one job.
  • If you truly need a large disk: self-hosted or Managed DevOps Pools (choose SKU and disk size).
Prevention and best practices
  • Add a “disk report” step at the start of the pipeline so the trend is visible.

See Lesson 2 Module 6 Pipeline Artifacts and Caching.

#18 VS30063: You are not authorized to access https://dev.azure.com/<org> (self-hosted agent registration/removal fails)
Connecting to server ...
Error reported in diagnostic logs. Please examine the log for more details.
    - /home/azdo/agent/_diag/Agent_20261115-081203-utc.log
VS30063: You are not authorized to access https://dev.azure.com/contoso.

Symptom:./config.sh or ./config.sh remove fails; the same PAT worked for registration before, but now cannot remove the agent.

Root cause: The PAT scope does not cover permissions: the user who creates the PAT must themselves hold the Administrator role on the agent pool, and the PAT needs Agent Pools (Read & manage) scope; in addition, the PAT may have expired or been revoked (after registration, the agent no longer uses the PAT, so remove often fails long afterwards); and writing the URL as a project URL or an old visualstudio.com address also causes problems.

Diagnostic commands
curl -s -o /dev/null -w "%{http_code}\n" --user ":${AZDO_PAT}" "https://dev.azure.com/contoso/_apis/distributedtask/pools?api-version=7.1"
grep -iE "VS30063|401|Unauthorized" ~/agent/_diag/Agent_*.log | tail -3
401
Fix
  • Using an account that has the Administrator role on the pool, generate a new organization-level PAT (Agent Pools Read & manage), and use only the organization in the URL: https://dev.azure.com/contoso.
  • If the agent has already been deleted on the server, the local config.sh remove failure can be ignored; delete the local directory and register again.
  • Better approach: register the agent with a service principal as described in Microsoft Learn, to avoid personal PATs.
Prevention and best practices
  • Include agent registration in the image/automation process, and revoke PATs as soon as they are no longer needed.

See Lesson 7 Module 3.

#19 Self-hosted agent cannot download or auto-upgrade (firewall only allows the old CDN vstsagentpackage.azureedge.net)

Symptom: The agent pool shows a new version available but upgrades keep failing; downloading the agent package on a new machine times out; when a task requires a higher agent version, the job queues because demands are not met (#14).

Root cause: After the Edgio CDN was retired, the agent software download domain changed from https://vstsagentpackage.azureedge.net to https://download.agent.dev.azure.com (migrated in 2025; the official blog says the old domain stopped working from 2025-06-11 and recommends allowing both old and new during the transition). Enterprise firewalls that only allow the old domain will cause downloads and auto-upgrades to fail.

Diagnostic commands
curl -sI https://download.agent.dev.azure.com | head -1
curl -sI https://vstsagentpackage.azureedge.net | head -1
grep -iE "download|update|azureedge" ~/agent/_diag/Agent_*.log | tail -5
curl: (28) Failed to connect to download.agent.dev.azure.com port 443 after 21003 ms: Timeout was reached
Fix
  • Allow in firewall/proxy download.agent.dev.azure.com (organizations that do not allow wildcards should list exact domains), and also check the full list on the Microsoft Learn “Allowed IP addresses and domain URLs” page (dev.azure.com,*.dev.azure.com,login.microsoftonline.com , etc.).
Prevention and best practices
  • Subscribe to infrastructure change notices in the Azure DevOps blog/release notes; use the documentation as the single source of truth for outbound rules, and review them quarterly.

See Lesson 7 Module 3.

#20 Jobs with vmImage: windows-2019 / ubuntu-20.04 no longer run (hosted images retired; before retirement there were intermittent “brownout” failures)

Symptom: Pipelines that have not changed in years suddenly fail or fail intermittently (during brownout, jobs are refused in scheduled windows); the error points to an unavailable/deprecated image (exact wording varies by image and stage).

Root cause: Microsoft-hosted images have a lifecycle: the Windows Server 2019 image was retired on 2025-12-31 ; Ubuntu 20.04 has also been retired; Ubuntu 22.04 is deprecated and scheduled for removal on 2027-04-17; macOS 14 has been deprecated since 2026-07-06. Brownouts are scheduled before retirement. The current ubuntu-latest = Ubuntu 24.04,windows-latest = Windows Server 2025 (official notes say it will soon point to the VS 2026 image), and also ubuntu-26.04,windows-2025-vs2026,macOS-26.

Diagnostic commands
# Find all pinned images in the repo
git grep -nE "vmImage: *['\"]?(windows-2019|ubuntu-20\.04|ubuntu-22\.04|macOS-1[34])" -- '*.yml' '*.yaml'
azure-pipelines.yml:4:  vmImage: windows-2019
templates/test.yml:9:  vmImage: 'ubuntu-22.04'
Fix
  • Migrate to a supported image; projects that need stability should pin to a specific version (such as ubuntu-24.04), and record the next deprecation date in your calendar.
  • For software differences (for example, .NET 6 was removed from the image on 2025-08-01), install explicitly with tool installer tasks.
Prevention and best practices
  • Centralize image names in one variable template so a single change applies everywhere; follow the runner-images repository and the “hosted deprecation schedule”.

See Lesson 2 Module 4.

#21 /azure-pipelines.yml (Line: 8, Col: 1): Unexpected value 'steps' (YAML compile error; the run never starts)
/azure-pipelines.yml (Line: 8, Col: 1): Unexpected value 'steps'
/templates/build.yml (Line: 3, Col: 1): A sequence was not expected
/azure-pipelines.yml: Unrecognized template parameter 'imageName'

Symptom: The error appears right after clicking Run, with no jobs at all; or it fails at “Validate”.

Root cause: This is an error in the compile stage: the service expands and evaluates the YAML and all templates ${{ }} , and only then validates against the schema. Common causes: writing both at the same level jobs: and steps:; a template type that does not match its insertion point (inserting a steps template under jobs); indentation errors; passing undeclared parameters to a template; mismatched parameter types.

Diagnostic commands
# 1) Preview the fully expanded YAML on the server (without actually running it)
az pipelines run --name lab8-smoke --branch main --debug 2>&1 | grep -i "Unexpected\|error" | head
# Web: editor ⋯ → Validate / Download full YAML; or run page ⋯ → Download logs, then view azure-pipelines-expanded.yaml
# 2) REST preview (previewRun=true returns finalYaml)
az devops invoke --area pipelines --resource preview --route-parameters project=myapp-lab pipelineId=12 \
  --http-method POST --in-file preview.json --api-version 7.1 --query finalYaml -o tsv | head -40

preview.json example: {"previewRun": true}; check the route parameter names in the Pipelines REST API documentation.

Fix
  • Correct the structure against the line and column in the error; a template file should contain only one kind of root key (steps/jobs/stages/variables).
  • Always declare parameters type, because an untyped scalar is treated as a string (for example, the string 'false' is true in a boolean context).
Prevention and best practices
  • Validate YAML in PRs with the preview API; install the Azure Pipelines extension in VS Code for schema hints.

See Lesson 2 Module 2 YAML Structure,Lesson 5 Module 1 Template Deep Dive.

#22 ${{ variables.version }} is empty / condition is always false / A template expression is not allowed in this context (compile time vs. run time)

Symptom: A previous step uses ##vso[task.setvariable] to set version, and later ${{ if eq(variables.version, '2.0') }} is never true; or values from a variable group cannot be read in template expressions.

Root cause:${{ }} In compile-time evaluation, at which point only the variables and parameters defined statically in the YAML and some predefined variables (such as Build.SourceBranch,Build.Reason) are visible; variables set during the run, variable groups (especially Key Vault-linked ones), and output variables do not exist yet at compile time. $[ ] Run-time evaluation (before the job or stage starts) applies to $( ) conditions, and macro substitution happens before each task executes.

Diagnostic commands
variables:
  staticVer: '2.0'
steps:
- bash: echo "##vso[task.setvariable variable=runtimeVer]2.0"
- bash: |
    echo "compile-time staticVer = ${{ variables.staticVer }}"
    echo "macro runtimeVer = $(runtimeVer)"
  condition: eq(variables['runtimeVer'], '2.0')     # run-time condition: can see
- ${{ if eq(variables.runtimeVer, '2.0') }}:        # compile time: never sees runtimeVer
  - bash: echo "never printed"
compile-time staticVer = 2.0
macro runtimeVer = 2.0
Fix
  • For branches that depend on run-time values, switch to condition: (run-time expression) or $[ ]; for cross-job values, see #24.
  • For inputs that must decide structure at compile time (whether a stage is generated), use runtime parameters (parameters:, filled in when queuing).
Prevention and best practices
  • Team convention: use parameters for structure + ${{ }}, the data uses variable + $( )/$[ ].

See Lesson 2, Module 5: Variables, variable groups and expressions.

#23 Pipeline did not trigger after push (UI override of YAML trigger / pr: not effective in Azure Repos / [skip ci] / draft PR)

Symptom: The YAML contains trigger: and pr:, but pushing to main or creating a PR starts no new run.

Root cause: (1) The pipeline settings have ticked Override the YAML continuous integration trigger from here, the YAML's trigger is ignored; (2) for Azure Repos Git, the YAML's pr: keyword has no effect; PR validation must go through the target branch's build validation branch policy; (3) commit messages containing [skip ci]/***NO_CI*** etc.; (4) draft PRs do not trigger build validation; (5) the YAML file has a syntax error on the new branch (the YAML on that branch is evaluated when a trigger fires); (6) the CI trigger's branch/path filters do not match.

Diagnostic commands
az pipelines show --name lab8-smoke --query "triggers[].{type:triggerType,settingsSourceType:settingsSourceType}" -o table
git log -1 --format=%B | grep -iE "skip ci|ci skip|no_ci|skip azurepipelines|skip azpipelines" || echo "no skip marker"
Type                    SettingsSourceType
----------------------  --------------------
continuousIntegration   1

settingsSourceType: 1 means the pipeline UI setting is used (override), 2 means the YAML is used (see the Build Definitions REST API docs).

Fix
  • Edit the pipeline → ⋯ → Triggers → clear “Override the YAML … trigger from here”.
  • PR validation: target branch → Branch policies → Build validation, select this pipeline.
Prevention and best practices
  • Maintain triggers only in YAML; after creating a new pipeline, push an empty commit right away to verify CI.

See Lesson 2, Module 3: Triggers.

#24 Downstream job gets an empty output variable: dependencies.Build.outputs['setver.version'] (or the value has an extra single quote at the end)

Symptom: The Build job sets the version number, but in the Deploy job $(ver) is empty, or the value becomes 1.4.0'.

Root cause: Passing values across jobs/stages requires all of the following: (1) the setting includes isOutput=true; (2) the variable-setting step has a name (referenced as stepName.variableName); (3) the downstream job depends on the dependsOn upstream; (4) use $[ dependencies.job.outputs['step.variable'] ] (across stages, use stageDependencies.stage.job.outputs[...], and deployment jobs also need the job-name prefix). An extra ' ' is a known issue documented by Microsoft Learn: in Bash, enabling set -x tracing makes the agent see the ##vso command a second time, with quotes.

Diagnostic commands
jobs:
- job: Build
  steps:
  - bash: |
      set +x                                      # avoid set -x adding an extra '
      echo "##vso[task.setvariable variable=version;isOutput=true]1.4.0"
    name: setver                                  # name is required
- job: Deploy
  dependsOn: Build
  variables:
    ver: $[ dependencies.Build.outputs['setver.version'] ]
  steps:
  - bash: echo "deploying [$(ver)]"
deploying [1.4.0]
Fix
  • Fill in the four items above one by one; for cross-stage use, check the stage dependsOn.
  • If you are unsure of the path, print $[ convertToJson(dependencies) ] in the downstream job to inspect the structure.
Prevention and best practices
  • Wrap “set output variable” in a template step and standardize the naming convention.

See Lesson 2, Module 5,Lesson 5, Module 2: Multi-stage pipelines.

#25 Template expansion fails: too many referenced template files / nesting too deep / parse memory exceeded (template limits; error wording may differ)

Symptom: The platform team split shared templates into many small files and nested them layer by layer. One day, after adding one more template, all pipelines failed to compile, with errors citing the template count, nesting, or oversized YAML.

Root cause: Azure Pipelines enforces hard limits on template expansion (current Microsoft Learn docs): the number of YAML files directly or indirectly included must not exceed 100; template nesting must not exceed 100 levels; while parsing YAML, memory must not exceed 20 MB (in practice roughly 600 KB–2 MB of YAML on disk, depending on the features used). ${{ each }} Generating large numbers of stages or jobs in loops also quickly inflates the expanded size.

Diagnostic commands
# Count the templates a run actually references (expanded YAML and template list in the downloaded logs)
grep -rhoE "template: *[^ ]+" . | sort | uniq -c | sort -rn | head
wc -c azure-pipelines-expanded.yaml
Fix
  • Merge overly fine-grained templates; use parameters (object/stepList) instead of “one file per variant”.
  • Change the each generated matrix to run time strategy.matrix (instead of expanding into separate jobs at compile time), or split into multiple pipelines.
Prevention and best practices
  • Set up CI in the shared template repository: call the preview API on representative pipelines and monitor the expanded size and template count.

See Lesson 5, Module 1: Templates in depth.

Figure 2-1 · Lifecycle of a pipeline run (errors mapped to their stage)

TriggerCI / policy / schedule CompileTemplate expansion ${{ }} Resource authorization / checksService connections · pools · environments QueueParallel jobs Agent picks updemands match Task execution$( ) macros · $[ ] Logs/artifactsStatus #23 No triggerUI override / skip ci #21 Unexpected value#22 Compile-time variables#25 Template limits #26 #27 (Module 3)#12 Repo not authorized #13 No parallel quota#14 Parallel limit reached #14 demands#18 #19 #20 #15 Timeout #16 Agent lost#17 Disk #24 #39–#41Artifacts/source
“No jobs at all” = compile or authorization stage; “stuck in Queued” = queue or agent-matching stage; “fails midway” = execution stage.

Figure 2-2 · When the three variable syntaxes are evaluated

SyntaxEvaluatedVisible toTypical use
${{ variables.x }}Compile time (during template expansion)YAML static variables, parameters, some predefined variablesDetermines structure: whether a stage/step is generated
$[ variables.x ]Run time, before the job/stage startsUpstream output variables (dependencies), runtime variablesPassing values across jobs, job-level variables
$(x)Macro substitution before each task runsAll variables set within the current jobScript arguments, task inputs

Interactive troubleshooting decision tree: “pipeline did not run / stuck in queue / failed”.

Lab 1: Compile errors and expanded YAML (#21)
# Reproduce: create bad.yml in lab8
jobs:
- job: a
  steps:
  - script: echo a
steps:                # same level as jobs → Unexpected value 'steps'
- script: echo b
# Diagnose: use Validate in the editor and read the line/column numbers; fix: move the second part into a new job. Cleanup: delete bad.yml and the corresponding pipeline
Lab 2: Output variables (#24)
# Reproduce: using the #24 YAML, first remove name: setver and run once → [ ] is empty; then add set -x (remove set +x) → an extra ' appears at the end of the value
# Fix: restore name and set +x; verify: output deploying [1.4.0]
Lab 3: Trigger override (#23)
# Reproduce: edit lab8-smoke → ⋯ → Triggers → tick Override the YAML continuous integration trigger, and clear Enable continuous integration
git commit --allow-empty -m "trigger test" && git push      # no new run
az pipelines show --name lab8-smoke --query "triggers[].settingsSourceType"
# Fix: clear the override → push another empty commit, a new run appears
Lab 4: Unmet demands (#14, requires a self-hosted agent)
pool:
  name: lab8-pool
  demands:
  - docker            # agent machine has no Docker installed → job stays queued
steps:
- script: docker version
# Fix: install Docker on the agent machine and run sudo ./svc.sh stop && sudo ./svc.sh start (re-scan capabilities); or delete demands
# Cleanup: cancel the queued run
Acceptance checklist

Tutorial videos (titles and channels verified via YouTube oEmbed)

▶
Templates in Azure Pipelines: What, Why, and How — CoderDave
English · Template types and parameters (for #21, #25)
▶
(Simple?) Real World Azure Pipelines YAML Walkthrough — Julie Ng
English · YAML structure, variables and templates in real projects
▶
Azure Managed DevOps Pools Explained: A Game Changer for Hosting Agents — Programming with Wolfgang
English · Options beyond hosted agent limits (for #15–#17)
Scene 1 (0:00) Figure 2-1 lifecycle bar lights up each stage in turn; deliberately cause a compile error and show the run page with “no jobs”.
Scene 2 (0:50) Split screen: ${{ }} and $[ ] the same variable outputs differently; narration explains compile time vs. run time.
Scene 3 (1:40) Pool consumption report curve: queued jobs hit the parallel limit, leading to #13/#14.

Official docs:Troubleshoot pipeline runs · Templates · Microsoft-hosted agents

Scoring ≥ 70% on the quiz also marks it automatically.

Module 3 · Part A: Service connections, deployment and cloud platforms (questions 26–38)

16:00 – 24:00 · Resource authorization, workload identity federation, Entra errors, Azure RBAC, Key Vault, AWS OIDC, AKS
8 minresource authorization · AADSTS7002xx · AuthorizationFailed13 questions
Learning objectives
  • Split deployment failures into three segments: Azure DevOps side (whether the service connection exists, is enabled, is authorized for the pipeline, and passes checks) → Identity exchange (the OIDC token issued by ADO → Entra / AWS STS exchanges it for an access token) → Cloud-side authorization (Azure RBAC, Key Vault, AKS RBAC, IAM).
  • Remember the two issuer/subject formats: the legacy Azure DevOps issuer https://vstoken.dev.azure.com/<organization ID> + sc://<organization>/<project>/<service connection>; the Entra issuer used by new service connections https://login.microsoftonline.com/<tenant ID>/v2.0 + <prefix>/sc/<organization ID>/<service connection ID>.
  • Can read AADSTS error codes and map them to the issuer, subject, secret, token lifetime, or tenant policy.

Enter a keyword (e.g. AADSTS,authorization,Key Vault,AssumeRole) to filter; click a row to jump to the detailed explanation.

#26 There was a resource authorization issue: "The pipeline is not valid. … references service connection … which could not be found. The service connection does not exist, has been disabled or has not been authorized for use."
There was a resource authorization issue: "The pipeline is not valid. Job Deploy: Step AzureCLI input
connectedServiceNameARM references service connection sc-azure-prod which could not be found. The service
connection does not exist, has been disabled or has not been authorized for use. For authorization details,
refer to https://aka.ms/yamlauthz."

Symptom: The run fails during the compile/authorization stage, with no jobs executed.

Root cause: The service connection is resolved at compile time by name (or ID): (1) the name is misspelled, has different casing/spaces, or the connection is in another project (not shared to this project); (2) the connection is disabled (including #31 auto-disable); (3) the connection is not authorized for this pipeline; (4) passing the service connection name via a variable —a service connection cannot be specified through a runtime variable, it must be a value known at compile time (a literal, a parameter, or ${{ }} an evaluable variable).

Diagnostic commands
az devops service-endpoint list --query "[].{name:name,type:type,ready:isReady,shared:isShared}" -o table
SC=$(az devops service-endpoint list --query "[?name=='sc-azure-prod'].id" -o tsv); echo "id=$SC"
# List which pipelines are authorized for this connection (Pipeline permissions REST, resource type endpoint)
az devops invoke --area pipelinePermissions --resource pipelinePermissions \
  --route-parameters project=myapp-lab resourceType=endpoint resourceId=$SC --api-version 7.1-preview -o jsonc
Name            Type      Ready    Shared
--------------  --------  -------  --------
sc-azure-dev    azurerm   True     False
{ "allPipelines": { "authorized": false }, "pipelines": [ { "id": 7, "authorized": true } ] }
Fix
  • Correct the name; for cross-project use, “Share with projects” on the connection.
  • In the connection's Security → Pipeline permissions, add this pipeline (or click Authorize on the run page, see #27).
  • To select the environment dynamically, use template parameters: azureSubscription: ${{ parameters.sc }}.
Prevention and best practices
  • Do not enable “Grant access permission to all pipelines” for production connections; authorize per pipeline and combine with approval checks.

See Lesson 3, Module 2: Service connections: workload identity federation,Lesson 6, Module 3.

#27 This pipeline needs permission to access a resource before this run can continue

Symptom: The run is stuck, and a yellow banner at the top shows the message above (sometimes “needs permission to access 2 resources before this run can continue to Deploy”).

Root cause: This is first-time authorization of a protected resource: the first time a pipeline references a service connection, agent pool, variable group, secure file, environment, or repository, a resource administrator must “Permit” it. Unlike #26, the resource exists and is usable; it just has not been authorized for this pipeline yet. It is also not an approval check (approvals live under the environment's Approvals and checks).

Diagnostic commands
# Web: run page banner → View → Waiting for review → lists the resources that need authorization
# Or check the resource's Security → Pipeline permissions; agent pools can be set to Open access (project administrators)
Fix
  • A resource administrator clicks Permit (this adds the pipeline to the resource's authorized list); the same pipeline will not prompt again afterwards.
  • For non-sensitive resources (such as a general agent pool), Open access can be enabled at project level; keep sensitive resources authorized one by one.
Prevention and best practices
  • Add a “first-run authorization” step to the new pipeline launch checklist; do not have only one person in the resource administrator role.

See Lesson 3, Module 3: Environments, approvals and checks.

#28 AADSTS700213: No matching federated identity record found for presented assertion subject (after renaming the organization/project/service connection)
ERROR: AADSTS700213: No matching federated identity record found for presented assertion subject
'sc://contoso/myapp-lab/sc-azure-prod'. Please note that the matching is done using a case-sensitive comparison.

Symptom: A workload identity federation (WIF) service connection that had been working starts failing after the organization or project is renamed, or after a manually created service connection is renamed.

Root cause: During token exchange, Entra uses issuer + subject + audience an exact (case-sensitive) match on the app registration / managed identity's federated credential. For connections that use the Azure DevOps issuer, the subject is sc://<organization name>/<project name>/<service connection name>, so renaming any segment causes a mismatch; a deleted or never-created federated credential produces the same error. (Connections using the new Entra issuer have a subject based on the organization ID and service connection ID, so renaming does not affect them.)

Diagnostic commands
# Issuer and subject in the service connection details (also visible in the edit dialog)
az devops service-endpoint show --id $SC --query "authorization.parameters.{issuer:workloadIdentityFederationIssuer,subject:workloadIdentityFederationSubject,clientId:serviceprincipalid}" -o jsonc
# Identity side: federated credentials on the app registration (or managed identity)
az ad app federated-credential list --id <clientId> --query "[].{name:name,issuer:issuer,subject:subject,aud:audiences[0]}" -o table
Name          Issuer                                              Subject                                   Aud
------------  --------------------------------------------------  ----------------------------------------  --------------------------
ado-sc-prod   https://vstoken.dev.azure.com/1b2c…                 sc://contoso/myapp-old/sc-azure-prod      api://AzureADTokenExchange
Fix
  • Identity created by Azure DevOps: edit and save the service connection so it updates the issuer/subject (official docs state the issuer for Azure identities is updated automatically).
  • Manually created identity: update the federated credential's subject (and issuer) to the values shown on the service connection.
Prevention and best practices
  • List all WIF connections before renaming; prefer connections that use the new Entra issuer format.

See Lesson 3, Module 2.

#29 AADSTS70021 / AADSTS700211: No matching federated identity record found for presented assertion issuer (issuer mismatch)
AADSTS70021: No matching federated identity record found for presented assertion.
Assertion Issuer: 'https://app.vstoken.visualstudio.com'.

Symptom: A WIF connection configured manually from an old blog's steps fails from the start; or a federated credential created by an automation script has the wrong issuer.

Root cause: The issuer of a new service connection is https://login.microsoftonline.com/<tenant ID>/v2.0, and the legacy connection's issuer is https://vstoken.dev.azure.com/<organization ID>; if the federated credential has any other value (or an old domain), it will not match. Note that tokens issued by the Entra issuer can only be exchanged for Entra access tokens; scenarios that federate with other identity providers (e.g., AWS, GCP) use the Azure DevOps issuer.

Diagnostic commands
az devops service-endpoint show --id $SC --query "authorization.parameters.workloadIdentityFederationIssuer" -o tsv
az ad app federated-credential list --id <clientId> --query "[].issuer" -o tsv
Fix
  • Update the federated credential to match the issuer shown in the service connection edit dialog (or REST response); identities created by Azure DevOps can be corrected automatically via “Edit and save”.
Prevention and best practices
  • When automating WIF connection creation, follow the order “create the service connection → read the issuer/subject → then create the federated credential” (the official docs stress the object creation order).

See Lesson 3, Module 2.

#30 AADSTS7000215: Invalid client secret provided. / AADSTS7000222: The provided client secret keys … are expired.

Symptom: Legacy service connections using the “Service principal (secret)” method fail together on one day, usually exactly 1–2 years after creation (the secret expiry date).

Root cause: Connections based on a client secret store the secret in Azure DevOps; when the secret expires or is rotated, the connection stops working. The Microsoft Learn recommendation for AADSTS7000215 is to convert the service connection to workload identity federation, replacing the expired secret with a federated credential.

Diagnostic commands
az ad app credential list --id <clientId> --query "[].{hint:hint,end:endDateTime}" -o table
az devops service-endpoint show --id $SC --query "authorization.scheme" -o tsv     # ServicePrincipal or WorkloadIdentityFederation
Hint    End
------  -------------------------
Xy3     2026-11-01T08:12:44Z
ServicePrincipal
Fix
  • On the service connection page, use Convert (Convert to workload identity federation); after converting, verify that all tasks using the connection support WIF (#35).
  • Short-term stopgap: rotate the secret and update the connection (conversion is still needed as soon as possible).
Prevention and best practices
  • Inventory all scheme=ServicePrincipal connections, make a conversion plan; do not create new secret-based connections.

See Lesson 3, Module 2,Lesson 6, Module 2.

#31 Long-unused pipeline fails as soon as it runs: service connection automatically disabled after 100 days of non-use

Symptom: The quarterly release/disaster-recovery pipeline reports a “has been disabled” error like #26, or an authentication failure; the service connection page shows the connection as disabled.

Root cause: The Microsoft Learn troubleshooting docs state that Azure Pipelines disables service connections inactive for 100 days, and disable and enable actions are recorded in the audit log.

Diagnostic commands
# Web: Project settings → Service connections → select the connection → Overview / Usage history (last used time, whether disabled)
az devops service-endpoint show --id $SC --query "{ready:isReady,disabled:isDisabled}" -o jsonc
# Audit: Organization settings → Auditing, filter service connection events in the Library category
Fix
  • After confirming it is still needed: More actions → Enable; re-run. If authentication still fails, check whether the underlying identity/secret is valid (#30).
Prevention and best practices
  • Run a side-effect-free “dry run” of disaster-recovery/low-frequency pipelines monthly (e.g. az account show), which keeps the connection active and verifies it still works.
  • Delete connections you no longer need to reduce the attack surface.

See Lesson 3, Module 7: Hands-on troubleshooting of cloud deployments.

#32 AuthorizationFailed: The client '…' with object id '…' does not have authorization to perform action 'Microsoft.Resources/deployments/write' over scope '…'
ERROR: (AuthorizationFailed) The client '3f6a…' with object id '9c2d…' does not have authorization to perform
action 'Microsoft.Resources/deployments/write' over scope '/subscriptions/…/resourcegroups/rg-ado-lab/providers/
Microsoft.Resources/deployments/main' or the scope is invalid. If access was recently granted, please refresh your credentials.

Symptom: Token exchange succeeds (the log shows a successful sign-in), but the deployment returns 403.

Root cause: Authentication and authorization are different things: the app registration/managed identity behind the service connection does not have enough Azure RBAC roles at the target scope. Common causes: the connection was created with scope resource group A, but the deployment targets resource group B; or the deployment needs to create role assignments (requires User Access Administrator / RBAC Administrator; Contributor is not enough); or the role was just granted but the token was not refreshed (RBAC propagation can take a few minutes).

Diagnostic commands
- task: AzureCLI@2
  inputs:
    azureSubscription: sc-azure-dev
    scriptType: bash
    scriptLocation: inlineScript
    inlineScript: |
      az account show --query "{sub:id,user:user.name,type:user.type}" -o table
      az role assignment list --assignee "$(az account show --query user.name -o tsv)" --all \
        --query "[].{role:roleDefinitionName,scope:scope}" -o table
Role         Scope
-----------  ------------------------------------------------------------
Contributor  /subscriptions/…/resourceGroups/rg-ado-dev
Fix
  • Grant the minimum role at the correct scope (e.g., Contributor at resource group level); when role assignments are needed, use RBAC Administrator with conditions rather than Owner.
  • After granting, re-run (new jobs acquire new tokens).
Prevention and best practices
  • One service connection, one identity and one resource group scope per environment; manage role assignments with IaC.

See Lesson 3, Module 6: Infrastructure-as-code pipelines,Module 7.

#33 AADSTS700024: Client assertion is not within its valid time range (authentication fails midway through a long-running script)

Symptom: The first half of the AzureCLI task runs normally; after about 1 hour (or between 10 minutes and 1 hour), subsequent az commands fail with this error.

Root cause: In WIF, the OIDC assertion (client assertion) issued by Azure DevOps has a short lifetime; when the second half of the script first requests an access token for a resource, the CLI must exchange the assertion again, and by then it has expired. Microsoft Learn recommends: failure at about 1 hour → switch to a service connection using “workload identity federation + managed identity” (managed identity tokens last about 24 hours); failure between 10 minutes and 1 hour → move commands that need access tokens (e.g., accessing storage) to the start of the script so the tokens are cached early.

Diagnostic commands
# Print a timeline in the script to locate the first failing command
date -u +%T; az storage account list -g rg-ado-lab -o none; date -u +%T
Fix
  • Split long tasks into multiple steps (each task signs in again to get a new assertion); prefetch tokens; or switch to a managed-identity-based WIF connection.
Prevention and best practices
  • Run long data migrations/deployments in dedicated jobs, and re-authenticate at task boundaries.

See Lesson 3, Module 7.

#34 Script failed with error: UnrecognizedArgumentError: unrecognized arguments: --federated-token

Symptom: The same pipeline works on Microsoft-hosted agents, but the AzureCLI task fails to sign in on self-hosted agents.

Root cause: Under WIF, the AzureCLI task calls az login --federated-token; this parameter requires Azure CLI 2.30 or later. The Azure CLI version on the self-hosted agent machine is too old.

Diagnostic commands
az version --query '"azure-cli"' -o tsv
2.28.0
Fix
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash   # upgrade to the current version, then restart the agent service
cd ~/agent && sudo ./svc.sh stop && sudo ./svc.sh start
Prevention and best practices
  • Pin and regularly upgrade the CLI in the agent image; or use a tool-installer step at the start of the job to guarantee the version.

See Lesson 7, Module 3.

#35 Could not fetch access token for Azure / Identity not found (task version does not support workload identity federation)
Could not fetch access token for Azure
Identity not found
cannot request token: Get "?audience=api://AzureADTokenExchange": unsupported protocol scheme

Symptom: After converting the service connection to WIF, some tasks start failing, while AzureCLI@2 works fine.

Root cause: Older task versions do not support WIF. The Microsoft Learn compatibility table gives examples: AzureFileCopy@1–@5 must switch to @6; KubernetesManifest@0→@1; Kubernetes@0→@1; AzureMonitor@0→@1; PackerBuild@0→@1; AzureNLBManagement@1,ServiceFabricDeploy@1 etc. are not supported. For Marketplace extensions, contact the publisher.

Diagnostic commands
git grep -nE "task: *(AzureFileCopy@[1-5]|KubernetesManifest@0|Kubernetes@0|AzureMonitor@0|PackerBuild@0|AzureCloudPowerShellDeployment@1)" -- '*.yml' '*.yaml'
Fix
  • Upgrade the task major version (watch for input parameter changes); for unsupported tasks, use the CLI inside AzureCLI@2 to do the same operation.
Prevention and best practices
  • Before converting service connections, run the grep above once to build an upgrade list.

See Lesson 3, Module 2.

#36 Key Vault variable group / AzureKeyVault task: does not have secrets list permission on key vault / ForbiddenByRbac
The user, group or application 'appid=3f6a…;oid=9c2d…' does not have secrets list permission on key vault 'kv-myapp-prod;location=canadacentral'.
Caller is not authorized to perform action on resource. … Action: 'Microsoft.KeyVault/vaults/secrets/getSecret/action' … Code: ForbiddenByRbac

Symptom: Authorization fails for a variable group linked to Key Vault, or the AzureKeyVault@2 task fails to fetch secrets; the 403 may also come from networking (firewall / private endpoint).

Root cause: Key Vault has two authorization models: access policies (require Get and List secret permissions) and Azure RBAC (require data-plane roles such as Key Vault Secrets User). A service connection identity that is Contributor on the management plane does not mean it can read secrets. When the Key Vault firewall is enabled, Microsoft-hosted agents come from public IP ranges and are rejected (a network-type 403).

Diagnostic commands
az keyvault show -n kv-myapp-prod --query "{rbac:properties.enableRbacAuthorization,publicNetwork:properties.publicNetworkAccess,defaultAction:properties.networkAcls.defaultAction}" -o table
az role assignment list --scope $(az keyvault show -n kv-myapp-prod --query id -o tsv) --query "[].{who:principalName,role:roleDefinitionName}" -o table
Rbac    PublicNetwork    DefaultAction
------  ---------------  ---------------
True    Enabled          Deny
Fix
  • RBAC model: assign the service connection identity on this Key Vault Key Vault Secrets User; access policy model: grant Get and List.
  • Networking: use self-hosted agents deployed inside a VNet / Managed DevOps Pools (VNet injection) instead of opening public access.
Prevention and best practices
  • One Key Vault per environment; link only the secrets a variable group needs; secrets are masked automatically in logs, but still avoid echoing them.

See Lesson 6, Module 4: Secret management: Key Vault variable groups and secure files.

#37 Not authorized to perform sts:AssumeRoleWithWebIdentity (OIDC with AWS Toolkit for Azure DevOps)
An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation:
Not authorized to perform sts:AssumeRoleWithWebIdentity

Symptom: The AWS service connection has “Use OIDC” ticked, and AWS tasks (such as AWSShellScript, S3Upload) fail when obtaining credentials.

Root cause: AWS Toolkit for Azure DevOps supports OIDC starting from 1.15.0: the task requests an OIDC token from Azure DevOps, then calls STS AssumeRoleWithWebIdentity. On the IAM side, requirements are: (1) an OIDC identity provider exists, with URL vstoken.dev.azure.com/<organization ID>; (2) the role's trust policy allows this provider, and the condition key vstoken.dev.azure.com/<organization ID>:sub must match sc://<organization>/<project>/<service connection name> exactly, and :aud must match the token audience (the AWS official blog example uses api://AzureADTokenExchange; the blog / Toolkit README is authoritative). Renaming, or a wrong organization ID (it should be a GUID, not the organization name), are the most common causes.

Diagnostic commands
aws iam list-open-id-connect-providers
aws iam get-role --role-name azdo-federation --query "Role.AssumeRolePolicyDocument" --output json
"Condition": { "StringEquals": {
  "vstoken.dev.azure.com/1b2c3d4e-…:sub": "sc://contoso/myapp-lab/aws-oidc-federation",
  "vstoken.dev.azure.com/1b2c3d4e-…:aud": "api://AzureADTokenExchange" } }
Fix
  • Correct it to match the service connection's actual organization / project / name sub; use the organization ID (Organization settings → Overview, or the instance ID in REST _apis/connectionData responses) to correct the provider URL and the condition key.
  • Confirm the Toolkit extension version is ≥ 1.15.0.
Prevention and best practices
  • One AWS role and service connection per environment; use StringEquals exact matches in the trust policy, and do not use wildcards to open up the entire organization.

See Lesson 4, Module 2: AWS service connections and credentials (including OIDC).

#38 Error from server (Forbidden): deployments.apps is forbidden: User "…" cannot list resource "deployments" in API group "apps" in the namespace "shop"

Symptom: Deployment to AKS with KubernetesManifest@1 / Kubernetes@1 fails; or the Kubernetes resource in the environment shows it cannot retrieve workloads.

Root cause: After AKS enables Microsoft Entra integration, authorization for the Kubernetes API depends on Kubernetes RBAC or Azure RBAC for Kubernetes: the service connection identity gets cluster credentials (so it can connect) but is not granted shop a Role/RoleBinding in the namespace, or an Azure role (e.g., Azure Kubernetes Service RBAC Writer). Also, since Kubernetes 1.24, long-lived token Secrets are no longer auto-generated for ServiceAccounts; an environment resource set up with the “ServiceAccount” method from an older tutorial may need a token Secret created manually (follow the current docs).

Diagnostic commands
kubectl auth can-i list deployments -n shop --as "<service connection identity objectId or SA>"
az aks show -g rg-ado-lab -n aks-lab --query "{aad:aadProfile.managed,azureRbac:aadProfile.enableAzureRbac,localAccounts:disableLocalAccounts}" -o table
no
Aad    AzureRbac    LocalAccounts
-----  -----------  ---------------
True   True         True
Fix
  • Azure RBAC mode: assign Azure Kubernetes Service RBAC Writer to the identity at cluster or namespace scope; Kubernetes RBAC mode: create a namespace-level RoleBinding.
  • Use a task version that supports WIF (#35).
Prevention and best practices
  • One deployment identity per namespace, with permissions scoped to that namespace; disable local accounts.

See Lesson 3, Module 5: Deploying to AKS and App Service,Kubernetes course.

Figure 3-1 · Token exchange in workload identity federation (Azure and AWS)

Task (on the agent)AzureCLI@2 / AWS tasks Azure DevOps issues OIDC tokeniss · sub · aud#26 #27 #31 before this point Microsoft Entra token exchangeMatch federated credential#28 #29 #33 AADSTS… AWS STS AssumeRoleWithWebIdentityOIDC provider + trust policy#37 ARM / Key Vault / AKSRBAC: #32 #36 #38 AWS APIIAM policy
Tokens issued by the Entra issuer can only be exchanged for Entra access tokens; federating with external identity providers such as AWS uses the Azure DevOps issuer (vstoken.dev.azure.com).

Table 3-2 · AADSTS error code quick reference (from Microsoft Learn WIF troubleshooting)

Error codeMeaningRelated question
AADSTS700213subject mismatch / federated credential not created#28
AADSTS70021 · AADSTS700211issuer mismatch / federated credential not created#29
AADSTS7000215Client secret invalid (often expired)#30
AADSTS700024Client assertion is not within its valid time range#33
AADSTS700016Application not found (identity deleted or wrong clientId)Related to #28
AADSTS70025No federated credentials on the application / managed identityRelated to #28
AADSTS700223 · AADSTS700238Tenant disables or restricts workload identity federationContact the Entra administrator
AADSTS70052Multitenant app registrations are not supported by the Entra issuerSwitch to single-tenant

Interactive troubleshooting decision tree: “deployment authentication / authorization failed”.

Requires a disposable Azure subscription; all resources are in rg-ado-lab . Estimated cost: near zero except for AKS; required permission: subscription Owner (to create identities and role assignments).

Lab 1: Resource authorization (#26 / #27)
# Setup: create WIF service connection sc-lab8 using a managed identity (Project settings → Service connections → Azure Resource Manager → Workload identity federation, scope rg-ado-lab)
az group create -n rg-ado-lab -l canadacentral -o none
# Reproduce A: YAML sets azureSubscription: sc-lab8-typo → resource authorization issue (#26)
# Reproduce B: change back to sc-lab8, remove this pipeline in the connection's Security → the run shows “needs permission” (#27) → Permit
Lab 2: subject mismatch (#28)
# Reproduce: change one character in the subject of the managed identity's federated credential (portal → managed identity → Federated credentials)
# Diagnose: AzureCLI@2 log shows AADSTS700213; compare with the subject shown in the service connection
# Fix: restore the correct subject (or edit and save the service connection)
Lab 3: Insufficient RBAC (#32)
- task: AzureCLI@2
  inputs:
    azureSubscription: sc-lab8
    scriptType: bash
    scriptLocation: inlineScript
    inlineScript: az group create -n rg-ado-lab-other -l canadacentral   # out of scope → AuthorizationFailed
# Fix approach: do not widen permissions; instead limit the deployment target to rg-ado-lab
Cleanup
az group delete -n rg-ado-lab --yes --no-wait
# Delete service connection sc-lab8; delete the managed identity / app registration created for it and its federated credentials
Acceptance checklist

Tutorial videos (titles and channels verified via YouTube oEmbed)

▶
Azure DevOps Workload Identity Federation with Azure Overview. NO MORE SECRETS! — John Savill's Technical Training
English · WIF token flow, creating and converting service connections (for #28–#30)
▶
Azure DevOps Environments: Checks and Gates DEEP DIVE — CoderDave
English · Environment checks (for #27)
▶
¿Cómo federar en AWS desde Azure DevOps mediante OpenID Connect? — Sistemas Cloud SyH
Spanish · Azure DevOps → AWS OIDC federation (for #37)
Scene 1 (0:00) Figure 3-1 animation: the token leaves Azure DevOps and branches to Entra and AWS STS.
Scene 2 (0:50) Change one character in the subject → AADSTS700213; show the service connection and federated credential side by side, highlighting the difference.
Scene 3 (1:40) Sign-in succeeds but AuthorizationFailed: narration “authentication passed ≠ authorization passed”, showing the role assignment scope.

Official docs:Troubleshoot workload identity service connections · Approvals and checks · AWS: federate from Azure DevOps with OIDC

Scoring ≥ 70% on the quiz also marks it automatically.

Module 4 · Part A: Security, governance, artifacts and billing (questions 39–50)

24:00 – 30:00 · Azure Artifacts, secrets, GHAzDO, organization policies, auditing, parallel jobs and licensing/billing, platform retirements
6 min2 GiB · 409 · E401 · secrets12 questions
Learning objectives
  • Understand three key Azure Artifacts constraints: 2 GiB free,version numbers cannot be reused, and feed permissions are granted per identity (including the build service).
  • Explain how secrets flow through pipelines: secret variables do not automatically become environment variables, fork builds get no secrets by default, and log masking is only the last line of defense.
  • Know several organization-level facts that “silently change behavior”: new organizations disable classic pipelines by default, auditing is off by default and retained for only 90 days, the first purchase of parallel jobs only removes the time limit, and public projects are retired.

Enter a keyword (e.g. 409,E401,secret,audit,parallel) to filter; click a row to jump to the detailed explanation.

#39 Azure Artifacts cannot publish new packages: organization has reached the 2 GiB free storage limit (error wording may differ)

Symptom: Publishing to all feeds starts failing at the same time; Organization settings → Storage shows Artifacts usage is full.

Root cause: Azure Artifacts provides each organization with 2 GiB free storage (mainly for evaluation). Once the limit is reached,new packages cannot be published, until packages are deleted to free space or billing is set up and the usage limit is changed to “No limit, pay for what you use”. CI publishing prerelease versions on every build with no retention policy is the most common source of growth; packages in the recycle bin also consume space until permanently deleted (see the docs).

Diagnostic commands
# Web: Organization settings → Storage (view usage by feed / package type)
# List packages and their versions in a feed (Feed Management REST API: GET .../_apis/packaging/Feeds/{feedId}/packages?includeAllVersions=true)
curl -s --user ":${AZDO_PAT}" \
  "https://feeds.dev.azure.com/contoso/myapp-lab/_apis/packaging/Feeds/myfeed/packages?includeAllVersions=true&api-version=7.1" \
  | jq -r '.value[] | "\(.versions|length)\t\(.name)"' | sort -rn | head
412	myapp-web
188	myapp-shared
Fix
  • Configure a retention policy (keep the most recent N versions per package), and empty the recycle bin.
  • For production use: set up billing and adjust the Artifacts usage limit.
Prevention and best practices
  • Publish CI prerelease packages to a separate feed (or use views: @local / @prerelease / @release), with a short retention period.
  • For build intermediates, use pipeline artifacts instead of Artifacts feeds.

See Lesson 5, Module 4: Azure Artifacts: feeds, upstreams and retention.

#40 Response status code does not indicate success: 409 (Conflict - The feed already contains file '….nupkg' in package '… 1.0.0') (version already exists / once existed)
error: Response status code does not indicate success: 409 (Conflict - The feed 'myfeed' already contains file
'MyLib.1.0.0.nupkg' in package 'MyLib 1.0.0'. (DevOps Activity ID: 6E1C…)).

Symptom: Re-running the publish pipeline fails; or after deleting a mistaken 1.0.0, republishing the same version also fails.

Root cause: Package versions in Azure Artifacts are immutable: the same package ID + version can only be published once,and the version number cannot be reused even after deletion (this prevents consumers from getting different content under the same number). When the pipeline is re-run without a version change, it conflicts.

Diagnostic commands
dotnet nuget list source; dotnet package search MyLib --source myfeed --exact-match --prerelease 2>/dev/null
# Web: feed → package → Versions (including deleted versions, visible in the recycle bin)
Fix
  • Publish a new version number (1.0.1); generate it in the pipeline (e.g. 1.0.$(Build.BuildId) or GitVersion), do not write it by hand.
  • To allow re-runs to skip existing versions, NuGet uses --skip-duplicate (use only when it is truly the same artifact).
Prevention and best practices
  • Only the main branch's release stage publishes official versions; PR/branch builds publish prerelease versions with a suffix.

See Lesson 5, Module 5: Version numbers, tags and release notes.

#41 npm ERR! code E401 / NuGet 401 Unauthorized: pipeline restore from Azure Artifacts feed fails
npm ERR! code E401
npm ERR! Unable to authenticate, need: Bearer authorization_uri=https://login.windows.net/…, Basic realm="https://pkgsprodcus1.pkgs.visualstudio.com/", TFS-Federated

Symptom: Restore works on a local machine but not in the pipeline; or project A's pipeline cannot read project B's feed.

Root cause: (1) The pipeline does not run an authentication task: npm needs npmAuthenticate@0, NuGet needs NuGetAuthenticate@1, Python needs PipAuthenticate@1, and they write System.AccessToken into temporary credentials; (2) the build service identity has no role on the feed (a project-scoped feed grants its own project's Build Service by default; for organization-scoped or cross-project feeds, manually grant at least Feed Reader to the relevant build service); (3) using a PAT as the NuGet API key, which Azure Artifacts does not support.

Diagnostic commands
steps:
- task: npmAuthenticate@0
  inputs:
    workingFile: .npmrc          # registry=https://pkgs.dev.azure.com/contoso/myapp-lab/_packaging/myfeed/npm/registry/ in .npmrc
- script: npm ci --loglevel=http 2>&1 | grep -E "GET|40[13]" | head

Confirm in Feed settings → Permissions that the myapp-lab Build Service (contoso) (or Project Collection Build Service) has the required role.

Fix
  • Add the matching authentication task; grant Feed Reader on the feed to the correct build service identity (publishing requires Feed Publisher (Contributor)).
  • Locally, use the Azure Artifacts Credential Provider instead of writing a PAT into .npmrc/nuget.config and committing it.
Prevention and best practices
  • Commit only credential-free .npmrc/nuget.config files to the repo; credentials are always injected by the auth task or credential provider.

See Lesson 5, Module 4.

#42 Installing public package from feed returns 404 / public package is not saved to feed (upstream source not configured or insufficient permissions)

Symptom: After pointing the registry at the Azure Artifacts feed,npm install left-pad it returns 404; or developers can install it, but the pipeline fails to install the same new package.

Root cause: To proxy npmjs / nuget.org / PyPI, the feed needs upstream sources (up to 20 upstreams per feed per package type). Also, the first time a package is pulled from upstream and saved to the feed, the identity must have Feed and Upstream Reader (Collaborator) or a higher role; an identity with only Feed Reader can read only packages that are already saved. Pipeline build service identities often have only Reader.

Diagnostic commands
# Web: feed settings → Upstream sources; check the build service role under Permissions
npm view left-pad --registry https://pkgs.dev.azure.com/contoso/myapp-lab/_packaging/myfeed/npm/registry/
Fix
  • Add public upstreams; grant Feed and Upstream Reader (Collaborator) to identities that need “first-time pulls” (e.g., the build service).
Prevention and best practices
  • Route all dependencies through the feed (auditable, cacheable, and able to block withdrawn packages); pair with dependency scanning (GHAzDO Code Security).

See Lesson 5, Module 4.

#43 In PR builds from a fork, secret variables are empty and service connections are unavailable

Symptom: In builds of PRs submitted by external contributors (GitHub fork or Azure Repos fork),$(SONAR_TOKEN) is empty, and deployment/scan steps fail.

Root cause: This is an intentional security default: code in a fork is untrusted; if secrets were given to it, anyone could submit code that echo $SECRET | curl steals secrets. The “Make secrets available to builds of forks” setting in pipeline triggers is off by default; for GitHub you can also require a team member's comment before building (“Require a team member's comment before building a pull request”).

Diagnostic commands
# Edit pipeline → ⋯ → Triggers → Pull request validation → fork-related options
echo "Build.Reason=$(Build.Reason) System.PullRequest.IsFork=$(System.PullRequest.IsFork)"
Fix
  • Do not enable “Make secrets available to builds of forks”; add a condition to steps that need secrets condition: ne(variables['System.PullRequest.IsFork'], 'True'), so they run on main after merging.
  • Fork builds should run only on Microsoft-hosted agents; do not let them land on self-hosted agents inside the corporate network.
Prevention and best practices
  • Split CI for public collaborative repos into a “secret-free validation pipeline” and a “protected release pipeline”.

See Lesson 6, Module 3: Pipeline security.

#44 Secret variable is empty when read in a script ($DB_PASSWORD is an empty string, while $(DB_PASSWORD) has a value)

Symptom: A secret is set in the variable group DB_PASSWORD, and in the script echo ${#DB_PASSWORD} outputs 0; a regular variable DB_USER can be read as an environment variable.

Root cause: Regular variables are automatically mapped to environment variables (name uppercased, dots turned into underscores),secret variables are not, so they must be explicitly mapped in the step's env: env block; log *** masking only applies to exact matching values, so encoded or split secrets may leak. Also, variable groups linked from Key Vault are only fetched when the job starts; secrets whose names contain - must also be explicitly mapped to environment variables.

Diagnostic commands
variables:
- group: myapp-prod-secrets
steps:
- bash: |
    echo "user=$DB_USER len(pass_env)=${#DB_PASSWORD}"
  displayName: before-map
- bash: |
    echo "len(pass_env)=${#DB_PASSWORD}"
  env:
    DB_PASSWORD: $(DB_PASSWORD)      # explicitly map the secret
  displayName: after-map
user=appuser len(pass_env)=0
len(pass_env)=24
Fix
  • Use env: only in the steps that need it to map secrets; task inputs can directly use $(DB_PASSWORD).
  • Do not use set -x,printenv etc. to print the environment; when setting an output variable that is a secret, add issecret=true.
Prevention and best practices
  • Minimize secret exposure: map only to one step; prefer WIF / managed identity to eliminate secrets altogether.

See Lesson 6, Module 4,Lesson 2, Module 5.

#45 Push to Azure Repos blocked by GitHub Advanced Security push protection (use skip-secret-scanning:true for false positives)

Symptom:git push The remote rejects the push, saying a secret was detected (e.g., a storage account key or PAT) and listing the file and commit (follow the actual output for exact wording). (For GH013 push protection on GitHub, see Git course #4.)

Root cause: The repository has Secret Protection push protection from GitHub Advanced Security for Azure DevOps (GHAzDO) enabled, and the server scans new commits before accepting a push. Under current pricing, GHAzDO is split into Secret Protection (US$19 per active committer per month) and Code Security (US$30 per active committer per month), which can be enabled separately; “active committers” are committers who appeared in pushes in the past 90 days (some older docs still list a bundled price of US$49; follow the pricing page).

Diagnostic commands
git log --oneline origin/main..HEAD          # find the commits containing the secret
git show <commit> | grep -nE "AccountKey=|AZDO|-----BEGIN" | head
Fix
  • Real secret: rotate/revoke it at the source immediately (a blocked push does not mean it has not leaked elsewhere), remove it from unpushed commits with an interactive rebase, then push.
  • False positive (test fixtures, etc.): add skip-secret-scanning:true to the commit message, then push, and record the reason in the GHAzDO alert.
Prevention and best practices
  • Local pre-commit secret scanning plus server-side push protection as two layers; include bypasses in audit reviews.

See Lesson 6, Module 5: GitHub Advanced Security for Azure DevOps.

#46 No Classic editor under “New pipeline” / cannot create classic release pipelines (organization disables classic pipelines by default)

Symptom: The team follows an older doc to “create a release pipeline using the classic editor”, but there is no entry point in the UI; REST creation is also rejected; existing classic pipelines can still be edited and run.

Root cause: Organization/project settings → Pipelines → Settings has two switches: Disable creation of classic build pipelines and Disable creation of classic release pipelines. When both are on, classic build/release pipelines, task groups and deployment groups cannot be created via the UI or REST. The Microsoft Learn pipeline security docs state that since Sprint 226,new organizations disable by default the creation of classic pipelines

Diagnostic commands
# Web: Organization settings → Pipelines → Settings → General (requires PCA)
az pipelines release definition list --query "length(@)" -o tsv     # number of existing classic release pipelines
Fix
  • For new requirements, use YAML multi-stage pipelines + Environments (approvals/checks); do not re-enable classic creation just for “convenience”.
  • To migrate existing classic releases, follow the mapping in Lesson 5, Module 6 (stage → stage, approval → Environment check, task group → template).
Prevention and best practices
  • YAML in the repo is protected by branch policies and reviews, so it is better than classic pipelines in both security and auditability.

See Lesson 5, Module 6: Migrating classic releases to YAML.

#47 No Auditing in organization settings / cannot find audit records from 6 months ago / audit stream automatically disabled

Symptom: The security team needs to investigate permission changes from six months ago, but the audit page only goes back 90 days; or there is no Auditing at all in organization settings; or audit data in Splunk/Sentinel has stopped flowing.

Root cause: (1) Auditing is off by default, and must be enabled by the organization owner / PCA in Policies; (2) only organizations connected to Microsoft Entra ID can use auditing; (3) audit event retention is 90 days and cannot be configured; longer retention requires streaming to Splunk, Azure Monitor Logs (table AzureDevOpsAuditing, which can feed Microsoft Sentinel), or Azure Event Grid; (4) a stream that hits failures may be disabled, and after re-enabling it backfills at most the past 7 days of events; at most 2 streams per target type.

Diagnostic commands
# Web: Organization settings → Auditing → Streams (check status and failure reasons)
# Verify in Log Analytics that data keeps arriving (KQL)
# AzureDevOpsAuditing | summarize count() by bin(TimeGenerated, 1d) | order by TimeGenerated desc
Fix
  • Enable auditing and configure streaming right away; fix the stream target (for Splunk HEC, do not tick indexer acknowledgment; for Event Grid, use the Event Grid Schema), then re-enable.
  • For outages longer than 7 days: backfill by exporting CSV/JSON from the audit page (still subject to the 90-day limit).
Prevention and best practices
  • Set an alert in your SIEM for “stream interrupted for more than 1 hour”; adjust the Log Analytics retention period to meet compliance requirements (default 30 days).

See Lesson 6, Module 7: Audit logs, compliance and streaming.

#48 Bought 1 Microsoft-hosted parallel job, but still only one job runs at a time

Symptom: Finance approved buying 1 hosted parallel job; the team expected “2 in parallel”, but jobs still queue.

Root cause: Official docs: when you buy the first Microsoft-hosted parallel job from the free tier, the organization's parallel count is still 1, and this purchase only removes the free tier's time limit (1 hour/job, 1,800 minutes/month); to run 2 jobs at once you need to buy 2. After purchase, it may take up to about 30 minutes to take effect; new organizations are capped at 25 Microsoft-hosted parallel jobs (you can contact support to raise it). Parallel jobs are shared across all projects in the organization and cannot be assigned to specific projects or pools. Runs waiting for approval do not consume a parallel job.

Diagnostic commands
# Web: Organization settings → Pipelines → Parallel jobs (Microsoft-hosted: Paid parallel jobs = 1 → Total = 1)
# Pools → Analytics → Pool consumption report: does the queue curve hit the parallel limit?
Fix
  • Buy based on need (e.g., buy 3 if you need 3 in parallel); evaluate whether self-hosted / Managed DevOps Pools would be cheaper.
Prevention and best practices
  • Rule of thumb: about 1 parallel job per 4–5 users; adjust monthly using the consumption report.

See Lesson 7, Module 5: Parallel jobs and cost optimization.

#49 Monthly bill higher than expected: Basic user count, duplicate licenses and GHAzDO active committers

Symptom: On the Azure bill, the User Plan or Advanced Security charges for Azure DevOps keep rising, even though “not many people are actually using it”.

Root cause: (1) The first 5 Basic users are free, then US$6 per user per month (see the pricing page); users who left or changed roles have not been cleaned up; (2) Visual Studio subscribers already include the relevant entitlement, yet are also assigned paid Basic; (3) group rules grant Basic to an entire large group; (4) GHAzDO is billed by active committers in the past 90 days; when enabled across many repos, people who commit only occasionally are also counted; (5) Artifacts are billed on usage beyond 2 GiB (#39).

Diagnostic commands
az devops user list --top 1000 --query "items[].{user:user.principalName,license:accessLevel.accountLicenseType,source:accessLevel.licensingSource,last:lastAccessedDate}" -o table \
  | sort -k4 | head -30
# Web: Organization settings → Billing; sort the Users page by Last access
Fix
  • Remove users who have not accessed in a long time or downgrade them to Stakeholder; Visual Studio subscribers should use their subscription entitlements.
  • Split group rules by role; enable GHAzDO only on the projects/repos that need it, and evaluate each product (Secret Protection / Code Security) separately.
Prevention and best practices
  • Review licenses monthly; set budget alerts for the Azure DevOps billing subscription in Azure Cost Management.

See Lesson 1, Module 3,Lesson 7, Module 5.

#50 Public projects retired: new public projects can no longer be created, and existing public projects will become private in 2027 (anonymous access and the free tier change accordingly)

Symptom: Open-source maintainers find they cannot create public projects; the team relied on the old arrangement of “public projects browsable anonymously + more hosted minutes for public projects”.

Root cause: Current Microsoft Learn docs: Azure DevOps public projects are retired and can no longer be created; existing public projects keep their current free parallel quota until they become private in 2027; after conversion, the private-project free tier applies (1 hosted job, 1 hour/job, 1,800 minutes/month). After conversion, anonymous links to wikis, badges and build logs will stop working.

Diagnostic commands
az devops project list --query "value[?visibility=='public'].name" -o tsv
Fix
  • Follow the official guide to migrate projects that need public collaboration to GitHub (code and PRs can be migrated with GitHub Enterprise Importer; pipelines and LFS objects are not migrated and must be handled separately).
  • For projects staying in Azure DevOps: assess parallel job and access needs after they go private, in advance.
Prevention and best practices
  • Put platform retirement items (public projects, global PATs, hosted images, legacy CDN domains, classic pipelines) into one “platform change calendar” and review it quarterly (see #8, #19, #20, #46).

See Lesson 7, Module 7: Migration: Azure DevOps to GitHub.

Figure 4-1 · Path of a secret from storage to process (and where it can get “lost”)

Key Vault / variable group#36 permissions · network Resource authorization + checks#26 #27 Fork check#43 not given by default Job variablesenv: explicit mapping #44 ProcessLog masking *** Better practice: use workload identity federation / managed identity to exchange for short-lived tokens directly, so most “secrets” do not exist at all(service connection WIF · Key Vault stores only third-party API keys)
Every arrow is a checkpoint that can “empty” a secret; these empty values are usually deliberate security design, not defects.

Table 4-2 · Metering and quota facts (2026-11-15, Microsoft Learn)

ItemFreeBeyond free tier
Basic usersFirst 5 usersBilled per user per month (pricing page: US$6)
Microsoft-hosted parallel jobs1 for private projects, 1 hour/job, 1,800 minutes/month (must be enabled/requested)Purchased per job, 31 hours/job, unlimited monthly minutes; the first purchase only removes the time limit
Self-hosted parallel jobs1 (+ 1 per Visual Studio Enterprise subscriber), no time limitPurchased per job
Azure Artifacts2 GiB / organizationPay-as-you-go after billing is set up
AuditingRetained 90 days (Entra organizations)Stream to SIEM
GHAzDO—Secret Protection US$19, Code Security US$30 / active committer / month

End-to-end failure simulator for one run

Select a scenario and run it: the simulator advances in real order Trigger → Compile → Resource authorization → Queue → Agent pickup → Checkout → Restore/Build → Approvals and checks → Deploy (token exchange) → Publish artifacts, stops at the failing stage, and shows the original error text and the related question.

$ Waiting to run…
Lab 1: Feed permissions and authentication task (#41)
az artifacts feed create --name lab8feed --project myapp-lab 2>/dev/null || echo "Create project-scoped feed lab8feed in the web UI"
# Reproduce: in the pipeline, npm ci (.npmrc points to lab8feed) without npmAuthenticate → E401
# Fix: add npmAuthenticate@0; in the feed's Permissions, confirm the myapp-lab Build Service is Feed Reader or higher
# Cleanup: delete lab8feed (feed settings → Delete feed, and empty the recycle bin)
Lab 2: Immutable versions (#40)
# Publish universal package 1.0.0 → delete → publish 1.0.0 again → conflict
az artifacts universal publish --feed lab8feed --name lab8-pkg --version 1.0.0 --path ./dist --project myapp-lab --scope project
# Republishing the same version after deletion fails; switching to 1.0.1 succeeds
Lab 3: Secret mapping (#44)
az pipelines variable-group create --name lab8-secrets --variables placeholder=1 -o none
GID=$(az pipelines variable-group list --group-name lab8-secrets --query "[0].id" -o tsv)
az pipelines variable-group variable create --group-id $GID --name DB_PASSWORD --value FAKE-SECRET-123 --secret true
# Run the #44 YAML: before-map length 0, after-map length 15
az pipelines variable-group delete --id $GID --yes     # cleanup
Acceptance checklist

Tutorial videos (titles and channels verified via YouTube oEmbed)

▶
Azure Artifacts vs Build Artifacts vs Pipeline Artifacts: Difference EXPLAINED! [Azure DevOps] — CoderDave
English · Differences among the three kinds of “artifacts” (for #39–#42)
▶
How to create, host, and share packages with Azure Artifacts | Azure Tips and Tricks — Microsoft Azure
English · Basic feed and package operations
▶
Configure GitHub Advanced Security for Azure DevOps — Achraf Ben Alaya
English · Enabling and scanning with GHAzDO (for #45)
Scene 1 (0:00) The simulator runs the “feed 401” scenario, stops at the “Restore/Build” stage, and shows the original E401 error.
Scene 2 (0:50) Delete package 1.0.0 and republish → 409; narration: “a version number is a permanent commitment”.
Scene 3 (1:40) Parallel jobs page: Paid = 1, Total = 1; explain “the first purchase only removes the time limit”.

Official docs:Artifacts limits · Audit streaming · Parallel jobs

Scoring ≥ 70% on the quiz also marks it automatically.

Module 5 · Part B: Platform and Boards/Repos (interview questions 1–13)

30:00 – 37:00 · Service overview, organization structure, access levels, permission model, Entra, Boards processes, Repos policies, authentication methods, metrics
7 min13 questionsMainly beginner level
Learning objectives
  • Explain in one sentence the five Azure DevOps services and the difference between Services and Server, and be able to draw the organization → project → team hierarchy.
  • Explain the two-layer model of “access level + security group permissions”, Deny taking precedence, and the value of Entra group rules.
  • Can compare Azure Repos with GitHub and TFVC with Git, and state the boundaries of migration.
Q1. What services does Azure DevOps include? What is the difference between Azure DevOps Services and Azure DevOps Server?Beginner
30-second answer

Five services: Boards (work items and agile planning),Repos (Git/TFVC repositories),Pipelines (CI/CD),Test Plans (manual/exploratory testing),Artifacts (package feeds). Services is the Microsoft-hosted SaaS (dev.azure.com), with features updated roughly every three weeks; Server is the on-premises version, where you handle installation, upgrades and backups yourself, and cloud capabilities such as Microsoft-hosted agents are not available.

Detailed answer

The five services can be turned on or off individually per project, and can be mixed with GitHub (e.g., GitHub code + Azure Boards, or GitHub code + Azure Pipelines). A Services organization chooses its region at creation (data residency) and can connect to Microsoft Entra ID; features such as auditing, GHAzDO and Managed DevOps Pools are available only in Services. Server suits scenarios with strict intranet/offline requirements, but self-hosted agents are essential.

Common follow-up questions
  • Why do new projects often use “GitHub + Azure Boards/Pipelines”? — GitHub's developer ecosystem + Azure DevOps planning and release governance.
  • Where is Services data stored? — In the organization's region; the organization's region can be migrated (see the docs).
Bonus points

Mention that Microsoft-hosted agents are available only in Services, and Services' free tier (5 Basic users, hosted parallel jobs must be requested, Artifacts 2 GiB).

Common wrong answers

“Azure DevOps is just CI/CD on Azure” — this ignores Boards/Repos/Test Plans/Artifacts, and also ignores that it can deploy to any cloud.

Q2. How do organizations, projects and teams relate? Would you use one project or multiple projects?Beginner
30-second answer

The organization is the boundary for billing, policies, users and the Entra connection; a project is the container for repos, pipelines, work items and permissions; a team is a view within a project (its own backlog, sprints and area paths). I prefer fewer, larger projects: keep one product line in one project, and split by teams and area paths, which makes cross-team visibility and sharing easier; split into separate projects only when permissions, compliance or process templates must be isolated.

Detailed answer

The costs of multiple projects: cross-project queries and boards are harder, build service identities are isolated per project by default (cross-project checkout requires authorization, see question #12), and shared templates and service connections must be shared explicitly. Multiple organizations cost more: users, billing, policies and auditing are all fragmented. A common pattern: one organization + one project per business domain + a platform project holding shared templates.

Common follow-up questions
  • When must you split organizations? — Different Entra tenants, different data residency regions, legal entity isolation.
Bonus points

Mention that “restricting user visibility to specific projects” (Project-Scoped Users) can isolate external partners within a single organization.

Common wrong answers

“One project per microservice” — leads to dozens of projects and an explosion in governance cost.

Q3. What is the difference between the Stakeholder, Basic and Basic + Test Plans access levels? How do you control cost?Beginner
30-second answer

Access levels determine “which features you can use”: Stakeholder is free, and can use the main Boards features and view pipelines, but cannot access code in private projects; Basic includes Repos, full Boards, Pipelines, etc., with the first 5 users free and per-user billing after that; Basic + Test Plans adds the full test plan features. Visual Studio subscribers automatically get the corresponding entitlements.

Detailed answer

Cost control: use Entra group rules Assign access levels automatically by role; clean up regularly by Last access; do not assign Basic again to VS subscribers; use Stakeholder for business users. Note that access level and permissions are two separate layers: a Basic user denied on a repo still cannot push.

Common follow-up questions
  • Are Pipelines billed per user? — No, they are billed per parallel job; Stakeholders can also create/run pipelines (see the docs).
Bonus points

Be able to cite the #2 failure: “cannot see Repos” is usually a Stakeholder.

Common wrong answers

Confusing the Contributors group with the Basic access level.

Q4. Explain the Azure DevOps permission model: how are inheritance and Allow/Deny/Not set evaluated?Intermediate
30-second answer

Permissions are granted to security groups (or users), with states Allow, Deny, and Not set (plus their “inherited” forms). A user's effective permissions = the merge of the permissions of all groups they belong to,where a Deny in any group takes precedence over Allow; at the object level, Not set inherits from the parent object, and an explicit setting on a child object overrides inheritance; Project Collection Administrators have full organization-level permissions.

Detailed answer

Permissions are organized by security namespaces for each area (Git Repositories, Build, Project, etc.); each object is located by a “token”, for example a Git repo is repoV2/<project ID>/<repo ID>, with branches underneath it. Troubleshooting tools: the “Why?” trace on the permissions page,az devops security permission show. Design principle: express roles with groups, use Allow mostly, and use Deny only for guardrail groups.

az devops security permission namespace list --query "[?name=='Git Repositories'].namespaceId" -o tsv
az devops security permission show --id <namespaceId> --subject <descriptor> --token "repoV2/<proj>/<repo>"
Common follow-up questions
  • Under whose identity do pipelines run? — The build service identity; see Q31 and question #4.
Bonus points

Point out a common reason admins “cannot reproduce” a user's problem: admins belong to PCA, which is not affected by Deny.

Common wrong answers

“The last setting wins” or “Allow overrides Deny”.

Q5. Why connect the organization to Microsoft Entra ID? What capabilities and risks does it bring?Intermediate
30-second answer

After connecting Entra, identities are managed centrally by the corporate directory: single sign-on, MFA and conditional access, access is revoked when someone leaves, and permissions and access levels are granted through Entra groups (group rules). Features such as auditing and Managed DevOps Pools also require the organization to be connected to Entra.

Detailed answer

Risks and caveats: switching tenants affects existing user mappings (plan user mapping in advance); conditional access policies apply to Git/CLI (may break PATs/tools, see #8); external partners need to become guests (#10). Tenant-level PAT policies (restricting global PATs, full-scope PATs, maximum lifetime, automatic revocation on leak) are also configured in organization settings after the Entra connection.

Common follow-up questions
  • What if group rules conflict with direct assignments? — Group rules override individual settings (see the docs); manage everything through groups.
Bonus points

Mention that in Entra-backed organizations, a new PAT that is unused for 90 days becomes inactive.

Common wrong answers

Only saying “for SSO”, without mentioning lifecycle management and auditing.

Q6. What are the differences between the Azure Boards processes (Basic / Agile / Scrum / CMMI)? How do you customize them?Beginner
30-second answer

The four system processes define work item types and states: Basic (Epic/Issue/Task, the simplest), Agile (User Story, Bug, Task), Scrum (Product Backlog Item, Impediment, states close to Scrum), and CMMI (Requirement, Change Request, suited to formal processes). System processes cannot be edited directly; to customize, first create an inherited process, then add fields, states, rules and work item types.

Detailed answer

Changes to an inherited process take effect immediately for all projects using it, which suits unified governance; switching a project's process (e.g., from Agile to Scrum) has a mapping cost. Key design point: map states to the “Proposed / In Progress / Resolved / Completed” categories, and align board columns with these categories so Analytics can calculate cycle time correctly.

Common follow-up questions
  • How do you make Bugs show up in the backlog? — In team settings, select Bug as a requirement or task category.
Bonus points

Mention using rules to make fields required, which is more reliable than relying on manual conventions.

Common wrong answers

“Edit the Agile template directly” — system processes are read-only.

Q7. What problems do Area Paths and Iteration Paths each solve?Beginner
30-second answer

Area Path answers “which product/component/team does this work belong to” (the organizational dimension), and Iteration Path answers “in which sprint/time period is it done” (the time dimension). Teams use their chosen areas and iterations to define their backlog and sprint views; Area Paths are also the attachment point for work item permissions.

Detailed answer

Area paths are organized by product and component, and teams subscribe to some of those nodes. Iteration paths are organized by release or sprint and can give different teams different cadences. Permissions: “Edit work items in this node” on an area node. Tightening permissions on child nodes causes TF237111 (issue #11).

Common follow-ups
  • What if multiple teams share one area? — Work items show up in several teams’ backlogs, so watch capacity planning.
Bonus points

Area paths can be used with Analytics to measure defect density by component.

Common wrong answers

Using tags instead of area paths to split teams — they cannot be used for permissions or team views.

Q8. How do you link work items to code, PRs, and builds? What is the value of this traceability?Junior
30-second answer

In the commit message or the PR title/description, write AB#123 (GitHub integration) or link the work item in a PR in Azure Repos. The branch policy “Check for linked work items” can enforce linking, and the work item state can move automatically when a PR completes. Pipeline runs deployed to an Environment show the work items and commits they contain.

Deeper answer

Value: audit (every line of production code traces back to a requirement or defect), automatic release notes, lead time for changes in DORA metrics, and quickly locating changes during incident reviews. In Azure Repos you can use Fixes #123 keywords like these to change state when completing a PR (follow the syntax the current docs support).

Common follow-ups
  • Can a GitHub repo be linked to Azure Boards? — Install the Azure Boards app and use AB# syntax.
Bonus points

Mentioning the Environment deployment history can directly answer “Has this requirement been deployed to production?”

Common wrong answers

Only maintaining the release list manually in Excel.

Q9. What branch policies does Azure Repos have? Which would you configure on main?Intermediate
30-second answer

Minimum reviewers (including “can the author approve” and “reset votes on push”), check linked work items, check that comments are resolved, restrict merge types (merge/squash/rebase/semi-linear), build validation, status checks (external services), and automatically included reviewers (by path). On main I would configure: at least 1–2 reviewers with votes reset on push; build validation with a reasonable expiration policy; comments must be resolved; restrict to squash or semi-linear; and required reviewer groups for critical directories.

Deeper answer

Once any policy is enabled, the branch can only be updated through a PR (TF402455, issue #5). Bypassing requires the dedicated “Bypass policies…” permission. Policies can be configured at the repo level or across repos by branch name pattern, which helps at scale (Lesson 6). Note that Azure Repos has no built-in policy to “require signed commits”.

Common follow-ups
  • Which commit does build validation run on? — The merge result of the source and target branches.
Bonus points

Being able to explain the pitfalls of stale builds (#6) and path-filtered required reviewers (#7).

Common wrong answers

“Give everyone the Bypass permission so urgent fixes are easy” — use an emergency process instead of a standing back door.

Q10. How do you choose between Azure Repos and GitHub? What is lost when migrating to GitHub?Intermediate
30-second answer

Enterprises that already use Boards, Pipelines, and Artifacts deeply and need unified governance get the smoothest integration with Azure Repos. Choose GitHub when you need open-source collaboration, the developer ecosystem, and the Copilot and Actions ecosystem. For migration you can use GitHub Enterprise Importer to move code, PRs, and branch policies to GitHub Enterprise Cloud, but pipelines and LFS objects are not migrated.

Deeper answer

Hybrid setups are common: GitHub for code, Azure Boards for planning, and Azure Pipelines for deployment (which supports GitHub repos). Key differences: Azure Repos repos are limited to 250 GB, with a 5 GB limit per push; SSH only supports RSA and does not support LFS. GitHub has rulesets and push protection (GHAS). On the Azure Repos side you can also use GHAzDO for secret scanning, dependency scanning, and CodeQL.

Common follow-ups
  • How do pipelines migrate? — Azure Pipelines can point directly at GitHub repos, or you can convert them with GitHub Actions Importer (check the tool’s supported scope).
Bonus points

Point out that public projects have been retired, and that moving open-source projects to GitHub is the official recommended path.

Common wrong answers

“After migrating, Pipelines history and Boards carry over” — they do not.

Q11. What is the difference between TFVC and Git? Should you still use TFVC today?Junior
30-second answer

TFVC is centralized version control (server or local workspaces, check-out/check-in, path-level permissions). Git is distributed (full local history, lightweight branches, PR workflow). New projects should use Git. TFVC is still supported, but Azure DevOps Server has added a setting to “disable creating TFVC repositories” and says TFVC will gradually be phased out for new projects.

Deeper answer

TFVC’s strengths are very large binary assets and fine-grained path permissions. When migrating to Git, a common strategy is to “migrate only recent history and archive the old repo”, use LFS for large files, and split monoliths by directory. For the migration design question, see Git course Q48.

Common follow-ups
  • Can TFVC and Git coexist in the same project? — Yes (a project has at most one TFVC repo; follow the docs).
Bonus points

Being able to give a branch mapping and a freeze-window plan for the migration.

Common wrong answers

“TFVC has been removed” — inaccurate, it is still supported.

Q12. What authentication methods are available for Azure DevOps? Why does Microsoft recommend using fewer PATs?Intermediate
30-second answer

Interactive users: Entra/MSA sign-in. Git: Git Credential Manager (OAuth tokens). Automation: Microsoft Entra tokens (service principals, managed identities,az account get-access-token) are preferred. PATs are only for tools that do not support Entra, and then only with organization-level scope, minimum scope, and a short lifetime. Global PATs are being retired (the official dates are inconsistent: 2026-12-01 and 2027-01-27; follow the release notes).

Deeper answer

A PAT is a long-lived “password substitute” tied to one person, and it is easy to leak (it gets scanned and automatically revoked). It also affects automation after that person leaves. Service principals and managed identities can be added to the organization and granted an access level, and their tokens are short-lived. The resource ID for Entra tokens is the fixed application ID of Azure DevOps (follow the docs).

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/contoso/_apis/projects?api-version=7.1" | jq '.count'
Common follow-ups
  • Can a PAT be used as a NuGet API key? — No. Use NuGetAuthenticate or a credential provider.
Bonus points

Mention that the PAT lifecycle API requires an Entra user delegated token, and service principals cannot create PATs.

Common wrong answers

“Create a never-expiring, full-scope PAT for CI.”

Q13. How do you measure engineering effectiveness (for example, DORA metrics) in Azure DevOps?Advanced
30-second answer

Data sources: Pipelines run and Environment deployment records (deployment frequency, change failure rate, time to restore), and Repos/Boards commit, PR, and work item timestamps (lead time for changes). Aggregate through Analytics (OData endpoint, Power BI) or the REST API, and have dashboards show trends rather than rate individuals.

Deeper answer

Define terms clearly: “deployment” = a successful run that reaches a production Environment; “failure” = a deployment that triggers a rollback or hotfix (can be linked via a work item tag or an incident system); lead time = from first commit to production deployment. Analytics provides entities such as PipelineRuns and WorkItems. Audit data can be streamed to Log Analytics for supplementary analysis.

Common follow-ups
  • How do you keep the metrics from being gamed? — Metrics serve team improvement. Use them together (fast and stable), and do not look at deployment count alone.
Bonus points

Mention using an Environment rather than an arbitrary job as the basis for counting “deployments”.

Common wrong answers

Measuring efficiency by “number of builds” or “lines of code committed”.

Figure 5-1 · Organization structure and identity layers

Organization: billing · policies · users and access levels · Entra connection · parallel jobs · audit Project myapp-lab Repos · Pipelines · service connections · Environments · Sources Security groups: Readers / Contributors / Project Administrators Team A / Team B (area + iteration + board) Build service: myapp-lab Build Service Project platform Shared template repo · shared agent pool (organization level) Cross-project access requires authorization (#12) Project Collection Build Service (organization-level identity)
When you draw this diagram in an interview and then explain “access levels govern features, permissions govern objects”, you have covered Q2–Q5.
Scenario 1: A 300-person company has 4 product lines, 20 contractors, and 2 subsidiaries (with different Entra tenants). Design the organization, project, and team structure and the identity plan.
Reference approach
  • Two tenants → first evaluate whether identity can be unified (cross-tenant guests). If not, use two organizations, each connected to its own tenant.
  • One organization per product line (4 projects), plus 1 platform project holding shared templates and the agent pool.
  • Contractors: guests + a dedicated group + Project-Scoped Users, access level Basic, granted only the projects they need.
  • Group rules: developer group → Basic; product/business → Stakeholder; VS subscribers use their entitlements.
  • Enable auditing and stream it to Sentinel. Use a PAT policy to limit full-scope tokens and lifetimes.
Scenario 2: An audit finds that main was pushed to directly 3 times in the past month. How do you investigate, and how do you prevent it from happening again?
Reference approach
  • Filter audit logs for Git push and policy bypass events to identify the identity (person or build service).
  • Check who holds the Bypass policies when pushing and Force push permissions. Move them to an “emergency group” and enable audit alerts.
  • Configure at least one policy on main (reviewers + build validation) so that updates can only happen through PRs.
  • Change pipeline write-backs to create a PR with auto-complete (issue #5).

Teaching videos (titles and channels verified via YouTube oEmbed)

▶
Azure DevOps Tutorial for Beginners | CI/CD with Azure Pipelines — TechWorld with Nana
English · Platform overview and core concepts (Q1–Q3)
▶
Complete Azure DevOps Boards Training for Beginners — Dani Kahil
English · Boards workflow, areas and iterations (Q6–Q8)
▶
Azure DevOps: Zero to Hero Tutorial — DevOps on Azure
English · Service demos
Shot 1 (0:00) Draw Figure 5-1 on the whiteboard and explain organization/project/team in 30 seconds.
Shot 2 (0:40) Demonstrate the interface differences between Stakeholder and Basic, then demonstrate that Deny takes precedence.

Official docs:Azure DevOps services · Access levels

A quiz score of ≥ 70% also marks it complete automatically.

Module 6 · Part B: Pipelines and CI/CD (interview questions 14–25)

37:00 – 44:00 · classic vs YAML, structure, triggers, variables, templates, agents, parallelism, artifacts, caching, deployment strategies, quality gates, troubleshooting
7 min12 questionsMainly intermediate
Learning objectives
  • Be able to write, on the spot, a YAML skeleton with stage/job/deployment, templates, variables, and conditions.
  • Explain compile time vs. runtime, includes vs. extends, the four agent hosting options, and parallel job billing.
  • Answer troubleshooting questions with the structure “symptom → stage → evidence → fix”.
Q14. What is the difference between Classic pipelines and YAML pipelines? Why are classic pipelines disabled by default for new organizations?Junior
30-second answer

Classic pipelines are configured in the web designer and their definition lives on the server. YAML is defined in the repo and is reviewed, branched, and rolled back with the code. Since Sprint 226, creating classic build/release pipelines is disabled by default for new organizations, because YAML can be protected by branch policies, can use extends templates to enforce security standards, and classic changes are not subject to code review.

Deeper answer

Classic release concepts all have YAML equivalents: stages → stage, approvals/gates → Environment “Approvals and checks”, task groups → templates, deployment groups → Environment VM resources. Existing classic pipelines can still run and be edited. Migrate in order of value (move production-critical paths first).

Common follow-ups
  • Does classic have anything YAML cannot do? — Some UI conveniences (such as visually editing release variable scope), but variable groups + templates can replace them.
Bonus points

Mention that checks are defined on the resource rather than in the YAML, so YAML authors cannot bypass them. This is a security advantage.

Common wrong answers

“YAML is just a different syntax.”

Q15. Describe the structure of a YAML pipeline: the relationships among stage, job, step, task, and deployment job.Junior
30-second answer

Pipeline → one or more stages (logical boundaries, and where approvals and checks apply) → each stage has multiple jobs (scheduling units; a job runs on one agent and occupies one parallel job) → jobs consist of steps (script/bash/pwsh or task). A deployment job is a special job that is bound to an Environment, records deployment history, and supports deployment strategies.

stages:
- stage: Build
  jobs:
  - job: build
    pool: { vmImage: ubuntu-latest }
    steps:
    - script: docker build -t myapp:$(Build.BuildId) .
- stage: Prod
  dependsOn: Build
  jobs:
  - deployment: deploy
    environment: myapp-prod        # approvals and checks attach here
    strategy:
      runOnce:
        deploy:
          steps:
          - script: echo deploy
Deeper answer

Jobs in the same stage run in parallel by default (subject to the parallel job limit). Use dependsOn to form a DAG. Server jobs (pool: server) do not occupy an agent or a parallel job. Deployment jobs do not check out code by default (explicitly checkout: self).

Common follow-ups
  • How do job-to-job files get passed? — Use pipeline artifacts. To pass values, use output variables (#24).
Bonus points

Explain that approvals and checks run before the stage starts, evaluating all resources used by that stage.

Common wrong answers

“Jobs in the same stage share a working directory” — each job may run on a different agent.

Q16. What triggers does Azure Pipelines have? Why does PR triggering for Azure Repos differ from GitHub?Intermediate
30-second answer

CI triggers (trigger:, filtered by branch, path, or tag; batching is possible), PR triggers, scheduled triggers (schedules: cron, which can be set to always), pipeline resource triggers (fire when an upstream pipeline completes), and repository, container, and package resource triggers. For Azure Repos Git, the YAML pr: does not take effect. PR validation runs through the target branch’s build validation policy configuration. For GitHub repos, use the YAML pr:.

Deeper answer

Common pitfall: triggers set in the UI override YAML (#23); [skip ci]; scheduled triggers only run when there are changes by default; pipeline resource triggers require upstream and downstream pipelines to be in the same organization (follow the docs). PR builds run on the merge commit, and branch policies can also configure build expiration.

trigger:
  batch: true
  branches: { include: [ main ] }
  paths: { exclude: [ docs/* ] }
schedules:
- cron: "0 3 * * 1-5"
  displayName: nightly
  branches: { include: [ main ] }
resources:
  pipelines:
  - pipeline: build
    source: myapp-ci
    trigger: { branches: { include: [ main ] } }
Common follow-ups
  • What time zone do scheduled triggers use? — cron uses UTC.
Bonus points

Mention batch: true ; it reduces parallel job usage during frequent pushes.

Common wrong answers

“Writing pr: main in YAML makes it work for Azure Repos.”

Q17. Explain the difference between $(var), ${{ variables.var }}, and $[ variables.var ], and the scope and precedence of variables.Intermediate
30-second answer

${{ }} Evaluated at compile time (during template expansion) and used to decide structure; $[ ] evaluated at runtime, before a job or stage starts, and commonly used to read upstream output variables; $( ) macro substitution right before each task runs. Scope from broadest to narrowest: root (pipeline) → stage → job, with inner scopes overriding outer ones. Variables that can be overridden at queue time override the values in YAML (queue-time override must be allowed).

Deeper answer

Secret variables are not automatically mapped to environment variables (#44). Variable groups and Key Vault variables are only available at runtime and not visible at compile time (#22). Runtime parameters (parameters) are available at compile time and are typed, which makes them suitable for expressing “structural options”. Template parameters without a declared type are treated as strings, which 'false' are truthy in a boolean context.

Common follow-ups
  • How do you pass values across stages? — Use output variables with stageDependencies.Stage.Job.outputs['step.var'].
Bonus points

Can cite the official known issue where set -x causes an extra trailing single quote in variable values.

Common wrong answers

“The three syntaxes are equivalent, just written differently.”

Q18. What is the difference between includes templates and extends templates? What are the limits on templates?Intermediate
30-second answer

Includes templates work like an include directive, inserting steps, jobs, stages, or variables into the caller for reuse. Extends templates define the overall structure, and the caller can only supply content through parameters. This is used to enforce standards (for example, a scan must run first, or certain tasks are prohibited). Combined with Required template checks on the service connection, you can ensure production deployments must extend the specified template. Limits: up to 100 YAML files, 100 levels of nesting, and 20 MB of parse memory.

Deeper answer

Template repositories are referenced through resources.repositories with a ref that should be pinned to a ref (a tag or 40-character commit SHA), otherwise it defaults to refs/heads/main. In extends templates you can use ${{ each }} to iterate over stepList parameters, checking and rejecting disallowed tasks (the official example rejects CmdLine@2). Template files must exist when the run starts and cannot come from an artifact.

Common follow-ups
  • Can scripts in the template repo be used directly? — No. After template expansion only YAML is used. To use scripts, check out the template repo.
Bonus points

Mention that the required template check is a “static check” that runs before approvals.

Common wrong answers

“extends means you can inherit from multiple templates.”

Q19. How do you choose among Microsoft-hosted agents, self-hosted agents, VMSS agents, and Managed DevOps Pools?Intermediate
30-second answer

Microsoft-hosted agents: zero maintenance and a fresh VM every time, but fixed specs (2 vCPU / 7 GB / about 10 GB of usable disk), and they cannot reach your corporate network (only over the public internet). Self-hosted: full control and can run on your internal network, but you must patch, isolate, and scale them yourself. VMSS agents: a scale set that Azure DevOps manages for scaling, with images you manage yourself. Managed DevOps Pools: Microsoft-managed agent pool service that lets you choose VM SKUs, use custom images, inject into a VNet, use stateful or stateless agents, and scale on demand. Requires registering Microsoft.DevOpsInfrastructure and Microsoft.DevCenter resource providers and a Dev Center project.

Deeper answer

Selection criteria: networking (whether private resources must be reached), specs (memory, disk, GPU), security (whether untrusted code runs; fork builds should use Microsoft-hosted agents), cost (parallel job fees plus VM fees), and operations capacity. Managed DevOps Pools quotas are calculated from the core count of the VM SKU family; the default SKU is Standard D2ads v5.

Common follow-ups
  • What are the risks of self-hosted agents reusing a working directory? — Cross-build contamination and leftover credentials. Using temporary (one-time) agents is safer.
Bonus points

Point out that Microsoft-hosted agents cannot connect to the corporate network through ExpressRoute or VPN, so accessing internal resources needs a different approach.

Common wrong answers

“Self-hosted agents are free” — they are still limited by parallel jobs (1 free), and they carry VM and operations costs.

Q20. How are Azure Pipelines parallel jobs billed and consumed?Intermediate
30-second answer

Billed by the number of jobs running at the same time, not by the number of users or pipelines. Private projects are free: 1 Microsoft-hosted job (1 hour per job, 1,800 minutes per month; must be enabled or requested) + 1 self-hosted job (no time limit, plus 1 more for each VS Enterprise subscriber). Paid Microsoft-hosted jobs can run up to 31 hours per job with no monthly minute limit. Parallel job allowances are shared across all projects in the organization.

Deeper answer

Consumption rules: a job uses a parallel slot only while it runs on an agent. Waiting for approval does not use one, and server jobs and deployment groups do not use one. The first purchase of a Microsoft-hosted job only removes the time limit; parallelism stays at 1 (#48). New organizations have a hosted job limit of 25. For capacity planning, use the Pool consumption report: if the queue curve stays at the ceiling for long periods, scale out or optimize (caching, splitting, batched triggers).

Common follow-ups
  • Can parallel jobs be assigned to a specific project? — No, they cannot be partitioned.
Bonus points

Rule of thumb: about 1 parallel job per 4–5 users.

Common wrong answers

“Registering 10 self-hosted agents gives you 10 parallel jobs” — you also need to buy the matching number of self-hosted parallel jobs.

Q21. What is the difference between pipeline artifacts, build artifacts, and Azure Artifacts feeds?Junior
30-second answer

A pipeline artifact (PublishPipelineArtifact/publish:) is output from a single run, used to pass data between jobs, stages, and pipelines, and it is cleaned up by the run retention policy. A build artifact is the older publishing method (for classic scenarios) and is not recommended for new work. An Azure Artifacts feed is a package repository (NuGet, npm, Maven, Python, Cargo, Universal) for consumers, with versions, upstreams, views, and permissions.

Deeper answer

Selection principle: if the output must be consumed as a dependency by other projects → artifact feed. If it is only deployment input → pipeline artifact. Artifact feed limits: 2 GiB free, versions cannot be reused (#40), up to 5000 versions per package, and up to 20 upstreams per package type. Views (@local/@prerelease/@release) are used for promotion.

- publish: $(Build.ArtifactStagingDirectory)/app
  artifact: app
- download: current
  artifact: app
Common follow-ups
  • Where do container images go? — A container registry (ACR/ECR), not an artifact feed.
Bonus points

Mention that upstream sources can cache public packages, so builds are not affected when a public source goes offline or packages are unpublished.

Common wrong answers

“Publish all build output to an Azure Artifacts feed” — this bloats storage and violates version immutability.

Q22. A CI run takes 35 minutes. How would you speed it up?Intermediate
30-second answer

Measure first (time per step, resource utilization), then prioritize by payoff: dependency caching (Cache@2, with keys that include a lock file hash), reducing checkout (shallow clone, filtering, sparse checkout), parallel splitting (matrix, test sharding), incremental builds and Docker layer caching, running only the affected parts (path filters), and switching to larger agents when needed (Managed DevOps Pools).

- task: Cache@2
  inputs:
    key: 'npm | "$(Agent.OS)" | package-lock.json'
    restoreKeys: |
      npm | "$(Agent.OS)"
    path: $(Pipeline.Workspace)/.npm
- script: npm ci --cache $(Pipeline.Workspace)/.npm
Deeper answer

Microsoft-hosted agents get a fresh VM every time, so downloading the cache has its own cost, and a large cache may not be worth it. Self-hosted or stateful pools can use a local cache. For test sharding, use strategy.parallel or a matrix, but this consumes more parallel jobs. Note that since 2022-09, the new pipelines of some organizations default to a depth-1 shallow clone, so tools that need full history must explicitly fetchDepth: 0.

Common follow-ups
  • How do you design cache keys? — Include the OS and a lock file hash, with restoreKeys as a fallback.
Bonus points

Back it up with data: show per-stage timings before and after optimization.

Common wrong answers

Just “buying more parallel jobs” without analyzing the bottleneck.

Q23. What deployment strategies does a deployment job support? How do you implement canary and rollback?Advanced
30-second answer

Three strategies: runOnce (one-time),rolling (rolling in batches on VM resources,maxParallel),canary (incrementally increments: [10, 20] gradually expanding. With Kubernetes, you can use the canary action of KubernetesManifest. Each strategy has lifecycle hooks: preDeploy, deploy, routeTraffic, postRouteTraffic, on: failure / success.

strategy:
  canary:
    increments: [ 10, 50 ]
    deploy:
      steps:
      - script: ./deploy.sh --weight $(Strategy.Increment)
    postRouteTraffic:
      steps:
      - script: ./smoke.sh
    on:
      failure:
        steps:
        - script: ./rollback.sh
Deeper answer

Rollback is essentially “redeploying the last known-good artifact”: artifacts are immutable and versions are traceable, and database changes must be backward compatible (expand-contract pattern). You can use Query Azure Monitor Alerts to check health automatically before promotion.

Common follow-ups
  • What is the relationship between canary on AKS and service meshes? — The KubernetesManifest canary is based on replica ratios; fine-grained traffic splitting requires a service mesh or gateway.
Bonus points

Explain that “rollback = replaying the old pipeline version” rather than applying a manual fix.

Common wrong answers

“Canary just means deploying to the test environment first.”

Q24. How do you implement testing and quality gates in a pipeline?Intermediate
30-second answer

PR stage: unit tests and coverage (PublishTestResults, PublishCodeCoverageResults), static analysis, and dependency scanning, set as required checks in the build validation policy. After merge: integration tests and artifact signing/scanning. Before deployment: Environment checks (approvals, business hours, Invoke REST API to query a quality platform, Azure Monitor alerts).

- script: dotnet test --logger trx --collect:"XPlat Code Coverage"
- task: PublishTestResults@2
  inputs: { testResultsFormat: VSTest, testResultsFiles: '**/*.trx' }
  condition: succeededOrFailed()
Deeper answer

Gates should be shifted left and kept fast. Flaky tests should be isolated and tracked (flaky detection in Tests analytics). Coverage thresholds are fairer when paired with incremental coverage. Deployment gates are placed on resources (Environments and service connections), so YAML authors cannot remove them.

Common follow-ups
  • Tests fail but you still want the report published? — Use condition: succeededOrFailed().
Bonus points

Mention that Test Plans is used for manual and exploratory testing, and its results are aggregated alongside automated results in one place.

Common wrong answers

Putting every check into one 90-minute PR build.

Q25. A pipeline failed. What are your troubleshooting steps?Intermediate
30-second answer

First locate the stage: no jobs → compilation or authorization; stuck in queue → parallelism or demands; fails midway → execution. Then check the evidence: raw task logs, the expanded YAML,system.debug logs, resource utilization, and the agent _diag; then compare with the most recent successful run (differences in code, template ref, image, or agent version); finally, reproduce with a minimal case.

Deeper answer

Concrete signals: TF/VS/AADSTS codes point directly to permission or authentication problems; We stopped hearing from agent check the resource. When the image version changes, check the runner-images announcements. When a template repo does not pin a ref, template updates can silently change behavior. After fixing, add prevention: pinned versions, diagnostic steps, and a runbook.

variables:
  system.debug: true     # turn on only when troubleshooting; logs may contain sensitive information
Common follow-ups
  • Can Azure Pipelines YAML be run locally? — There is no official local runner. Use scripted steps (scripts can run locally) to reduce platform dependency.
Bonus points

Mention that the Error analysis page and the Azure DevOps MCP Server can use AI to help analyze failed runs.

Common wrong answers

“Just rerun it and see” — rerunning without evidence hides intermittent problems.

Figure 6-1 · From YAML to run: compilation, authorization, scheduling

azure-pipelines.yml+ template repo @ref Compileparameters · ${{ }} · each/if Plan (stages DAG)Resource authorization Before each stageChecks: static → approvals → dynamic → lock Job schedulingParallel · agents
Order of the five check types (Microsoft Learn): static checks (branch control, Required template, Evaluate artifact) → pre-check approvals → dynamic checks (approvals, Azure Function, REST API, business hours, Azure Monitor) → post-check approvals → exclusive lock.
Scenario 1: A team has 12 repos, and each repo’s pipeline has 200 lines of YAML copied and pasted. The security team requires an image scan before every production deployment. How would you refactor this?
Reference approach
  • Create a platform/pipeline-templates repo that provides an extends template (build → scan → deploy), with the differing parts parameterized.
  • Each repo extends: template: …@templates,ref pinned to a tag, with versioned upgrades.
  • Configure the Required template check on the production service connection or Environment, so pipelines without extends cannot use production resources.
  • The template repo has its own CI: call the preview API on sample pipelines to validate.
Scenario 2: Every weekday at 9 a.m., many PRs trigger at once and queue for 40 minutes. The budget is limited. What do you do?
Reference approach
  • Use the Pool consumption report to confirm whether the bottleneck is parallel job capacity or the number of agents.
  • Enable batching in CI and path filters, and do not trigger on draft PRs. PR builds run only fast checks, and heavy tests move to after merge or to nightly runs.
  • Caching and splitting reduce per-job duration. Evaluate Managed DevOps Pools (on-demand scaling) against the cost of self-hosted parallel jobs.

Teaching videos (titles and channels verified via YouTube oEmbed)

▶
DevOps Master Class - Part 4 - CI/CD — John Savill's Technical Training
English · CI/CD concepts and Azure Pipelines (Q15–Q17)
▶
Azure Pipelines: Classic vs Yaml - Build and Release comparison — CoderDave
English · Q14
▶
Azure DevOps Pipelines in 108 seconds — Beniamin Kwak
English · Quick review before the interview
Shot 1 (0:00) Figure 6-1 animation: YAML and template merge → compile → stage DAG → checks → job scheduling.
Shot 2 (0:50) Side-by-side output comparison of the three variable syntaxes (Q17).

Official docs:Deployment jobs · Variables

A quiz score of ≥ 70% also marks it complete automatically.

Module 7 · Part B: Cloud deployment and security (interview questions 26–38)

44:00 – 52:00 · service connections, WIF, Environments, secrets, job tokens, forks, AWS, AKS, IaC, agent security, supply chain, enforced scanning
8 min13 questionsIntermediate to advanced
Learning objectives
  • Explain the full path of a “zero-secret deployment”: WIF/OIDC → short-lived token → least-privilege RBAC → protected resources and checks.
  • Be able to answer the common pipeline security follow-ups: job token scope, forks, Key Vault, self-hosted agent isolation, and enforced templates.
Q26. What is a service connection? How do you control who and which pipelines can use it?Junior
30-second answer

A service connection is a project-level resource that wraps the credentials or federated configuration for accessing external systems (Azure, AWS, Docker registries, Kubernetes, GitHub, and so on). Tasks reference it by name and never touch the credentials themselves. Control works at three layers: user roles (Administrator/Creator/User),pipeline permissions (granted per pipeline to avoid “all pipelines can use it”),Approvals and checks and checks (approvals, branch control, Required template, etc.).

Deeper answer

Service connections are resolved by name at compile time and cannot be specified with runtime variables (#26). They can be shared to other projects. A connection unused for 100 days is automatically disabled (#31). For production connections: use one connection per environment, scope it to a resource group, and combine it with branch control so that only refs/heads/main is allowed.

Common follow-ups
  • Should approvals go on the service connection or the Environment? — Either works. Deployment approvals are usually placed on the Environment, while guardrails such as branch control and Required template go on the service connection.
Bonus points

Mention that checks are defined on the resource side, so YAML authors cannot change them.

Common wrong answers

“Put the service principal secret in a variable group and run az login in a script.”

Q27. Explain how workload identity federation (WIF) works in Azure Pipelines.Advanced
30-second answer

At runtime, the task requests an OIDC token from Azure DevOps (containing issuer, subject, and audience) and sends it to Microsoft Entra as a client assertion. Entra looks for a federated credential on an app registration or user-assigned managed identity whose issuer, subject, and audience match exactly. If it matches, Entra issues a short-lived access token. No secrets are stored at any point.

Deeper answer

Two kinds of issuer: the older Azure DevOps issuer https://vstoken.dev.azure.com/<org ID>, subject sc://<org>/<project>/<connection name> (renaming breaks it, #28; it can be used for federation with external IdPs such as AWS). New service connections use the Entra issuer https://login.microsoftonline.com/<tenant ID>/v2.0, and the subject is based on the organization ID and service connection ID (exchangeable only for Entra tokens). The audience is api://AzureADTokenExchange. Typical error codes: AADSTS700213 (subject), AADSTS70021/700211 (issuer), AADSTS700024 (assertion expired), AADSTS700223/700238 (tenant restrictions).

Common follow-ups
  • Why do long scripts fail? — The assertion has a short validity period and expires before a later exchange (#33).
  • Can multi-tenant apps be used? — The Entra issuer does not support multi-tenant apps (AADSTS70052).
Bonus points

Be able to outline the order for automating WIF connection creation: create the connection first to get the issuer and subject, then create the federated credential.

Common wrong answers

“WIF means Azure DevOps stores a more secure secret for you.”

Q28. Should a service connection use an app registration or a managed identity? What are the trade-offs?Intermediate
30-second answer

Both can be used with WIF. A user-assigned managed identity is an Azure resource that does not require the “create app” permission in Entra. Its lifecycle follows the resource group, and its tokens have a longer lifetime (about 24 hours, helpful for long tasks). App registrations are more general (they can span subscriptions and be granted Graph permissions), but they require app management permissions, and you must prevent secrets from being added to them.

Deeper answer

When you lack permission to create apps (“Insufficient privileges to complete the operation in Microsoft Graph”), the official recommendation is to configure WIF manually with a managed identity instead. Manage identities, federated credentials, and role assignments with IaC so they stay auditable and rebuildable.

Common follow-ups
  • Can a managed identity access another tenant? — Not directly. Each tenant needs its own identity and connection.
Bonus points

Point out that for the AADSTS700024 scenario, the official recommendation is managed-identity WIF.

Common wrong answers

“Managed identities can only be used for self-hosted agents on VMs” — WIF scenarios do not require the agent to run in Azure.

Q29. What are Environments? What types of approvals and checks are there, and in what order do they run?Intermediate
30-second answer

An Environment is a logical representation of a deployment target (which can include Kubernetes namespaces and VM resources) and records deployment history (which run, which commits, and which work items). Checks can be configured on the Environment, service connections, repositories, variable groups, secure files, and agent pools. Order: static checks (branch control, Required template, Evaluate artifact) → pre-check approvals → dynamic checks (approvals, Invoke Azure Function, Invoke REST API, business hours, Azure Monitor alerts) → post-check approvals → exclusive lock.

Deeper answer

If an approval times out, the stage is skipped. If any check ultimately fails (for example, is rejected), the stage fails. Approvals can be deferred, and administrators can bypass checks (which are logged). The exclusive lock works with lockBehavior: sequential | runLatest (default runLatest) to control concurrent deployments. Runs waiting for approval do not consume a parallel job.

Common follow-ups
  • When is the approver list determined? — It is fixed when the checks start running; later changes have no effect.
Bonus points

Mention combining the ServiceNow change management check (extension) with the business hours check to implement a change window.

Common wrong answers

“Writing approval: true in YAML” — approvals are not defined in YAML.

Q30. How should secrets in pipelines be managed?Intermediate
30-second answer

Prefer “no secrets”: use WIF or managed identities for cloud access. Third-party keys that must exist go in Key Vault and are fetched at runtime through a linked variable group or AzureKeyVault@2. Certificates and config files use secure files. Secret variables do not automatically become environment variables, so in the steps that need them, use env: mapping. Fork builds do not receive secrets.

Deeper answer

Log masking only works on exact matches, so do not print base64 or split versions of a secret. To output a secret variable, use issecret=true; variable groups and secure files also have pipeline permissions and checks. Key Vault RBAC, access policies, and firewalls are common failure points (#36). A private-network Key Vault requires an agent inside the VNet (Managed DevOps Pools VNet injection).

Common follow-ups
  • How do you rotate secrets? — Rotate them in Key Vault, and the pipeline fetches the new value on its next run. Avoid copying secrets into variable groups in plain text.
Bonus points

GHAzDO push protection blocks secrets from entering the repo at the source.

Common wrong answers

“Secret variables are safe, so you can echo them to debug.”

Q31. What is System.AccessToken? What do “Limit job authorization scope” and “Protect access to repositories” do?Advanced
30-second answer

System.AccessToken Each job gets a short-lived OAuth token representing the build service identity. With “Limit job authorization scope” enabled, it is <project> Build Service (<organization>); the token is only valid for the current project. Otherwise it is Project Collection Build Service, valid for the entire organization. “Protect access to repositories in YAML pipelines” further requires that only repos accessed via checkout or uses explicitly referenced repos can be accessed (enabled by default for organizations and projects created after 2020-05).

Deeper answer

These settings limit the blast radius of a compromised pipeline to the current project and the repos it references. The cost is that cross-project access needs explicit authorization (#12), and write-back to repos requires granting the build service permission (#4). When using the token in a script, map it explicitly: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken).

Common follow-ups
  • Why does TF401027 show Build\GUID? — That is the build service identity.
Bonus points

Distinguish the two independent scope switches: “non-release pipelines” and “release pipelines”.

Common wrong answers

“Pipelines run as the user who triggered them.”

Q32. An open-source repo accepts external PRs. How does CI keep things safe?Intermediate
30-second answer

Fork code is untrusted. By default, do not provide secrets to fork builds and do not let fork builds use production service connections. Run them only on Microsoft-hosted agents (to keep them out of the internal network). GitHub repos can require a team member to comment before a build runs. Keep release pipelines separate from validation pipelines, and run releases on protected branches only after merge.

Deeper answer

Add conditions to steps that need secrets ne(variables['System.PullRequest.IsFork'], 'True'); do not enable “provide secrets to forks”. Configure branch control on the service connection so that the source branch of a fork PR does not meet the conditions. Also guard against poisoning: the PR can modify the pipeline YAML itself, so checks on protected resources (branch control, Required template) are the key line of defense.

Common follow-ups
  • Is it the same for forks in Azure Repos? — Fork builds have the same secret settings (follow the docs).
Bonus points

Point out that public projects have been retired, and that open-source collaboration is increasingly moving to GitHub.

Common wrong answers

“As long as the code was reviewed, it is safe” — builds run before review.

Q33. How do you deploy from Azure Pipelines to AWS without secrets?Advanced
30-second answer

Use an AWS service connection from AWS Toolkit for Azure DevOps (1.15.0+), check “Use OIDC”, and enter the ARN of the role to assume. In IAM, create an OIDC identity provider for vstoken.dev.azure.com/<org ID>, and in the role trust policy use StringEquals exact matching :sub = sc://<org>/<project>/<connection name> and :aud. At runtime, the task gets an ADO OIDC token and calls sts:AssumeRoleWithWebIdentity to exchange for temporary credentials.

Deeper answer

Use one role and one connection per environment, with minimal role permissions. For cross-account deployments, AssumeRole from that role into the target account. Common failures: using the organization name instead of the organization ID, or renaming the connection so the sub no longer matches (#37). Without the Toolkit, you can also get an OIDC token in a script and then call the AWS CLI (implementation details follow the official blog).

Common follow-ups
  • Why can’t the new Entra issuer be used for AWS? — The tokens it issues can only be exchanged for Entra access tokens.
Bonus points

Draw an analogy between the same principle of exact-matching trust conditions and GitHub Actions OIDC.

Common wrong answers

“Storing AWS access keys in a variable group.”

Q34. Design a pipeline that deploys to AKS: build, push, deploy, observe.Intermediate
30-second answer

Build stage: build the image, scan it, and push it to ACR (tag with the commit SHA, not latest). Deploy stage: a deployment job bound to the Environment’s Kubernetes resource (namespace), deploying with KubernetesManifest@1 (supports WIF) or HelmDeploy and referencing an immutable image digest. After deployment, run a smoke test, and an Environment check queries Azure Monitor alerts before promotion.

- deployment: aks
  environment: myapp-prod.shop      # Environment resource (namespace)
  strategy:
    runOnce:
      deploy:
        steps:
        - task: KubernetesManifest@1
          inputs:
            action: deploy
            manifests: $(Pipeline.Workspace)/manifests/*.yaml
            containers: myacr.azurecr.io/myapp@$(imageDigest)
Deeper answer

Cluster permissions: AKS Entra integration + Azure RBAC, with the deployment identity having write access only in the namespace (#38). For AKS to pull from ACR, use the kubelet managed identity with AcrPull rather than imagePullSecret. You can also switch to GitOps: the pipeline only updates the manifest repo, and Flux or Argo CD reconciles it (see the Helm course).

Common follow-ups
  • Why use a digest instead of a tag? — Tags are mutable; a digest guarantees you deploy the exact image that was scanned.
Bonus points

The Evaluate artifact check can run policy evaluation against container image metadata.

Common wrong answers

“Running kubectl apply in the pipeline and using cluster admin credentials.”

Q35. How would you design Bicep / Terraform infrastructure deployments with Azure Pipelines?Advanced
30-second answer

PR: format, validate, and static scan, plus a preview (Bicep what-if, Terraform plan), with results posted as PR comments or artifacts. After merge: for each environment, preview first, then go through Environment approval, and finally apply the same plan. Identity uses a WIF service connection, with permissions limited to the corresponding resource group or subscription.

- task: AzureCLI@2
  inputs:
    azureSubscription: sc-azure-prod
    scriptType: bash
    scriptLocation: inlineScript
    inlineScript: az deployment group what-if -g rg-myapp-prod -f main.bicep -p @prod.parameters.json
Deeper answer

Terraform needs to handle remote state and locking; the plan file is passed to the apply stage as a pipeline artifact, and its freshness is verified. Bicep deployment stacks can manage deletion and protection (follow the docs). For concurrency control, use the Environment’s exclusive lock (lockBehavior: sequential) to avoid two pipelines changing the same environment at once. Drift detection uses scheduled triggers.

Common follow-ups
  • What if the plan seen during approval differs from what actually gets applied? — Save the plan file and apply that file. If the state changes, the plan is invalid and must be approved again.
Bonus points

Link to #44 in Terraform course Lesson 8 (plan and apply mismatch).

Common wrong answers

Running directly in each environment terraform apply -auto-approve.

Q36. What are the security risks of self-hosted agents? How do you harden them?Advanced
30-second answer

Risks: agents sit inside the internal network, so pipeline code amounts to running arbitrary commands inside it; working directories and credentials may persist between jobs; the agent service account may have excessive permissions; and after a compromise, attackers can move laterally. Hardening: use one-time or temporary agents (Managed DevOps Pools are stateless, VMSS agents are rebuilt each time), least-privilege service accounts, network segmentation and outbound allowlists, do not let forks or untrusted pipelines use the pool, and split pools by trust level, configuring pool-level checks and pipeline authorization.

Deeper answer

Register agents using a service principal or a short-lived PAT (#18). Harden images with CIS (managed images do not meet CIS). Upgrade agents and tools promptly (#19, #34). Logs and _diag may contain sensitive information. Collect them centrally and control access. When excluding agent working directories from antivirus scanning, assess the risk.

Common follow-ups
  • Can container jobs provide isolation? — They reduce contamination, but containers are not a strong security boundary.
Bonus points

Mention that agent pools can also be configured with Approvals and checks and pipeline permissions.

Common wrong answers

“Self-hosted agents are more secure because they are on the internal network.”

Q37. How do you do software supply chain security on Azure DevOps?Advanced
30-second answer

At the source: GHAzDO Secret Protection (push protection and secret scanning) and Code Security (dependency scanning, CodeQL code scanning), plus branch policies and reviews. In the build: templates, agents, and tasks with pinned versions; dependencies go through Artifacts upstream proxying and auditing, with SBOM generation. For artifacts: signing (such as the Notation task), image scanning, and digest-based deployment. For deployment: Evaluate artifact, Required template, and branch control checks.

Deeper answer

GHAzDO is currently split into Secret Protection ($19 per active committer per month) and Code Security ($30), which can be enabled separately; active committers are counted over 90 days. Dependency security also includes lock files and protection against private package name squatting (dependency confusion). Have feeds pull only from trusted upstreams, and control who can publish a package for the first time.

Common follow-ups
  • How are scan results used to block? — Run scanning tasks in build validation and fail based on severity level, or call a policy service in deployment checks.
Bonus points

Include “immutable artifacts + versions cannot be reused (#40)” in the supply chain discussion.

Common wrong answers

Only answering “install a scanning plugin.”

Q38. How do you force all production deployments through security scanning so that developers cannot bypass it?Advanced
30-second answer

Put the scanning into an extends template maintained by the platform team; configure on the production service connection and Environment Required template checks (only pipelines that extend the specified template at the specified ref can use them), as well as branch control (only the protected main branch is allowed). The template repo itself is protected by branch policies. Checks are defined on the resource, so developers cannot get around them even by changing the YAML.

Deeper answer

Supplementary measures: pipeline decorators (inject steps into all jobs through an extension; suitable for organization-wide enforcement but costly to maintain), an organization policy that restricts creating classic pipelines (classic is not subject to Required template), and monitoring audit events for checks being bypassed.

resources:
  repositories:
  - repository: templates
    type: git
    name: platform/pipeline-templates
    ref: refs/tags/v3.2.0
extends:
  template: secure-deploy.yml@templates
  parameters:
    service: myapp
Common follow-ups
  • What if a developer puts a script step in the extends parameters? — The template uses each to iterate over stepList and reject disallowed tasks.
Bonus points

Point out that Required template is a static check that runs first, so failures do not waste approvers’ time.

Common wrong answers

“Write a document asking everyone to add the scanning step.”

Figure 7-1 · Four lines of defense for zero-secret deployment

① Code and templatesBranch policies · extends templatesGHAzDO push protection ② Protected resourcesPipeline permissions · Required templateBranch control · approvals · exclusive lock ③ Identity exchangeWIF / OIDC → short-lived tokenNo stored secrets ④ Least privilege on the cloud sideRG-level RBAC · namespace RBACIAM role conditions
In an interview, organize your answers around these four lines of defense; most of Q26–Q38 map onto one of them.
Scenario 1: The company currently has 40 Azure service connections based on client secrets, 6 of which expire next month. Provide a migration plan.
Reference approach
  • Inventory: az devops service-endpoint list Filter by authorization.scheme ; record the pipelines that use them (Usage history).
  • For the 6 expiring first: check whether the tasks support WIF (#35), upgrade the task versions, then convert.
  • Batch phase: convert by project in batches. If something fails, you can fall back to secrets (the official tooling supports conversion and fallback; follow the docs for the time window).
  • Wrap up: prohibit creating new secret-based connections, and clean up secrets on app registrations.
Scenario 2: Public network access to Key Vault has been turned off, so pipelines fail to fetch secrets, and the security team refuses to reopen public access. What do you do?
Reference approach
  • Use an agent inside the VNet: Managed DevOps Pools VNet injection or a self-hosted agent (reachable via private endpoints).
  • Authorize the pool only for the pipelines that need it, and grant the service connection identity Key Vault Secrets User.
  • Evaluate whether WIF can directly access the target service, which would avoid fetching secrets from Key Vault at all.
Scenario 3: An audit finds that a developer modified the YAML, skipped image scanning, and successfully deployed to production. How do you prevent this mechanically?
Reference approach
  • Configure the production Environment and service connection with Required template and branch control (only main is allowed).
  • Move scanning into an extends template; the template repo is protected and referenced by tag.
  • Audit alerts: checks bypassed, service connection permission changes, Required template check disabled.

Teaching videos (titles and channels verified via YouTube oEmbed)

▶
Azure DevOps Workload Identity Federation with Azure Overview. NO MORE SECRETS! — John Savill's Technical Training
English · Q27, Q28
▶
Azure DevOps Environments EXPLAINED — CoderDave
English · Q29
▶
Inject your Managed DevOps Pool into a VNet — Programming with Wolfgang
English · Private network resource access (Scenario 2, Q36)
Shot 1 (0:00) Figure 7-1: light up the four lines of defense one by one, with narration matching Q26–Q38.
Shot 2 (0:50) Demonstrate the Required template check rejecting a pipeline that does not extend the template.

Official docs:Connect to Azure · Pipeline security

A quiz score of ≥ 70% also marks it complete automatically.

Module 8 · Part B: Enterprise governance and scenario design (interview questions 39–50)

52:00 – 60:00 · organization policies, audit, multi-team governance, agent pool architecture, cost, release governance, migration, backup, three design questions, and two incident questions
8 min12 questionsMainly advanced
Learning objectives
  • Organize scattered knowledge into a “governance architecture”: identity → policy → templates → protected resources → audit → cost.
  • Answer design questions with a structured method (requirements clarification → architecture → security → operations → cost → evolution), and incident questions with a sequence of stop the bleeding → locate → fix → post-mortem.
Q39. When you take over an Azure DevOps organization, which organization-level policies and settings do you check first?Intermediate
30-second answer

Identity: whether Entra is connected, external guest access, conditional access, PAT policy (limits on global and full-scope PATs, maximum lifetime, automatic revocation on leak). Application access: third-party OAuth apps, SSH authentication. Pipelines: limit job authorization scope (two switches), protect YAML repo access, disable classic pipeline creation, fork secret settings, and shell task argument validation. Audit: whether it is enabled and streamed. Licensing and billing: group rules, parallel jobs, artifact limits.

Deeper answer

Produce a baseline report and gap list, ranked by risk. Long-lived full-scope PATs, production service connections usable by all pipelines, too many PCA members, and auditing turned off are the most common high-risk items. Changes go through change management and are communicated in advance (for example, enabling job scope limits makes cross-project checkouts fail, #12).

Common follow-ups
  • How many PCA members should there be? — A few (including emergency accounts), reviewed regularly.
Bonus points

Mention the value of “limit user visibility to specific projects” and Project-Scoped Users for external collaboration.

Common wrong answers

Only checking project-level settings and ignoring organization-level and tenant-level policies.

Q40. What are the limitations of Azure DevOps auditing? How do you meet compliance retention of more than one year?Intermediate
30-second answer

Auditing is off by default, is only available to Entra-backed organizations, and events are retained for 90 days with no option to change that. For long-term retention, use audit streaming to send to Splunk, Azure Monitor Logs (AzureDevOpsAuditing table, which can connect to Sentinel), or Event Grid. After a stream interruption, re-enabling it backfills up to 7 days; up to 2 streams per target type.

Deeper answer

Design: enable auditing → dual streams (Log Analytics + archive) → Log Analytics retention set per compliance requirements → alerts on critical events (permission changes, policy changes, system-revoked PATs, checks bypassed, service connection changes) → stream health monitoring. Note that auditing does not record every PAT use, only lifecycle events.

Common follow-ups
  • Which high-value alerts are there? —Token.PatPublicDiscoveryEvent, organization policy changes, PCA membership changes, and Bypass policies.
Bonus points

Mention that Splunk HEC cannot have indexer acknowledgment enabled, or no events will flow in.

Common wrong answers

“Audit logs are kept permanently in Azure DevOps.”

Q41. With 50 teams sharing one organization, how do you achieve “autonomous but compliant”?Advanced
30-second answer

The platform team provides a “paved road”: project creation templates (standard security groups, branch policies, service connection naming), a versioned extends template library, shared agent pools, and standard Environment checks. Use organization policies and Required template to set guardrails that cannot be bypassed. Teams are free to choose tools and pace within those guardrails.

Deeper answer

Governance as code: manage projects, groups, policies, and service connections via REST/CLI (or the Terraform azuredevops provider), with changes going through PRs. Branch policies across repos are rolled out uniformly by branch name pattern. Templates use semantic versioning, with a deprecation period for old versions. Use Analytics and auditing to measure compliance rates (for example, “number of production pipelines not using the standard template”).

Common follow-ups
  • What if a team needs an exception? — Exceptions are registered, time-limited, and have compensating controls.
Bonus points

Articulate the “platform as a product” idea: templates come with documentation, examples, support channels, and SLAs.

Common wrong answers

“The platform team writes all pipelines” — this becomes a bottleneck.

Q42. Design the agent infrastructure for 300 engineers.Advanced
30-second answer

Tiering: general CI uses Microsoft-hosted agents (zero maintenance, suitable for untrusted code). Jobs that need internal network access or large specs use Managed DevOps Pools (custom images, VNet injection, on-demand scaling, stateless preferred). Special hardware (GPU, macOS signing) uses dedicated self-hosted pools. Split pools by trust level and network zone, and configure pipeline authorization and checks for each pool.

Deeper answer

Capacity: estimate parallel jobs from the Pool consumption report (about 1 per 4–5 people as a starting point), and distinguish peak from overnight. Cost: Microsoft-hosted parallel job fees vs. Managed DevOps Pools VM fees plus parallel jobs. Managed DevOps Pools require registering the resource provider, a Dev Center project, and quota (by core count of the SKU family; default SKU Standard D2ads v5). Image pipeline: rebuild monthly, scan, publish.

Common follow-ups
  • Risks of stateful pools? — Leftover state between jobs. Only use them for trusted pipelines, and recycle them regularly.
Bonus points

Mention that Microsoft-hosted agents cannot connect to private networks, so accessing private resources requires switching to a different pool.

Common wrong answers

“Use one large self-hosted server for everything.”

Q43. What are the main cost items of Azure DevOps? How do you optimize them?Intermediate
30-second answer

User licenses (Basic/Test Plans), parallel jobs (hosted/self-hosted), Artifacts storage (over 2 GiB), GHAzDO (per active committer), and cloud resources consumed by pipelines (agent VMs, deployment targets). Optimization: group rules and periodic license cleanup, VS subscription entitlements, adjusting parallel jobs based on queue data, Artifacts retention policies, enabling GHAzDO on demand, and shortening job durations.

Deeper answer

Establish a monthly review: Billing page, Users page Last access, Pool consumption report, Storage page. For parallel jobs, look at queue time to judge marginal returns: cutting 10 minutes of queue time may be cheaper than buying one more job (caching, batching, path filters).

Common follow-ups
  • Why does the first purchase of a hosted job seem to have no effect? — It only removes the time limit (#48).
Bonus points

Provide quantifiable metrics: cost per build, P90 queue time.

Common wrong answers

“Pipelines are billed by build minutes” — apart from the legacy per-minute plan, billing is by parallel job.

Q44. A regulated industry requires that “changes must be approved, released only within a window, and only one release at a time.” How do you implement this?Intermediate
30-second answer

On the production Environment, configure: approvals (specified groups, with self-approval of one’s own runs prohibited), a business hours check (change window), a ServiceNow change management check (extension, can automatically create change tickets), and an exclusive lock (lockBehavior: sequential); deployment history and approval records are retained in the Environment and in auditing.

Deeper answer

Delayed approvals can be approved in advance and take effect at the scheduled time. Emergency changes go through a separate emergency process (an authorized administrator bypasses checks, leaving a record that is reviewed afterward). The approver list is fixed when checks start, so change approval groups must be set up in advance. All checks are configured on resources, so YAML cannot bypass them.

Common follow-ups
  • What happens to runs queued outside business hours? — They wait until the window opens. If they time out, the stage fails.
Bonus points

Point out that runs waiting for approval do not consume a parallel job.

Common wrong answers

Using a cron scheduled trigger instead of a change window — it cannot cover manual runs.

Q45. How do you migrate from Jenkins to Azure Pipelines? Conversely, what should you watch for when moving from Azure DevOps to GitHub?Advanced
30-second answer

Jenkins → Azure Pipelines: inventory jobs and plugins and migrate in batches by value; map Jenkinsfile stage/agent/post to stage/pool/condition; move credentials to service connections and Key Vault; turn shared libraries into template libraries; run both in parallel for a period and compare results. Azure DevOps → GitHub: GitHub Enterprise Importer migrates code, PRs, and branch policies (pipelines and LFS objects are not migrated). Pipelines can stay in Azure Pipelines pointing at GitHub repos, or be converted to Actions. Boards can continue to be used (AB# linking).

Deeper answer

Migration risks: identity mapping, webhooks and service hooks, work item links, build numbers and artifact paths, and differences in permission models (GitHub teams and rulesets vs. ADO security groups and policies). Migrate layer by layer in the order code → CI → CD → planning, keeping a fallback path at each layer.

Common follow-ups
  • What about LFS objects? — Push them separately to the new remote with git lfs.
Bonus points

Mention the migration driver from public project retirement (#50).

Common wrong answers

“A one-time big-bang migration with a weekend cutover.”

Q46. How are Azure DevOps Services data backed up and recovered in a disaster?Advanced
30-second answer

Services handles platform-level high availability and backups on Microsoft’s side, but does not provide a customer-facing “restore my organization to a point in time” capability (follow the official data protection documentation). On the customer side, address accidental deletion and malicious destruction: restrict delete permissions, use the recycle bin or soft delete (recovery windows for projects, repos, and packages are in the docs), regularly mirror repos to another location, export pipeline YAML (already in the repos), export key configuration (service connections, policies, groups) as code, and make sure key packages in Artifacts have upstreams or backups.

Deeper answer

DR drill: rebuild the project structure in another organization using governance as code; daily, git clone --mirror pushes key repos to a standby remote; Boards data is exported periodically via Analytics/REST. The goal is to “restore delivery capability within the RTO,” not merely to preserve data.

Common follow-ups
  • Can deleted repos be recovered? — Yes, within the recycle bin retention period. After it expires, they cannot be recovered.
Bonus points

Emphasize that YAML pipelines plus governance as code make rebuilding feasible, whereas classic pipelines are very hard to rebuild.

Common wrong answers

“SaaS doesn’t need backups to be considered.”

Q47. Design question: design CI/CD for 30 microservices (same product, deployed on AKS).Advanced
30-second answer

Repo strategy (monorepo or multi-repo both work; the key is unified templates) → each service has one pipeline that extends the same template: PR validation (build, unit tests, scanning) → after merge, build the image and push it to ACR (SHA tag + digest) → automatic deployment to dev → automated tests in test → prod through Environment approval + health checks + canary → post-deployment monitoring and automatic rollback.

Deeper answer

Key design points: in a monorepo, use path filters to build only the affected services; automate versioning and release notes; use contract testing between services; publish shared libraries through an artifact feed; create resources per namespace in Environments, and authorize deployment identities per namespace; estimate parallel job capacity from peak PR counts; GitOps can replace the deployment stage (the pipeline only changes the manifest repo).

Common follow-ups
  • How do you avoid drift across 30 pipelines? — extends template + Required template + a template version upgrade bot.
Bonus points

Propose metrics: display the four DORA metrics on a per-service dashboard.

Common wrong answers

One giant pipeline that builds all services sequentially.

Q48. Design question: deploy to both Azure and AWS, with no long-lived cloud credentials anywhere in the pipeline.Advanced
30-second answer

Azure: ARM service connections use WIF (managed identity or app registration), with connections split by environment and scoped to resource groups. AWS: AWS Toolkit service connection with Use OIDC checked, and an IAM OIDC provider for vstoken.dev.azure.com/<org ID> + an exact sub condition, with roles split by environment. Both sides pair with Environment approvals, branch control, and Required template.

Deeper answer

Remaining secrets (third-party API keys) go in Key Vault and are read by a WIF identity. For image push, ACR uses the service connection identity (AcrPush) and ECR uses an AWS role. For auditing, Azure activity logs, CloudTrail, and ADO audit streams are aggregated into a SIEM and correlated by run ID. Note that tokens from the new Entra issuer cannot be used for AWS; the AWS side relies on the Azure DevOps issuer.

Common follow-ups
  • How do you prove there are no long-lived credentials? — Inventory the service connection schemes, scan the variable groups, check that app registrations have no secrets, and check that IAM has no access keys.
Bonus points

Present the trust conditions’ “exact matching + minimum scope” as one unified principle.

Common wrong answers

“Storing AWS access keys in Key Vault counts as having no credentials.”

Q49. Scenario: after a production deployment, the error rate spikes. How do you roll back quickly in Azure Pipelines and run a post-mortem?Intermediate
30-second answer

Stop the bleeding: re-run the deployment stage of the last successful version (or trigger a rollback pipeline with the previous image digest or artifact version as a parameter). For a canary strategy, stop promotion and run the on: failure rollback. Confirm the metrics recover. Locate: the Environment deployment history lists the commits and work items included in this deployment, so compare the differences. Post-mortem: add the missing gates (Azure Monitor alert check, smoke tests) and record them in the runbook.

Deeper answer

This assumes artifacts are immutable and replayable. Database migrations should follow the expand-contract pattern; otherwise the code can roll back but the data cannot. The rollback itself also goes through checks (in an emergency, an authorized person bypasses them, leaving a record).

Common follow-ups
  • The rollback pipeline is stuck behind the exclusive lock? — The lock’s runLatest behavior gives priority to the latest run; in an emergency, consider canceling runs that are still waiting.
Bonus points

Mention using Query Azure Monitor Alerts to automate the health judgment.

Common wrong answers

“Log in to the server and revert the change by hand.”

Q50. Scenario: a full-scope PAT was found committed to a public GitHub repo. What is your response process?Advanced
30-second answer

Revoke the PAT immediately (Azure DevOps may also have revoked it automatically, and the audit log will contain Token.PatPublicDiscoveryEvent / Token.PatSystemRevokeEvent); assess impact: the PAT owner’s permission scope, the window of exposure, and the user’s abnormal operations in the audit log (permission changes, service connection changes, pipeline changes, package publishes). Rotate affected downstream secrets if necessary, remove the secret from Git history and notify, then review and harden (PAT policy, push protection, migration to Entra tokens).

Deeper answer

Auditing only records PAT lifecycle events, not each use, so combine it with other logs (Git pushes, pipeline runs, service connection usage history) to determine whether the PAT was exploited. Administrators can revoke a user’s PATs with the Token Administration API. Prevention: tenant policies limiting full-scope and global PATs and maximum lifetimes, keep automatic revocation on leak turned on, GHAzDO or GitHub push protection, and use WIF and System.AccessToken in CI instead of personal PATs.

Common follow-ups
  • Is rewriting Git history enough? — No. The secret has already been exposed and must be revoked. History cleanup only reduces repeated exposure (Git course #50).
Bonus points

Know that Azure DevOps PATs are 84 characters and contain a fixed AZDO signature, which helps scanning tools detect them.

Common wrong answers

“Delete that GitHub commit first, then watch to see if anything goes wrong.”

Figure 8-1 · Enterprise governance architecture (top-down)

Identity: Entra connection · group rules · conditional access · PAT policy · service principals/managed identities (Q39 Q50) Organization policies: job scope · repo protection · disable classic · fork secrets · external guests (Q39) Paved road: project templates · extends template library · branch policy rollout · shared agent pools (Q41 Q42 Q47) Protected resources: Required template · branch control · approvals · business hours · exclusive lock (Q44 Q48) Audit stream → SIEM (Q40) Cost and capacity review (Q43)
Design question answer order: clarify constraints first → present a solution across these five layers → explain how to measure and evolve it.
Scenario 1: The company has been acquired and must merge the acquired company’s Azure DevOps organization (in a different tenant) into its own organization within 3 months. Provide a plan.
Reference approach
  • Decision: merge into new projects in the existing organization, or keep a separate organization (considering tenancy, data residency, and compliance).
  • Identity: bring the acquired company’s users in as guests or migrate them into the main tenant, and establish a user mapping.
  • Code: migrate repo mirrors (preserving history). Boards: migrate work items using a migration tool or REST (validate links and attachments). Pipelines: YAML migrates with the repos, while service connections and variable groups are rebuilt (converted to WIF).
  • Cutover: freeze window, parallel runs, rollback plan. Finally, archive the old organization.
Scenario 2: A security audit requires proof that “every production deployment in the past year was approved and came from main.” Can existing capabilities meet this? How do you fill any gaps?
Reference approach
  • The Environment deployment history plus approval records can prove approvals; branch control checks guarantee the source branch.
  • Auditing defaults to only 90 days, so an audit stream must already exist. If not, the data can only be exported from Environment and run history (subject to the run retention policy).
  • To fill gaps: enable an audit stream immediately, extend run retention, and enforce branch control and Required template on the production Environment.
Scenario 3: The CFO questions why the Azure DevOps cost doubled in a year. Provide an analysis and optimization path.
Reference approach
  • Break down the bill: user licenses, parallel jobs, Artifacts, GHAzDO, agent VMs.
  • Licenses: Last access cleanup, VS entitlements, group rules. Parallelism: consumption report and queue time. Artifacts: retention policies. GHAzDO: by repo and product scope. VMs: scale-down policy for Managed DevOps Pools.
  • Set up a monthly cost dashboard and budget alerts.
A quiz score of ≥ 70% also marks it complete automatically.

Problem cheat sheet + interview flashcards

50 “error → first step → fix” entries and 50 one-line flashcards; printable
After classFilterable · printable

A · Problem cheat sheet (50 entries)

Five “look here first” checks

SignalCheck first
Run has no jobs at allError at the top of the run page: compilation (#21 #22 #25) or resource authorization (#26 #27 #12)
Stuck in QueuedParallel jobs page + Pool consumption report + agent capabilities (#13 #14 #48)
TF4010xx / TF4024xxIs it a “person” or the Build Service? Search for the identity in the repo Security settings (#3 #4 #5 #12)
AADSTS7002xxService connection issuer/subject vs. federated credential (#28 #29 #33)
403 AuthorizationFailed / ForbiddenCloud-side RBAC scope (#32 #36 #38)

B · Interview flashcards (50 cards)

Comprehensive drill + full mock interview + final quiz

8 mixed failure scenarios (each spans at least two modules) → mock interview of 10 out of 50 → 12 final-exam questions
≈ 30 minutesAnswer independently first, then expand

Comprehensive failure drill: myapp release day

Scenario: today the myapp-lab project is releasing myapp 1.4.0 to production (AKS + Key Vault). At the same time, a new colleague is joining, and the platform team has upgraded the shared template. The failures below appear in chronological order. For each scenario, first write down your first-step diagnosis and root-cause hypothesis, then expand to compare.

08:30 New colleague carol can sign in, but opening the PR link says she has no permission, and there is no Repos on the left.
Reference answer

The access level is Stakeholder (#2). az devops user show Check it; add her to the developer group via an Entra group rule to get Basic. If she signed in from another tenant, it is #1.

09:10 After the platform team publishes shared template v4, the myapp pipeline immediately fails at run time with “/templates/build.yml (Line: 3, Col: 1): A sequence was not expected”, with no jobs at all.
Reference answer

A compile-time error (#21). myapp references the template without pinning its ref, so it picks up v4 from main by default. Download the expanded YAML to locate the problem; in the short term, pin ref to refs/tags/v3.x, and in the long term add preview API validation and semantic versioning to the template repo.

09:40 After the fix, the pipeline sat in “Queued” for 25 minutes. The Parallel jobs page shows Microsoft-hosted: 1 (Paid 1).
Reference answer

Parallelism limit (#14, #48): the first purchase only removes the time limit; parallelism stays at 1, and the morning PR peak filled it. Temporarily cancel unimportant runs or use a self-hosted pool. In the long term, buy based on the Pool consumption report, and enable batching and path filters.

10:20 The npm ci step in the build stage fails with E401; it worked yesterday. Last night an administrator turned on “Limit job authorization scope to current project.”
Reference answer

The identity changed from Project Collection Build Service to myapp-lab Build Service (the same mechanism as #12), and it has no role on the organization-level feed (#41). Grant myapp-lab Build Service the Feed Reader role in the feed’s Permissions. Do not turn off the job scope limit to fix this.

11:00 Entering the Prod stage, the run shows “This pipeline needs permission to access a resource before this run can continue to Prod”.
Reference answer

The newly added Key Vault variable group is referenced by this pipeline for the first time (#27). The variable group administrator must Permit it. This is separate from approvals (Environment checks).

11:15 AzureKeyVault@2 reports “Caller is not authorized to perform action on resource … ForbiddenByRbac”.
Reference answer

Key Vault uses the RBAC model, and the service connection identity lacks Key Vault Secrets User (#36). Assign the role at that Key Vault’s scope. If it is a network 403, an agent inside the VNet is needed.

11:40 The deploy task reports AADSTS700213 … subject 'sc://contoso/myapp-lab/sc-aks-prod'. Last week the project was just renamed from myapp to myapp-lab.
Reference answer

The subject in the old issuer format contains the project name (#28). Edit and save the service connection to refresh it (for an identity created by Azure DevOps), or manually update the federated credential subject. Then check other WIF connections.

12:05 KubernetesManifest@1 reports “deployments.apps is forbidden … in the namespace shop”. After the release, writing CHANGELOG back to main then reported TF402455.
Reference answer

AKS Azure RBAC: the deployment identity lacks namespace-level write permission (#38). Assign Azure Kubernetes Service RBAC Writer at namespace scope. Writing back to main is protected by branch policies (#5). Instead, create a PR with auto-complete, and do not give the build service Bypass.

Acceptance checklist

Open-ended self-test (6 questions)

  1. In 2 minutes, explain to a new colleague the differences among “access level, security group permissions, and build service identity.”
  2. Draw the lifecycle of one pipeline run, and mark one question number from this lesson at each stage.
  3. Explain the difference between the two WIF issuers, and why AWS federation uses the Azure DevOps issuer.
  4. Design a CI cadence for a 20-person team with only 1 Microsoft-hosted parallel job, so that the P90 PR wait time is under 10 minutes.
  5. List the 8 organization-level settings you would configure on the first day of a new organization, and explain why.
  6. Describe the response timeline for a PAT leak incident (first 15 minutes, first 2 hours, first 2 days).

Full mock interview (10 out of 50)

Sources and version notes

All facts follow learn.microsoft.com; verified 2026-11-15
The service is updated roughly every 3 weeks; follow the latest docs.

Main sources

TopicSourceVerified dateUsed for
Pipeline troubleshooting (resource authorization, timeouts of 60/31 hours, TF401019, service connections disabled after 100 days, stopped hearing from agent, set -x quoting issue)Troubleshoot pipeline runs(docs updated 2026-11-03)2026-11-15#12 #15 #16 #24 #27 #31
Parallel jobs (free tier, first purchase, 25 limit, public project retirement)Configure and pay for parallel jobs2026-11-15#13 #48 #50 Q20
Microsoft-hosted agents (image list and retirement dates, 2 vCPU/7 GB/10 GB, IP ranges)Microsoft-hosted agents(updated 2026-11-09)2026-11-15#17 #20 Q19
Template limits (100 files, 100 levels, 20 MB) and extendsTemplates2026-11-15#25 Q18
WIF troubleshooting (issuer/subject, AADSTS error codes, task compatibility table, --federated-token)Troubleshoot workload identity service connections2026-11-15#28–#30 #33–#35 Q27
Approvals and checks (order of the five check types, exclusive lock, Required template)Approvals and checks2026-11-15Q29 Q38 Q44
Azure Repos and pipelines (PR triggers via build validation, job scope, protecting repo access, shallow clone, [skip ci])Build Azure Repos Git repositories2026-11-15#12 #23 Q16 Q31
PATs (global PAT retirement dates, automatic revocation on leak, audit events, 90 days inactive, 84-character format)Use personal access tokens(updated 2026-11-03)2026-11-15#8 Q12 Q50
Audit streams (target types, 90 days, 7-day backfill, 2 streams per type, Entra organizations only)Create audit streaming2026-11-15#47 Q40
Azure Artifacts limits (2 GiB, 5000 versions, 20 upstreams, package size)Artifacts size and count limits2026-11-15#39 #42 Q21
Managed DevOps Pools prerequisites (resource providers, Dev Center, quota, permissions)Prerequisites for Managed DevOps Pools2026-11-15Q19 Q42
New organizations disable classic pipelines by default (from Sprint 226)Pipeline security approach,DevOps blog 2023-012026-11-15#46 Q14
Agent download CDN domain changeCDN Domain URL change for Agents in Pipelines,Allowed IP addresses and domain URLs2026-11-15#19
GHAzDO pricing splitAzure DevOps pricing page,Advanced Security billing2026-11-15#45 #49 Q37
AWS Toolkit OIDC (1.15.0+, vstoken provider, sub format)AWS blog: How to federate into AWS from Azure DevOps using OpenID Connect2026-11-15#37 Q33

Video verification notes

The videos listed in this lesson were verified through the YouTube oEmbed endpoint (https://www.youtube.com/oembed?url=…&format=json) on 2026-11-15 for titles and channels:

oEmbed only confirms that a video exists and its title and channel; it does not guarantee the content matches the current product interface. Interfaces shown in third-party videos may be outdated.

Voice notes

The “Voice” tab uses the browser’s built-in Web Speech API to read the English narration and terms aloud. No data is uploaded. Without an English voice pack, read the narration script or install a system voice as the page suggests.

Known limitations and conservative handling

  • Error wording: Error messages that appear verbatim in Microsoft Learn (such as No hosted parallelism…, This pipeline needs permission…, We stopped hearing from agent…, TF401019, the AADSTS series, --federated-token, No space left on device) are quoted as written. The rest (TF400813, TF401027, TF402455, TF237111, VS30063, the full text of the resource authorization issue, 409 Conflict, E401, job timeouts, demands hints, Key Vault 403) come from actual product output and community records. Their entries are marked “wording may differ.”
  • Global PAT retirement dates: The official docs are inconsistent (2026-12-01 and 2027-01-27). Both are listed side by side; follow the latest release notes.
  • TFVC: Only confirmed that Azure DevOps Server added a “disable creating TFVC repositories” setting and plans to gradually phase out TFVC. Not confirmed that Services disables TFVC by default for new organizations, so it is not stated that way.
  • AWS OIDC audience: Written as shown in the AWS official blog example api://AzureADTokenExchange, with the note that the blog and Toolkit README take precedence.
  • REST routes and CLI fields:az devops invoke area/resource names in settingsSourceType,validDuration and similar fields; their meanings follow the REST API docs.
  • Pricing: Basic at $6 per user per month and GHAzDO at $19/$30 come from the pricing page and official announcements, and may vary by region and over time. Unit prices for hosted and self-hosted parallel jobs are not stated as specific amounts; check the pricing page.
  • All IDs, GUIDs, times, and version numbers in the “expected output” are example values. The lab commands were not actually run while this lesson was written; verify them in a lab organization.