AZ-401 Practice Test

AZ-401 Domain 3: Design and implement build and release pipelines

35–40% of the exam (AZ-400: 50–55%). 30 skills in 6 tasks, 1 of them new in AZ-401 and 4 reworded for AI tools. Study notes for each task below, then 15 free questions with answers.

112 Domain 3 questions in the bank, 15 free. Answer them one at a time with explanations.

Practice Domain 3

Skill wording is quoted from the official study guide. Tags compare each skill with the AZ-400 guide.

3.1 Design and implement a package management strategy

Task 3.1 covers where packages live (Azure Artifacts or GitHub Packages), how feeds, views and upstream sources decide what a consumer restores, and how versions are numbered and constrained. Most questions hinge on which package types each service hosts, the feed search order and the exact version-range or run-number syntax.

  • 3.1.1Recommend package management tools including Azure Artifacts and GitHub Packages 3 questions
  • 3.1.2Design and implement package feeds and views for local and upstream sources 3 questions
  • 3.1.3Design and implement a dependency versioning strategy for code assets and packages, including semantic versioning (SemVer) and date-based (CalVer) 3 questions
  • 3.1.4Design and implement a versioning strategy for pipeline artifacts 3 questions

Should I use Azure Artifacts or GitHub Packages for our packages?

Decide on package type and on whether public packages must be cached. GitHub Packages has registries for npm, RubyGems, Apache Maven, Gradle, NuGet and containers (Docker and OCI images in the Container registry). It has no Python or Cargo registry and doesn't cache packages from public registries. Azure Artifacts feeds also host Python and Cargo packages, plus Universal Packages for arbitrary files, and upstream sources save every public package a build installs, so restores keep working when PyPI or crates.io is down. In GitHub Packages, the Container, npm, NuGet and RubyGems registries support granular permissions separate from any repository; Maven and Gradle packages always inherit repository permissions. A workflow publishes with GITHUB_TOKEN and permissions: packages: write (plus contents: read for checkout), so no long-lived PAT is stored. id-token: write doesn't authenticate to GitHub Packages.

Source: Introduction to GitHub Packages; About permissions for GitHub Packages

How do upstream sources and feed views decide which package version a consumer gets?

A feed answers a request in a fixed order: packages published directly to the feed, then packages already saved from upstreams, then each upstream source in the order listed in feed settings. With only public registries the order changes nothing. If you rebuild open-source packages internally, place the upstream that holds them before the public registries so your versions win. Clients should reference one feed with upstreams (use <clear /> in nuget.config); several feeds in one config make restores nondeterministic. You can't publish a version that already exists in an enabled upstream: disable the upstream, publish, re-enable it. Every feed starts with the views @Local (the default: everything published or saved), @Prerelease and @Release. You publish only to the base feed and then promote validated versions to a view to signal quality. Custom upstream sources are supported only for npm.

Source: What are upstream sources?; What are feed views?

What access does a pipeline need to restore from a feed in another project or organization?

A project-scoped feed used from another project needs two grants. The consuming project's build service identity must be in the Readers group of the project that hosts the feed, and it must hold a role on the feed. Saving packages from upstream sources requires Feed and Upstream Reader (Collaborator) or higher. Feed Reader only downloads packages already in the feed, and Feed Owner adds deletion and settings rights that exceed least privilege. For a feed in another organization to use your feed as an upstream, share a view with all feeds and people in organizations associated with your Microsoft Entra tenant. Feed scope and feed-level roles don't control that. Promote validated versions to @Release and share only that view, so unvalidated builds in @Local stay hidden from those consumers.

Source: Feed scopes: Project vs organization feeds; Manage permissions

How do SemVer ranges and CalVer versions behave in NuGet and Dependabot?

SemVer MAJOR.MINOR.PATCH signals breaking changes in the major segment, so a dependency range should stop below the next major version. In NuGet range notation [ is inclusive and ( is exclusive: [4.1.3,5.0) means 4.1.3 ≤ x < 5.0, which keeps a required fix as the floor. A floating 4.* accepts any 4.x.y, including versions older than the fix. NuGet normalizes versions by removing leading zeros, so 2026.03.07 becomes 2026.3.7. Dependabot reads every x.y.z as major.minor.patch and has no CalVer mode. A year change such as 2026.11.0 to 2027.1.0 is therefore a semver-major update and is dropped by an ignore rule with update-types: ["version-update:semver-major"], while month changes still arrive as minor updates. Calendar-versioned dependencies need their own ignore rules.

Source: NuGet Package Version Reference; Dependabot options reference

How do I generate unique build versions in Azure Pipelines?

The run number comes from the top-level name:; the default is $(Date:yyyyMMdd).$(Rev:r). $(Rev:r) rises by one per completed run and resets to 1 when any other part of the number changes, such as the date or a version prefix: after 1.0.3, changing the format to 1.1.$(Rev:r) gives 1.1.1. If the run number becomes a NuGet version, use $(Month) and $(DayOfMonth), which have no leading zeros, and avoid MM, dd and $(Rev:rr), because NuGet strips leading zeros and the package version would no longer match the run. For semantic versions, counter(prefix, seed) keeps a separate sequence for each prefix value. A new prefix starts at the seed, and when an earlier prefix comes back its sequence resumes where it stopped instead of restarting.

Source: Run and build numbers; Expressions

Where should build outputs be stored between jobs and for other teams?

In Azure Pipelines, pipeline artifacts pass build outputs between jobs and stages of a run and are exempt from Azure Artifacts storage billing. Use Universal Packages in a feed only for versioned deliverables that other teams consume, because every retained version counts toward billed storage, and promoted versions are exempt from feed retention policies. In GitHub Actions, artifacts uploaded with actions/upload-artifact@v4 are immutable, so two jobs in one run can't upload the same name; matrix jobs put the matrix value in the artifact name. retention-days sets a shorter lifetime per artifact but can't exceed the limit set by the repository, organization or enterprise.

Source: Publish and download pipeline artifacts; Store and share data with workflow artifacts

Traps in 3.1 questions

  • GitHub Packages looks like the natural choice for a GitHub shop, but it has no Python or Cargo registry and doesn't cache public registries; that need points to Azure Artifacts upstream sources.
  • Feed views don't change upstream search order, and a feed-level role doesn't enable cross-organization upstreams; only sharing the view with the Entra tenant does.
  • Feed Reader looks like least privilege for a pipeline, but it can't save packages from upstreams; Feed and Upstream Reader (Collaborator) is the minimum.
  • Zero-padded run numbers (MM, dd, Rev:rr) look tidy but NuGet normalizes them, so the package version stops matching the run number.

12 questions in the bank test task 3.1. Practice Domain 3

3.2 Design and implement a testing strategy for Azure DevOps pipelines and GitHub Actions

Task 3.2 covers gates that stop a bad build from shipping, the testing pyramid, running and publishing tests, and coverage enforcement, now with Copilot code review, Copilot cloud agent and MCP servers in the loop. Most questions turn on where a gate is defined (YAML, protected resource or ruleset) and which exact setting makes it blocking rather than advisory.

  • 3.2.1Design quality and release gates 3 questions
  • 3.2.2Implement quality and release gates by using GitHub Copilot and MCP servers Now with AI tools4 questions
  • 3.2.3Design a comprehensive testing strategy, including local tests, unit tests, integration tests, and load tests 3 questions
  • 3.2.4Implement tests in a pipeline, including configuring test tasks, configuring test agents, and documenting test results, by using GitHub Copilot and MCP servers Now with AI tools4 questions
  • 3.2.5Implement code coverage analysis by using GitHub Copilot and MCP servers Now with AI tools4 questions

Where do quality and release gates live, and in what order do Azure Pipelines checks run?

In Azure Pipelines, approvals and checks are configured on protected resources such as environments and service connections by the resource owner, not in YAML, so pipeline authors can't remove them. A task in YAML can be deleted by anyone who edits the file. Checks run by category: static checks (Branch control, Required template, Evaluate artifact), pre-check approvals, dynamic checks (Approval, Invoke Azure Function, Invoke REST API, Business Hours, Query Azure Monitor alerts), post-check approvals, and Exclusive lock last. A failing Branch control check fails the stage before anyone is asked to approve. Query Azure Monitor alerts passes only if no alert rule is active at evaluation and is retried until it passes or times out. GitHub environments provide required reviewers (up to six users or teams, one approval is enough), wait timers and deployment branch rules. On Free, Pro and Team plans, required reviewers and wait timers work only in public repositories.

Source: Define approvals and checks; Deployments and environments

How do I make Copilot code review and Copilot cloud agent part of the merge gate?

Automatic review comes from the Automatically request Copilot code review rule in a branch ruleset; one organization ruleset can cover many repositories. Review new pushes reviews every later push and Review draft pull requests covers drafts; a user's personal settings can't turn off what a ruleset enables. CODEOWNERS isn't one of the documented triggers for automatic Copilot review. Under Auto-approval, Allow Copilot to approve pull requests lets Copilot submit approving reviews, and Allow Copilot approvals to count toward merge requirements lets those approvals satisfy required reviews. The File paths list (up to 15 globs) restricts counting to pull requests where every changed file matches; blank means all files. By default, workflows don't run automatically on Copilot cloud agent pushes. To run CI without approving each run, an admin turns off Require approval for workflow runs in the cloud agent settings.

Source: Configuring code review by GitHub Copilot; Configuring settings for GitHub Copilot in the cloud

Can an AI agent scan for secrets before code reaches a pull request?

Yes, through the GitHub MCP server, with three limits. Secret scanning tools are available only from the remote GitHub MCP server, not from a local configuration. You must enable the secret_protection toolset explicitly because it isn't in the default toolsets, and the run_secret_scanning tool currently belongs to the copilot toolset. Findings from an MCP scan are ephemeral: they appear only in the agent's session and are never written as secret scanning alerts, so they don't show in the Security tab or the alerts APIs. Repository secret scanning and push protection remain the system of record and the actual gate; the MCP scan is an early check inside the agent loop.

Source: Scanning for secrets with the GitHub MCP server

How do unit, integration and load tests fit into one testing strategy?

Microsoft's shift-left taxonomy sorts tests by dependencies. L0 and L1 are unit tests that depend only on the assembly under test, with L0 fast and in memory. L2 functional tests add dependencies such as SQL or the file system. L3 tests run against a testable deployment of the service, and L4 tests are a restricted class of integration tests against production. Developers run tests through L2 before committing; L3 and L4 gate pull requests and deployments. For integration tests in GitHub Actions, the job's services: key creates a fresh Docker container per service and destroys it when the job ends, so each job gets an isolated database; service containers need Linux runners. Azure Load Testing in CI/CD reads fail criteria, such as response time or error percentage, from the YAML test configuration file stored next to the test script. When a criterion is met the test run fails, and the pipeline run takes that status.

Source: Shift testing left with unit tests; Define load test fail criteria

How do I run and publish tests in a pipeline and let an agent read the results through MCP?

A failing test step skips later steps, so put condition: succeededOrFailed() on PublishTestResults@2; the run still fails. continueOnError: true on the test step would mark the run partially succeeded instead. To run VSTest without Visual Studio on the agent, add the Visual Studio Test Platform Installer task and set the VSTest test platform version to Installed by tools installer. For an agent, the remote Azure DevOps MCP Server at https://mcp.dev.azure.com/{organization} needs no install for Entra-backed organizations; its testplan toolset lists plans, suites and cases and returns test results for a build ID. The X-MCP-Toolsets header limits toolsets and X-MCP-Readonly: true removes write tools. On the remote GitHub MCP server each toolset has its own URL, appending /readonly keeps read tools only, and get_job_logs with failed_only and a run_id returns the logs of every failed job.

Source: PublishTestResults@2 - Publish Test Results v2 task; Set up the remote Azure DevOps MCP Server

How do I enforce code coverage on pull requests in Azure DevOps and GitHub?

Azure Pipelines posts a diff coverage status (changed lines only) when results are published with Publish Code Coverage Results v2; with v1 the policy gets stuck and no comments appear. The default target is 70%, changed in azurepipelines-coverage.yml at the repository root. The status is advisory until a branch policy requires the check named {pipeline name}/codecoverage. In GitHub, the Restrict code coverage ruleset rule (GitHub Code Quality, public preview) blocks by Minimum line coverage percentage or Maximum line coverage drop against the default branch. It evaluates only data already uploaded, so make every coverage-uploading check a required status check. Code Quality accepts Cobertura XML only. Its automatic coverage setup is an AI agent that finds your test framework and opens a pull request with an upload workflow, but it won't convert JaCoCo-only output.

Source: Review and configure code coverage results in Azure Pipelines; Automatic code coverage setup

Traps in 3.2 questions

  • A ManualValidation task or YAML gate looks equivalent to an environment check, but anyone who edits the pipeline can delete it; checks on the protected resource can't be removed from YAML.
  • Approval looks like it should run before Branch control, but static checks run first, so a run from a disallowed branch fails before approvers are asked.
  • Raising the diff coverage target doesn't block merges; the coverage status stays advisory until a branch policy requires it.
  • Copilot approving a pull request isn't enough on its own; Allow Copilot approvals to count toward merge requirements must also be on for the ruleset's approval count.

18 questions in the bank test task 3.2. Practice Domain 3

3.3 Design and implement Azure DevOps pipelines and GitHub Actions

Task 3.3 is the largest task in Domain 3: choosing and hosting the CI/CD engine, connecting Azure Pipelines to GitHub, writing YAML with Copilot, triggers, execution order, reuse, environment checks and the new GitHub Agentic Workflows. Questions hinge on exact keys and defaults, such as a custom condition replacing succeeded() or which runner type supports private networking.

  • 3.3.1Select a deployment automation solution, including Azure Pipelines and GitHub Actions 4 questions
  • 3.3.2Design an Azure DevOps agent or GitHub runner infrastructure, including cost, tool selection, licenses, connectivity, and maintainability 6 questions
  • 3.3.3Implement an Azure DevOps or GitHub runner agent infrastructure 6 questions
  • 3.3.4Design and implement integration between Azure Pipelines and GitHub repositories 5 questions
  • 3.3.5Develop pipelines in YAML by using GitHub Copilot Now with AI tools5 questions
  • 3.3.6Develop and implement pipeline trigger rules 5 questions
  • 3.3.7Design and implement a strategy for job execution order, including parallelism and multi-stage pipelines 5 questions
  • 3.3.8Create reusable pipeline elements, including YAML templates, task groups, variables, and variable groups 5 questions
  • 3.3.9Design and implement checks and approvals by using YAML-based environments 4 questions
  • 3.3.10Design and implement GitHub Agentic Workflows New in AZ-4019 questions

When is Azure Pipelines the right choice, and how should it connect to GitHub repositories?

TFVC forces Azure Pipelines classic: YAML pipelines and repository resources support Git providers only. To move to Actions, GitHub Actions Importer offers audit (organization-wide audit_summary.md, local files only), forecast (usage from past runs), dry-run (one converted workflow) and migrate (opens a pull request). Service connections and pre-deployment approvals are manual; gates are unsupported. When Azure Pipelines builds GitHub code, use the Azure Pipelines GitHub App: it runs under the Azure Pipelines identity and is the only authentication type that posts GitHub Checks. A pipeline appears as a required status check only with the app and after a run in the past week; OAuth and PAT act as a person. Securely build pull requests from forked repositories, set at organization level, withholds secrets and requires a /azp run comment from a collaborator with Write permission. It's on by default only for organizations created from September 2023.

Source: Migrating from Azure DevOps with GitHub Actions Importer; Build GitHub repositories

Which agent or runner hosting fits our cost, network and maintenance requirements?

A private Azure DevOps project gets one free Microsoft-hosted job (60 minutes per run, 1,800 minutes a month); buying the first parallel job only lifts the limits (paid jobs run up to 360 minutes), so two concurrent jobs need two purchased jobs. Microsoft-hosted agents and GitHub-hosted agents for Azure Pipelines (per-minute, no free tier) can't reach a network over VPN or ExpressRoute. Managed DevOps Pools inject agents into your virtual network: delegate the subnet to Microsoft.DevOpsInfrastructure/pools, give the DevOpsInfrastructure principal Reader and Network Contributor, keep pool and network in one region. One pool serves several organizations and images, and the default is stateless (Fresh agent every time); stateful agents are reused up to seven days. Scale set agents need overprovisioning disabled and a manual upgrade policy. GitHub larger runners are billed even in public repositories and are the only runners with Azure private networking; Actions Runner Controller runs ephemeral Kubernetes runners per job.

Source: Compare Managed DevOps Pools with Azure Virtual Machine Scale Set agents; Configure networking

How do I get Copilot to write pipeline YAML I can trust?

Name the solution, SDK configuration, test projects and approved templates explicitly, and ask Copilot to list missing information instead of inventing paths or commands; an open editor doesn't give it every requirement. Scope pipeline rules with path-specific instruction files: .github/instructions/*.instructions.md with an applyTo glob in the frontmatter. On GitHub.com both Copilot cloud agent and Copilot code review use them for matching files; excludeAgent: "code-review" or "cloud-agent" removes one. Review generated YAML for logic, not only syntax: a custom stage condition replaces the default succeeded(), so a branch-only condition publishes even after tests fail. Write and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')). When converting, step templates map to composite actions and job-level reuse to reusable workflows. For a failed run, Explain error beside the failed check or on the run summary opens Copilot Chat with the failure context.

Source: Adding repository custom instructions for GitHub Copilot; Generate build pipelines and publish accepted outputs with Copilot

How do triggers, dependencies and concurrency control what runs and when?

Azure Repos Git ignores the YAML pr: section; PR validation is a Build validation branch policy. batch: true folds pushes made during a run into one next run, and path filters can't use variables. Cron schedules are in UTC and skip days with no changes unless always: true. A resources.pipelines trigger starts a pipeline when another completes; it can't be defined in a template. In Actions, workflow_run fires whatever the conclusion, so test github.event.workflow_run.conclusion == 'success'. Stages run in file order; dependsOn: [] starts a stage at once. Read an output (isOutput=true) from an earlier stage with stageDependencies.<stage>.<job>.outputs['<step>.<var>']. Matrix fail-fast defaults to true; max-parallel caps legs. A concurrency group runs one job at a time and keeps one pending; queue: max holds up to 100 and can't be combined with cancel-in-progress: true.

Source: Configure pipeline triggers; Control the concurrency of workflows and jobs

Template, task group or variable group, and where do approvals belong?

Task groups exist only in classic pipelines; YAML uses templates. A step template with typed parameters in a shared repository, referenced as template: file@repo, is changed in one place. Parameters restricted with values: are validated at template expansion, so a bad value fails the run before any job starts. An extends template fixes the pipeline structure, and the Required template check on a resource fails runs that don't extend it; an include template enforces nothing. A Key Vault-linked variable group refreshes mapped secrets each run but adds new vault secrets only when you map them. In Actions, a composite action runs inside the caller's job; a reusable workflow runs as its own job. Put approvals on a YAML environment, not in a task. Exclusive lock with lockBehavior: sequential deploys every waiting run in turn; the default runLatest deploys only the newest. GitHub environments can prevent self-review.

Source: How to use YAML templates for reusable and secure pipelines; Define approvals and checks

What is a GitHub Agentic Workflow and how is it kept safe?

An agentic workflow is a markdown file in .github/workflows/: YAML frontmatter (on, permissions, safe-outputs, engine, network, tools) plus natural-language instructions. gh aw compile generates the .lock.yml that Actions runs; after a frontmatter change, recompile and commit both files. The agent job is read-only. Writes such as create-issue or add-comment are requested as safe outputs and applied by a separate job with scoped write permission; staged: true previews them in the step summary. copilot is the default engine; in organization repositories copilot-requests: write bills Copilot to the organization without a PAT, once an admin allows organization-billed Copilot CLI usage. network: defaults allows only basic infrastructure, so add ecosystems such as python. on.roles is exact-match, default [admin, maintainer, write], and on.manual-approval waits on an environment. Builds and multi-stage deployments stay in standard Actions.

Source: Creating GitHub Agentic Workflows; GitHub Agentic Workflows (github/gh-aw)

Traps in 3.3 questions

  • Adding a branch filter as a stage condition looks harmless, but it replaces the default succeeded(), so the stage runs even after a failed build unless you wrap it in and(succeeded(), ...).
  • The pr: section looks like the way to validate pull requests in Azure Repos Git, but it's ignored there; only a Build validation branch policy queues PR builds.
  • OAuth and PAT connections build GitHub repositories, but only the Azure Pipelines GitHub App posts GitHub Checks and lets the pipeline be picked as a required status check.
  • Editing the .lock.yml of an agentic workflow looks faster, but the compiler overwrites it; change the markdown frontmatter and run gh aw compile.

54 questions in the bank test task 3.3. Practice Domain 3

3.4 Design and implement deployments

Task 3.4 covers how a release reaches production: exposure strategies, ordering of dependent deployments, zero-downtime mechanics, the hotfix path, automatic halting and rollback, and the deployment tasks for containers and databases. Most questions hinge on picking the one built-in feature that meets a constraint such as no redeployment, no custom code or a Linux app.

  • 3.4.1Design a deployment strategy, including blue-green, canary, ring, progressive exposure, feature flags, and A/B testing 2 questions
  • 3.4.2Design a pipeline to ensure that dependency deployments are reliably ordered 2 questions
  • 3.4.3Plan for minimizing downtime during deployments by using load balancing, deployment slot usage and swap, and rolling deployments 3 questions
  • 3.4.4Design a hotfix path plan for responding to high-priority code fixes 2 questions
  • 3.4.5Design and implement a resiliency strategy for deployment 3 questions
  • 3.4.6Implement deployment by using containers, binaries, scripts, and database tasks 2 questions

Which App Configuration feature flag do I use for a percentage rollout, and which for an A/B test?

A feature flag with the built-in targeting filter combines included users and groups, excluded users and groups, and a default percentage for everyone else. Exclusions win over inclusions and percentages, so one group can stay off while QA is always on, and raising the percentage is a change in App Configuration, not a redeployment. A time window filter only switches a flag on for everyone during a period. For an A/B test use a variant feature flag (the Experiment scenario): each variant carries its own configuration value and a percentile allocation, assignment is deterministic per user, and both designs ship in one build. With telemetry enabled, the flag shows evaluation counts and variant distribution, and the metric scorecard compares metrics between variants. A Rollout flag only exposes a feature to a percentage of users and has no variants to compare. Slot traffic routing and Front Door weighting need two deployed builds and give no per-user variant results.

Source: Roll out features to targeted audiences; Use variant feature flags

What do the runOnce, rolling and canary strategies of a deployment job do?

A deployment job targets an environment and records deployment history against it. runOnce runs the preDeploy, deploy, routeTraffic and postRouteTraffic hooks once, then on: success or on: failure; on: failure is the documented place for rollback steps. rolling works only with virtual machine resources: maxParallel (a number or x%) sets how many VMs update per iteration while the rest keep serving. canary runs preDeploy once, then repeats the other hooks for each value in increments. With KubernetesManifest@1, the default canary split is by replica count, so the percentage is approximate; trafficSplitMethod: smi splits per request through SMI TrafficSplit objects, with replicas set by baselineAndCanaryReplicas. $(strategy.action) passes deploy, promote or reject to the task; promote finalizes the canary by replacing the stable workload.
strategy:
  canary:
    increments: [10, 20]
    deploy:
      steps:
      - task: KubernetesManifest@1
        inputs:
          action: $(strategy.action)
          strategy: $(strategy.name)
          percentage: $(strategy.increment)

Source: Deployment jobs; KubernetesManifest@1 - Deploy to Kubernetes v1 task

How do App Service deployment slots and scale set upgrades avoid downtime?

Deployment slots need the Standard, Premium or Isolated tier; Standard allows five. In a swap, App Service applies the target slot's settings to the source instances, restarts and warms them up, and only then switches routing rules, so production stays online even if the swap fails. App settings and connection strings move with the content unless marked Deployment slot setting. Custom domains, nonpublic certificates, scale settings, managed identities and virtual network integration never swap. WEBSITE_SWAP_WARMUP_PING_PATH and WEBSITE_SWAP_WARMUP_PING_STATUSES define the warm-up request and stop the swap on an unlisted status code; WEBSITE_WARMUP_PATH fires on every restart instead. Swapping again restores the last known good app. Auto swap isn't supported on Linux or Web App for Containers. For Virtual Machine Scale Sets, the Rolling upgrade policy updates instances in batches with unhealthy-instance limits; Automatic mode may take every instance down at once, and Flexible orchestration needs the Application Health extension for rolling upgrades.

Source: Set up staging environments in Azure App Service; Upgrade policy modes for Virtual Machine Scale Sets

How do I make dependent deployments run in a fixed order?

Inside one Azure Pipelines run, order comes from dependsOn: a stage starts only after every stage it lists has completed and, by default, succeeded. Stages without dependsOn run one after another in file order, and dependsOn: [] removes all dependencies so the stage starts immediately. To run a database stage before the API while documentation still deploys in parallel, make DeployApi depend on DeployDb and let DeployDocs depend only on Build. An exclusive lock check serializes separate runs that use the same resource; it doesn't order stages inside a run. In GitHub Actions, a concurrency group allows one running and one pending run, and a newly queued run cancels the pending one. queue: max lets up to 100 runs wait and processes them one at a time in the order they started waiting. It can't be combined with cancel-in-progress: true; that combination fails workflow validation.

Source: Stages in Azure Pipelines; Control the concurrency of workflows and jobs

What is the hotfix path in Release Flow, and how does the fix reach a release branch?

In Release Flow, the branching model Microsoft uses for Azure DevOps, every hotfix starts in main: the fix is made on a topic branch, reviewed, merged to main, then cherry-picked into the release branch. Release branches are never merged back into main, so fixing main first guarantees the next release branch already contains the fix. A fix made only on the release branch is easily lost. In Azure Repos, the Cherry-pick action on the completed pull request creates a topic branch from the target you choose, applies all of the pull request's changes on the server and opens a new pull request into that branch, where the release branch's reviewer and build validation policies still apply. A pull request from main into the release branch would carry every change merged since the branch was cut. A completed pull request can't be reactivated or retargeted; only abandoned ones can be reactivated.

Source: How Microsoft develops with DevOps; Copy changes to a branch with cherry-pick

How do I stop a bad rollout automatically and review database changes before they run?

Approvals and checks on an environment are evaluated before a stage runs. Dynamic checks are Approval, Invoke Azure Function, Invoke REST API, Business Hours and Query Azure Monitor alerts. The Azure Monitor check succeeds only when no alert rule is active at evaluation time and is re-evaluated at the configured interval until the timeout, so it gates the next ring or canary step on application health with no code to write. Invoke Azure Function and Invoke REST API work too, but you write and host the logic; Business Hours controls timing, not health. For Azure SQL, SqlAzureDacpacDeployment@1 runs SqlPackage. The Publish action applies the .dacpac; Script writes the incremental Transact-SQL that a publish would execute; DeployReport returns an XML description of the changes; DriftReport lists changes made to a registered database. Publish the script as an artifact and put the Publish stage behind an approval so a DBA reviews the exact statements.

Source: Pipeline deployment approvals; SqlAzureDacpacDeployment@1 - Azure SQL Database deployment v1 task

Traps in 3.4 questions

  • Slot traffic routing (Traffic %) is not a feature flag: it splits requests between two deployed builds, pins a client for one hour by cookie, and can't always include QA or exclude a group.
  • The rolling deployment job strategy is supported only for virtual machine resources; for Kubernetes canaries use the canary strategy with KubernetesManifest@1.
  • A Key Vault reference is just an app setting, so it still swaps with the content; only marking it as a deployment slot setting keeps the value with its slot.
  • An exclusive lock orders separate pipeline runs on one resource, while dependsOn orders stages inside one run; questions about a migration finishing before the API inside one pipeline want dependsOn.

14 questions in the bank test task 3.4. Practice Domain 3

3.5 Design and implement infrastructure as code (IaC)

Task 3.5 tests whether you can choose an IaC and configuration approach that keeps Azure resources, guest OS settings and application configuration matched to code. Questions hinge on deployment modes versus deployment stacks, what-if output, Terraform state storage and drift correction.

  • 3.5.1Recommend a strategy for IaC and configuration management 3 questions
  • 3.5.2Implement a configuration management strategy for application infrastructure 3 questions

How do I delete resources removed from a Bicep file: complete mode or a deployment stack?

Incremental mode is the default and never deletes resources that are missing from the template. Complete mode deletes them, but Microsoft doesn't recommend it and is gradually deprecating it; deletions belong to deployment stacks. A stack (az stack group create, az stack sub create, az stack mg create) manages its resources as a unit. --action-on-unmanage decides what happens to resources dropped from the template: detachAll leaves them in Azure, deleteResources deletes managed resources, and deleteAll also deletes managed resource groups. --deny-settings-mode creates a deny assignment that applies to everyone regardless of RBAC role: denyDelete blocks deletion, denyWriteAndDelete blocks updates and deletion. --deny-settings-excluded-principals exempts up to five Microsoft Entra principals; excluding a group exempts its members, which suits break-glass access. Being Stack Owner lets a user manage the stack, not bypass its deny assignment. Redeploying a template spec in incremental mode still deletes nothing.

Source: Create and deploy Azure deployment stacks in Bicep; Azure Resource Manager deployment modes

Where should Terraform state live when several pipelines run terraform apply?

Use the azurerm backend, which stores state as a blob in an Azure Storage account. The blob is locked automatically before any operation that writes state, so two concurrent applies from Azure Pipelines and GitHub Actions can't corrupt it, and Azure Storage encrypts the data at rest. It needs no extra servers. Pipeline artifacts and a file share on one agent offer no state locking, and Key Vault is not a Terraform backend. Microsoft also suggests prevent_destroy = true in the lifecycle block of the storage account resource to avoid deleting the state account by accident.
terraform {
  backend "azurerm" {
    resource_group_name  = "tfstate"
    storage_account_name = "<storage_account_name>"
    container_name       = "tfstate"
    key                  = "terraform.tfstate"
  }
}

Source: Store Terraform state in Azure Storage

How do I check a Bicep change in a pipeline before it deploys, and why do portal edits get reverted?

az deployment group what-if predicts changes. By default it prints a text summary; --no-pretty-print returns JSON a script can inspect. Each resource gets a change type: Create, Delete (only in complete mode), Ignore, NoChange, Modify, Deploy (not enough information to decide) or NoEffect. The default result format, FullResourcePayloads, includes property-level details; ResourceIdOnly lists only resource IDs. --confirm-with-what-if (-c) on az deployment group create prompts a person, so it doesn't suit an unattended gate. Redeploying in incremental mode reapplies every property of a resource; properties the template doesn't specify are reset to their defaults, not left as edited in the portal. Declare settings such as httpsOnly in the Bicep file so each redeployment is idempotent and drift is removed on the next run.

Source: Bicep deployment what-if operation; Azure Resource Manager deployment modes

How do I manage OS settings inside VMs and application configuration as code?

Azure Machine Configuration audits or configures operating system settings on Azure VMs and Arc-enabled servers, assigned at scale through Azure Policy. Its Apply and Autocorrect mode applies the configuration and corrects drift; Apply and Monitor applies once and only reports later drift; Audit only reports. The Azure Policy Modify effect changes Resource Manager properties and tags and can't reach registry values inside the guest. A Custom Script Extension runs once and reports no compliance. For application settings, an Azure App Configuration snapshot is a named, immutable set of key-values selected by key and label filters when it is created. A release that reads a snapshot can't be changed ad hoc, and rollback means pointing the app at the previous snapshot name. Labeled key-values stay editable, and a replica copies the same values, including a bad edit, so neither gives versioned rollback.

Source: What is Azure Machine Configuration?; Snapshots in Azure App Configuration

Traps in 3.5 questions

  • Complete mode does delete resources missing from the template, but the expected answer for deletions is a deployment stack because complete mode is not recommended and is being deprecated.
  • denyDelete still allows updates; only denyWriteAndDelete blocks both, and Stack Owner does not exempt anyone from the deny assignment.
  • --confirm-with-what-if prompts a human; --no-pretty-print is the switch that makes what-if output machine-readable.
  • Apply and Monitor reports drift but never fixes it; only Apply and Autocorrect brings a machine back into conformance.

6 questions in the bank test task 3.5. Practice Domain 3

3.6 Maintain Azure DevOps pipelines and GitHub Actions

Task 3.6 is about running pipelines over time: measuring pass rate, duration and flaky tests, cutting run time and agent effort, and keeping runs, artifacts and packages only as long as needed. Questions hinge on which built-in report or setting does the job and on exact retention rules.

  • 3.6.1Monitor pipeline health, including failure rate, duration, and flaky tests 2 questions
  • 3.6.2Optimize a pipeline for cost, time, performance, and reliability 3 questions
  • 3.6.3Design and implement a retention strategy for pipeline artifacts and dependencies 3 questions

Where do I see pipeline failure rate and duration trends in Azure Pipelines and GitHub Actions?

In Azure Pipelines, a pipeline's Analytics tab shows pass rate and duration cards that open three reports. The Pipeline pass rate report has a summary, a failure trend per day split by stage, and the top failing tasks with links to their failed runs. The Pipeline duration report shows the duration trend and the top tasks by duration. The Test failures report lists the top failing tests. All three default to the last 14 days and filter by date range and branch. In GitHub, Actions performance metrics on the organization's Insights tab show average run time, queue time and failure rate by workflow, job, repository, runner type and OS. Owners can grant access through a custom organization role with the View organization Actions metrics permission instead of making someone an owner. Actions usage metrics report minutes consumed, not failure rates.

Source: Pipeline reports; Viewing GitHub Actions metrics for your organization

How does Azure Pipelines detect flaky tests and keep them from failing builds?

Turn on flaky test management in Project settings > Test management (Pipelines section); it exists only in Azure DevOps Services. System detection marks a test flaky when it fails and then passes on a rerun in the same pipeline execution, which relies on the VSTest task rerunning failed tests. Custom detection lets an external system report flakiness through the Result Meta Data - Update REST API. Once a test is flaky, that state applies to all pipelines for the branch. Under Flaky test options, clearing the option to include flaky tests in the Test Summary keeps their failures from failing the pipeline, while results and the Flaky tag stay visible. The Test Summary honors this only for the Visual Studio Test and Publish Test Results tasks. Marking or unmarking a test manually takes effect on future runs, not the current one. continueOnError would hide real regressions too.

Source: Manage flaky tests

Which settings cut checkout and dependency-restore time in Azure Pipelines?

Cache@2 restores files by key, usually built from a static string, $(Agent.OS) and a lock file hash. On a miss, restoreKeys matches by prefix and restores the most recently created entry, so a changed lock file still starts warm. Caches are immutable; a new one is saved under the exact key at the end of the job. Caches are scoped per pipeline and branch, pull request runs can read the target branch cache but not write to it, and caches expire after seven days without use. cacheHitVar only reports whether a restore happened. Pipeline artifacts share outputs between jobs; they aren't a cache. For large repositories, fetchDepth: 1 fetches only the commit being built and sparseCheckoutDirectories writes only the listed folders; fetchDepth: 0 fetches full history.
- checkout: self
  fetchDepth: 1
- task: Cache@2
  inputs:
    key: '"yarn" | "$(Agent.OS)" | yarn.lock'
    restoreKeys: |
      "yarn" | "$(Agent.OS)"
    path: $(YARN_CACHE_FOLDER)

Source: Pipeline caching; steps.checkout definition

When should I choose Managed DevOps Pools over Microsoft-hosted or scale set agents?

Managed DevOps Pools is the fully managed evolution of Virtual Machine Scale Sets agent pools; the VMs or containers run in a Microsoft subscription, so you configure the pool instead of maintaining scale sets. It scales up and down based on your configuration, runs your own image or the Microsoft-hosted image software, can join your network to reach private endpoints, can keep agent state for up to seven days for cache hits, supports jobs up to two days long, and can attach a data disk instead of a larger VM size. It can also fetch certificates from Key Vault during provisioning through a managed identity on the pool. Microsoft-hosted agents can't reach resources behind a private endpoint. Scale set agent pools also run in your network, but you build and maintain more of the infrastructure. When a question asks for private network access with the least administration, the answer is Managed DevOps Pools.

Source: Managed DevOps Pools overview

How long does Azure Pipelines keep runs, and how do I keep production runs longer?

Run retention is set only at project level in Project settings > Pipelines > Settings; per-pipeline retention rules are no longer supported. You set days to keep artifacts, symbols and attachments, days to keep runs, days to keep pull request runs, and the number of recent runs to keep per pipeline. For Azure Repos, that number applies to the default branch, to each protected branch (any branch with branch policies) and to the pipeline overall; only succeeded and partially succeeded runs count. A run is deleted when it exceeds the days, isn't among the recent runs, isn't retained indefinitely and isn't retained by a release; policies run once a day. Deletion removes logs, artifacts, symbols, test results and Git tags, but never Azure Artifacts packages. To keep production runs longer, add a retention lease through the Lease API from a pipeline step using the run ID and definition ID variables; a pipeline consumed as a resource is kept while the consuming run is kept.

Source: Retention policies for Azure Pipelines

How do I set retention for GitHub Actions artifacts and Azure Artifacts packages?

GitHub keeps workflow artifacts and logs for 90 days by default. An organization can set 1 to 90 days for public repositories and 1 to 400 days for private ones under Settings > Actions > General. Since October 1, 2026 the same period also applies to checks, workflow runs and commit statuses. A new value applies only to objects created afterward. The retention-days input of actions/upload-artifact shortens one artifact's lifetime but can't exceed the configured limit. In an Azure Artifacts feed, a Feed Owner enables package retention with Maximum number of versions per package and Days to keep recently downloaded packages; a version is deleted only when both conditions are met. Versions promoted to a view are exempt, and promotion can't be undone. Deleted packages sit in the Recycle Bin for 30 days and still count toward storage. Unlisting only hides a version, and pipeline run retention never deletes packages.

Source: Configuring the retention period for checks, workflow runs, commit statuses, artifacts, and logs in your organization; Delete and recover packages

Traps in 3.6 questions

  • Usage metrics show Actions minutes consumed; failure rate and queue time are in Actions performance metrics, which a custom organization role can grant without owner rights.
  • cacheHitVar does not create a fallback; restoreKeys is what restores the newest cache by prefix when the exact key misses.
  • Azure Pipelines run retention never governs NuGet, npm or Universal packages; feed retention policies and views do.
  • Per-pipeline retention rules are gone; a question that needs only production runs kept longer wants a retention lease, not a longer project-wide retention period.

8 questions in the bank test task 3.6. Practice Domain 3

Azure Pipelines environment page with the Approvals and checks tab and the add check button highlighted
Approvals and checks on an Azure Pipelines environment: approvals, branch control, business hours. Source: Microsoft Learn (CC BY 4.0).

Free Domain 3 questions

Question 1, Domain 3, skill 3.3.10 New in AZ-401

A repository uses GitHub Agentic Workflows. An engineer edits the YAML frontmatter of .github/workflows/issue-triage.md to add the add-labels safe output, pushes only that file, and finds that the next run still cannot apply labels. You need the change to take effect. Which two actions should you perform? Each correct answer presents part of the solution. (Choose TWO.)

Choose TWO.

  1. Edit issue-triage.lock.yml manually to add a job that applies the labels.
  2. Run gh aw compile issue-triage to regenerate the compiled workflow.
  3. Run gh aw run issue-triage so the runner reloads the markdown source.
  4. Add issues: write to the frontmatter permissions for the agent job.
  5. Commit the regenerated issue-triage.lock.yml together with the .md file.
Show answer and explanation

Answer: B and E. GitHub Actions executes the compiled .lock.yml, not the markdown source. Frontmatter changes such as safe-outputs require gh aw compile to regenerate the lock file, and both the .md and .lock.yml files must be committed and pushed.

Why the other options are wrong:

  • A. The lock file is generated by the compiler; manual edits drift from the source and are overwritten on the next compile.
  • C. gh aw run only triggers the existing compiled workflow; it doesn't apply frontmatter changes.
  • D. Writes are applied by the separate safe-outputs job; giving the agent job write access breaks the read-only design and still leaves the lock file stale.

Documentation: Creating GitHub Agentic Workflows; GitHub Agentic Workflows (github/gh-aw)

Question 2, Domain 3, skill 3.1.1

Contoso, Ltd. hosts all source code in GitHub Enterprise Cloud and builds with GitHub Actions. The data platform team publishes internal Python libraries and Rust crates, and developers install them together with open-source dependencies from PyPI and crates.io. Security requires that every public package a build consumes is cached in a company-controlled store so that builds keep working when a public registry is unavailable. You need to recommend a package management solution. What should you recommend?

  1. GitHub Packages, with a package registry linked to each library repository
  2. An Azure Artifacts feed with upstream sources enabled for PyPI and crates.io
  3. Azure Artifacts Universal Packages, with one Universal Package per library release
  4. The organization's linked artifacts page in GitHub, pointing at an external package store
Show answer and explanation

Answer: B. Azure Artifacts feeds host Python and Cargo packages, and upstream sources for PyPI and crates.io automatically save every public package that a collaborator or build installs, so restores keep working when the public registry is down. GitHub Packages offers registries for npm, RubyGems, Maven, Gradle, NuGet, and containers only, so it can't host the Python or Cargo packages at all.

Why the other options are wrong:

  • A. GitHub Packages has no Python or Cargo registry and doesn't cache packages from public registries.
  • C. Universal Packages store arbitrary files, but pip and cargo can't install from them and they don't cache PyPI or crates.io.
  • D. The linked artifacts page stores only metadata about artifacts; it doesn't host package files or cache public packages.

Documentation: What are upstream sources?; Introduction to GitHub Packages

Question 3, Domain 3, skill 3.1.2

Contoso has an Azure Artifacts feed named Platform with two upstream sources, listed in this order: npmjs.com, then an internal feed view named Hardened@Release. The security team rebuilds a few open-source npm packages with patches, publishes them to Hardened by using the same package names and versions as the public originals, and promotes them to its @Release view. None of these packages have been installed through Platform yet. You need builds that restore from Platform to receive the rebuilt versions. What should you do?

  1. Move the Hardened@Release upstream source above npmjs.com in the feed settings
  2. Add the Hardened feed as an additional registry entry in each project's .npmrc file
  3. Promote the rebuilt packages to the @Release view of the Platform feed
  4. Change the default view of the Platform feed from @Local to @Release
Show answer and explanation

Answer: A. A feed resolves packages in a fixed order: packages published to the feed, then packages already saved from upstreams, then each upstream source in the order configured. Microsoft recommends placing the source that contains customized open-source packages before public registries, so the rebuilt versions win.

Why the other options are wrong:

  • B. Referencing several feeds in a client configuration file makes restores nondeterministic; the guidance is one feed with upstream sources.
  • C. The rebuilt packages live in Hardened, not in Platform, and views don't change upstream search order.
  • D. The default view controls what consumers of Platform see; it doesn't change the order in which upstream sources are searched.

Documentation: What are upstream sources?

Question 4, Domain 3, skill 3.1.3

A .NET service depends on the Fabrikam.Messaging NuGet package, which follows Semantic Versioning. Version 4.1.3 fixed a message-loss bug, and the service must never restore an earlier version. The vendor has announced breaking changes in version 5.0. You need to set the Version attribute of the PackageReference so that restore accepts 4.1.3 and any later compatible release, but never 5.0 or later. Which value should you use?

  1. (4.1.3,5.0)
  2. [4.1.3,5.0]
  3. [4.1.3,5.0)
  4. 4.*
Show answer and explanation

Answer: C. In NuGet range notation, a square bracket is inclusive and a parenthesis is exclusive, so [4.1.3,5.0) means 4.1.3 ≤ x < 5.0. That keeps the bug-fixed release as the floor and stops at the next major version, which is where SemVer signals breaking changes.

Why the other options are wrong:

  • A. The leading parenthesis makes 4.1.3 itself unacceptable, so the bug-fixed release would be excluded.
  • B. The closing square bracket includes 5.0, which contains the announced breaking changes.
  • D. A floating 4.* range accepts any 4.x.y version, including releases earlier than 4.1.3 that lack the fix.

Documentation: NuGet Package Version Reference

Question 5, Domain 3, skill 3.1.4

A YAML pipeline versions its build artifacts by using the variables shown. The pipeline ran six times with minor set to 4. A developer then changed minor to 5, and the pipeline ran twice. The change was reverted to minor: 4 in the next commit. What is the value of patch in the first run after the revert?

variables:
  major: 2
  minor: 4
  patch: $[counter(format('{0}.{1}', variables['major'], variables['minor']), 0)]

steps:
- script: dotnet pack -c Release -p:Version=$(major).$(minor).$(patch)
  1. 0
  2. 2
  3. 6
  4. 8
Show answer and explanation

Answer: C. The counter function keeps a separate value for each unique prefix. The prefix 2.4 produced 0 through 5 in the first six runs, and the prefix 2.5 started its own sequence at the seed. When minor returns to 4, the counter resumes where the 2.4 prefix left off, so the next value is 6.

Why the other options are wrong:

  • A. The counter returns the seed only for a prefix it hasn't seen before; the prefix 2.4 was already used.
  • B. 2 would be the next value for the prefix 2.5, which has its own sequence.
  • D. Counters aren't shared across prefixes, so the two runs with minor set to 5 don't advance the 2.4 counter.

Documentation: Expressions

Question 6, Domain 3, skill 3.2.1

Contoso deploys a web app by using a multi-stage YAML pipeline in Azure Pipelines. After the canary stage, the production stage must start only if no Azure Monitor alert rules for the app are firing. Developers can edit the pipeline YAML, but the operations team must enforce this rule without relying on developers to keep a step in the YAML file. What should you configure?

  1. An AzureMonitor@1 task in an agentless job at the start of the production stage
  2. A Query Azure Monitor alerts check on the environment that the production stage targets
  3. A ManualValidation@0 task that asks operators to confirm that no alerts are active
  4. A pre-deployment gate in a classic release pipeline that queries Azure Monitor alerts
Show answer and explanation

Answer: B. Checks are defined on protected resources such as environments by the resource owner, not in the YAML file, so pipeline authors can't remove them. The Query Azure Monitor alerts check succeeds only if no alert rules are activated at the time of evaluation and is reevaluated until it passes or times out.

Why the other options are wrong:

  • A. A task in the YAML file can be removed or changed by anyone who edits the pipeline.
  • C. A manual confirmation isn't an automated gate and still lives in the YAML that developers can edit.
  • D. Classic release gates require moving the deployment out of the existing YAML pipeline into a classic release pipeline.

Documentation: Define approvals and checks

Question 7, Domain 3, skill 3.2.2 Now with AI tools

Contoso uses GitHub Enterprise Cloud with Enterprise Managed Users and has 120 repositories in one organization. All members have Copilot Business licenses. As a quality gate, every pull request that targets a default branch must receive a Copilot code review automatically, and Copilot must review the pull request again whenever new commits are pushed. You need to meet the requirement with the least administrative effort. What should you do?

  1. Ask each developer to turn on Automatic Copilot code review in their personal Copilot settings
  2. Create an organization ruleset with the Copilot code review rule and Review new pushes selected
  3. Add a workflow to every repository that calls request_copilot_review through the GitHub MCP server
  4. Add a CODEOWNERS file to every repository that names Copilot as the owner of all paths
Show answer and explanation

Answer: B. An organization branch ruleset can target many repositories at once and include the Automatically request Copilot code review rule; selecting Review new pushes makes Copilot review each new push, not just the first one. This is one configuration object for all 120 repositories.

Why the other options are wrong:

  • A. Automatic review in personal settings isn't available for managed user accounts and depends on every developer opting in.
  • C. A workflow per repository must be created and maintained 120 times and needs a token, which is more administrative effort.
  • D. Rulesets and Copilot settings are the documented ways to trigger automatic Copilot reviews; CODEOWNERS isn't one of them.

Documentation: Configuring code review by GitHub Copilot

Question 8, Domain 3, skill 3.2.4 Now with AI tools

A YAML pipeline runs pytest and publishes the results as shown. When all tests pass, the results appear on the Tests tab. When any test fails, the Tests tab is empty, so developers can't see which test failed. The run must still be marked as failed when a test fails. What should you change?

steps:
- script: python -m pytest tests --junitxml=$(Build.ArtifactStagingDirectory)/TEST-results.xml
  displayName: Run tests
- task: PublishTestResults@2
  inputs:
    testResultsFormat: JUnit
    testResultsFiles: '**/TEST-*.xml'
    searchFolder: $(Build.ArtifactStagingDirectory)
  1. Add continueOnError: true to the Run tests step so that later steps keep running
  2. Set failTaskOnMissingResultsFile: true on the PublishTestResults@2 task
  3. Set mergeTestResults: true on the PublishTestResults@2 task
  4. Add condition: succeededOrFailed() to the PublishTestResults@2 task
Show answer and explanation

Answer: D. When pytest returns a non-zero exit code, the step fails and later steps are skipped under the default condition, so the results file is never published. The succeededOrFailed() condition runs the publish step even after a previous failure, while the failed test step still makes the run fail.

Why the other options are wrong:

  • A. continueOnError makes the run partially succeeded instead of failed, which breaks the requirement.
  • B. The task is skipped after the test failure, so a setting on the task never takes effect.
  • C. Merging affects how several result files are grouped into test runs, not whether the task runs after a failure.

Documentation: PublishTestResults@2 - Publish Test Results v2 task; Expressions

Question 9, Domain 3, skill 3.2.5 Now with AI tools

Contoso builds a service in Azure Repos with a YAML pipeline named web-ci, which publishes Cobertura coverage by using PublishCodeCoverageResults@2. The repository root contains the azurepipelines-coverage.yml file shown. Pull requests show a failed coverage status, but developers can still complete them. You need to block pull request completion when diff coverage is below the target. What should you do?

coverage:
  status:
    comments: on
    diff:
      target: 80%
  1. Set failIfCoverageEmpty to true on the PublishCodeCoverageResults@2 task
  2. Raise the diff target in azurepipelines-coverage.yml so that the coverage status check is stricter
  3. Switch to PublishCodeCoverageResults@1 so that low coverage fails the build validation run
  4. Add a branch policy on main that requires the web-ci/codecoverage status to succeed
Show answer and explanation

Answer: D. The diff coverage status that Azure Pipelines posts to a pull request is advisory by default. To enforce it, configure a branch policy that requires the coverage status, which follows the naming convention {pipeline name}/codecoverage.

Why the other options are wrong:

  • A. failIfCoverageEmpty fails the task only when no coverage data is produced, not when diff coverage is low.
  • B. A higher target changes the threshold, but the status stays advisory without a branch policy.
  • C. With the v1 task, the coverage policy gets stuck and comments aren't generated; v2 is required.

Documentation: Review and configure code coverage results in Azure Pipelines

Question 10, Domain 3, skill 3.3.1

Fabrikam has an Azure DevOps Services organization. A legacy .NET Framework application is stored in an Azure Repos TFVC repository, and the source control team will not migrate it to Git before next year. You need to build the application automatically on every check-in starting this quarter. The solution must use Azure DevOps and must not require moving the source code. What should you use?

  1. A YAML pipeline in Azure Pipelines whose azure-pipelines.yml file is stored in the TFVC repository.
  2. A GitHub Actions workflow on a self-hosted runner that runs the TFVC command-line client to get sources.
  3. A classic build pipeline in Azure Pipelines with a continuous integration trigger on the TFVC path.
  4. A YAML pipeline in Azure Pipelines that declares the TFVC repository as a repository resource.
Show answer and explanation

Answer: C. Azure Repos TFVC is supported only by the classic editor in Azure Pipelines; YAML pipelines don't support TFVC. A classic build pipeline with a CI trigger builds every check-in without moving the code and stays inside Azure DevOps.

Why the other options are wrong:

  • A. YAML pipelines can't be stored in or triggered from a TFVC repository.
  • B. This leaves Azure DevOps for CI and needs a custom runner setup, which breaks the stated constraint.
  • D. YAML repository resources support Git-based providers only, not TFVC.

Documentation: Build source repositories

Question 11, Domain 3, skill 3.3.2

Your Azure DevOps organization uses the Microsoft-hosted free tier for private projects. Builds queue often, and jobs that run longer than 60 minutes are stopped. Yesterday, a Project Collection Administrator purchased one Microsoft-hosted parallel job, yet only one job still runs at a time. You need two Microsoft-hosted jobs to run concurrently without the 60-minute job limit. What should you do?

  1. Change the quantity of paid Microsoft-hosted parallel jobs from one to two.
  2. Add a second agent to the Azure Pipelines pool and keep the one paid job.
  3. Open a support request to raise the limit of 25 Microsoft-hosted parallel jobs.
  4. Re-enable the free tier so its job is added on top of the purchased parallel job.
Show answer and explanation

Answer: A. When you buy your first Microsoft-hosted parallel job while on the free tier, the organization still has one parallel job; the purchase only removes the time limits. To run two jobs at once you must purchase two Microsoft-hosted parallel jobs.

Why the other options are wrong:

  • B. You can't register agents in the Microsoft-hosted Azure Pipelines pool; concurrency is governed by parallel jobs.
  • C. The 25-job cap for new organizations isn't the constraint here; the organization owns only one job.
  • D. The free grant isn't stacked on the first paid job; the first purchase only lifts the time limits.

Documentation: Configure and pay for parallel jobs

Question 12, Domain 3, skill 3.3.4

Contoso hosts its repositories in a GitHub organization and builds them with Azure Pipelines YAML pipelines. The pipelines connect by using an OAuth service connection that a lead developer authorized, and that developer is leaving. You need builds and GitHub status updates to stop depending on any individual's GitHub identity, and you need build, test, and code coverage results to appear in GitHub Checks. What should you do?

  1. Create a GitHub PAT with the repo and admin:repo_hook scopes and use it in a new service connection.
  2. Install the Azure Pipelines GitHub App in the organization for the required repositories.
  3. Re-authorize the OAuth service connection by using a GitHub organization owner's account.
  4. Create a GitHub Enterprise Server service connection that points to the organization's URL.
Show answer and explanation

Answer: B. With the Azure Pipelines GitHub App, builds and status updates use the Azure Pipelines identity instead of a personal one, and the app is the only authentication type that works with GitHub Checks. Microsoft recommends it for CI pipelines.

Why the other options are wrong:

  • A. A PAT still acts as a personal GitHub identity and doesn't work with GitHub Checks.
  • C. OAuth still uses a personal identity, just a different one, and Checks remain unavailable.
  • D. That connection type targets GitHub Enterprise Server instances, not GitHub.com organizations.

Documentation: Build GitHub repositories

Question 13, Domain 3, skill 3.3.5 Now with AI tools

You ask GitHub Copilot Chat to add a Publish stage to an Azure Pipelines YAML pipeline. Publish must run only for the main branch and only after the Build stage, including its tests, succeeds. Copilot proposes the excerpt shown. During review, you find that Publish runs on main even when tests in Build fail. What should you change?

stages:
- stage: Build
  jobs:
  - job: BuildAndTest
    steps:
    - script: dotnet test App.sln -c Release
- stage: Publish
  dependsOn: Build
  condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
  jobs:
  - job: PublishArtifact
    steps:
    - publish: $(Build.ArtifactStagingDirectory)
      artifact: app
  1. Add continueOnError: false to the dotnet test step in the BuildAndTest job.
  2. Change the condition to and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')).
  3. Remove dependsOn: Build so that the stage waits for every previous stage by default.
  4. Ask Copilot to regenerate the stage, and accept the result once the YAML passes validation.
Show answer and explanation

Answer: B. A custom condition replaces the default succeeded() check, so the stage runs whenever the branch expression is true. Wrapping it in and(succeeded(), ...) keeps the branch restriction and also requires Build to succeed, which is the correction the Copilot review guidance shows.

Why the other options are wrong:

  • A. continueOnError is already false by default; the failed test step fails Build, but the condition ignores that.
  • C. The custom condition would still override the success check whatever the dependency.
  • D. Passing validation shows only that the YAML parses, not that a failed test blocks publishing.

Documentation: Generate build pipelines and publish accepted outputs with Copilot

Question 14, Domain 3, skill 3.3.6

You have an Azure DevOps project named Fabrikam that hosts its code in Azure Repos Git. A YAML pipeline named web-ci contains a pr: section that lists main as the target branch. Developers report that opening a pull request into main never queues web-ci, although CI runs on push work as expected. You need every pull request that targets main to be validated by web-ci before the pull request can be completed. What should you do?

  1. Add autoCancel: true and drafts: true under the existing pr: section of web-ci.
  2. Add a Build validation branch policy on main that queues the web-ci pipeline.
  3. Replace the pr: section with a trigger: section that includes the refs/pull/* refs.
  4. Add the project's build service identity as a required reviewer on the main branch.
Show answer and explanation

Answer: B. For Azure Repos Git, pull request validation is implemented with branch policies, not with the YAML pr: keyword, which is ignored for this repository type. Configuring a Build validation policy on the target branch (main) queues web-ci for each pull request and can block completion until the build succeeds.

Why the other options are wrong:

  • A. Every pr: setting, including autoCancel and drafts, is ignored for Azure Repos Git, so editing that section changes nothing.
  • C. A trigger: section defines CI runs on pushes to branches; it does not create pull request validation or gate completion.
  • D. A required reviewer is an approval requirement for people; it never queues a pipeline run.

Documentation: Build Azure Repos Git repositories

Question 15, Domain 3, skill 3.4.1

You have an ASP.NET Core web app named Checkout that reads its feature flags from an Azure App Configuration store by using the .NET feature management library. A redesigned payment flow is merged behind a flag named NewPayments. The product owner wants the flag on immediately for the internal QA group, then on for 5 percent of all other users, raising that percentage each week without redeploying the app. Members of the Finance group must not see the feature until the rollout reaches 100 percent. What should you configure on the NewPayments flag?

  1. A time window filter that enables the flag on each scheduled weekly rollout date.
  2. A custom feature filter that reads the group claim and hard-codes the 5 percent rate.
  3. A targeting filter with QA included, Finance excluded, and a default percentage of 5.
  4. An App Service staging slot that runs the new flow and receives 5 percent of the traffic.
Show answer and explanation

Answer: C. The built-in targeting filter combines included groups, excluded groups and a default percentage of the remaining user base. Exclusions win over inclusions and percentages, so Finance stays off, QA is always on, and the default percentage can be raised in App Configuration without a redeployment.

Why the other options are wrong:

  • A. A time window filter turns the flag on for everyone during a period; it cannot target QA, exclude Finance or expose only a percentage of users.
  • B. Hard-coding the percentage in a custom filter means every weekly increase requires a code change and a redeployment.
  • D. Slot traffic routing splits requests randomly between two deployed builds; it cannot always include QA or always exclude Finance.

Documentation: Roll out features to targeted audiences

The full bank has 97 more Domain 3 questions and 20-question Domain 3 drills that serve unseen questions first.

Domain 3 drill: $19.99