AZ-401 Practice Test

40 free AZ-401 practice questions with answers

All 40 free questions in our bank, by domain, each with the answer, the reason every wrong option fails and the documentation page that settles it. Cover the answer, decide, then open it. To answer them one at a time with a score per domain, use the practice test.

Domain 1: Design and implement processes and communications

Question 1, Domain 1, skill 1.1.1

You have an Azure DevOps organization named Contoso that contains a project named Retail. A management team plans Epics and Features for the whole product. Four feature teams (Checkout, Catalog, Search, and Accounts) plan User Stories in two-week sprints. Each feature team must see only its own User Stories on its backlog and board. The management team must see every Feature together with the progress of the child User Stories from all four teams. You need to design the team structure with the least administrative effort. What should you do?

  1. Create a separate project for each feature team, and connect the Features across the projects by using Related links.
  2. Keep a single team, tag every User Story with the owning team name, and filter the shared board by tag.
  3. Give each feature team its own area path, and have the management team select all four area paths.
  4. Give each feature team its own iteration path, and have the management team select all iteration paths.
Show answer and explanation

Answer: C. In Azure Boards, a team's selected area paths decide which work items appear on its backlogs and boards. Feature teams each own one area path, and a management team typically selects all of the area paths its feature teams work on and focuses on Features and Epics, so it gets cross-team rollup on the portfolio backlog inside one project with no extra tooling.

Why the other options are wrong:

  • A. Separate projects add administration and split the backlog, and Related links don't give parent/child rollup on a portfolio backlog.
  • B. Tags don't scope team backlogs or boards, so every team would still see all of the work and rely on manual filtering.
  • D. Iteration paths define sprint timing, not ownership; the team backlog is filtered by area path, so this doesn't separate the teams' work.

Documentation: About teams and Agile tools; Manage product and portfolio backlogs

Question 2, Domain 1, skill 1.1.4

Contoso connected its Azure Boards project to a GitHub repository by using the Azure Boards app. A developer is about to merge a pull request into the repository's default branch. The merge must link Azure Boards work items 312 and 318 to the pull request and move both work items to the first state of the Resolved category. Which text should the developer add to the pull request description?

  1. Linked to AB#312 and AB#318, both resolved
  2. Fixes AB#312, AB#318
  3. Fixes AB#312, Fixes AB#318
  4. Fixes #312 and fixes #318 in Azure Boards
Show answer and explanation

Answer: C. An AB# mention in a pull request description links the work item, and a preceding fix, fixes, or fixed keyword transitions it to the first Resolved-category state (or Completed if none exists) when the PR merges into the default branch. The keyword applies only to the AB# reference that follows it, so each work item needs its own Fixes keyword.

Why the other options are wrong:

  • A. Both items are linked, but no keyword precedes either AB# reference, so no state transition occurs.
  • B. Both items are linked, but only the first one, 312, is transitioned.
  • D. #312 without the AB prefix references GitHub issues, not Azure Boards work items.

Documentation: Link GitHub commits, pull requests, branches, and issues to work items in Azure Boards

Question 3, Domain 1, skill 1.2.1

Fabrikam's leadership sets a business KPI: customers must receive the enhancements they request sooner. Each request is logged as a User Story in Azure Boards when the customer asks for it, and stories often wait for weeks in the backlog before a team starts work. You need a success metric that reflects the full wait the customer experiences and that can be displayed on a team dashboard. Which widget should you use?

  1. Cycle Time
  2. Lead Time
  3. Velocity
  4. Sprint Burndown
Show answer and explanation

Answer: B. Lead time is the elapsed time from when a work item is created until it reaches a Completed state, so it includes the backlog wait that the customer experiences. The Lead Time widget shows it on a dashboard with an average, moving average, and standard deviation band.

Why the other options are wrong:

  • A. Cycle time starts when the item first enters an In Progress state, so it excludes the weeks spent waiting in the backlog.
  • C. Velocity measures how much work a team completes per sprint, not how long a customer waits.
  • D. Sprint Burndown tracks remaining work within one sprint, not end-to-end delivery time.

Documentation: Configure lead time and cycle time widgets

Question 4, Domain 1, skill 1.2.2 Now with AI tools

For a quarterly quality review, you use GitHub Copilot connected to the Azure DevOps MCP Server to count the Bugs in the Fabrikam project that were in the Active state on January 15, 2026, regardless of their state today. Before the agent runs it, you review the WIQL that Copilot proposes. Which clause must the query include to return the correct result?

  1. ASOF '2026-01-15T00:00:00Z'
  2. AND [System.State] WAS EVER 'Active'
  3. AND [System.ChangedDate] >= '2026-01-15T00:00:00Z'
  4. AND [System.CreatedDate] <= @Today - 30
Show answer and explanation

Answer: A. An ASOF clause runs the filter against work items as they were defined at the specified date and time, so State = 'Active' with ASOF returns the Bugs that were Active on January 15, 2026. The WIQL reference lists this as the pattern for historical snapshots.

Why the other options are wrong:

  • B. WAS EVER matches any Bug that was Active at any point in its history, not specifically on January 15.
  • C. This returns Bugs changed after that date, evaluated against their current state.
  • D. @Today - 30 is relative to the day the query runs and still evaluates the current state.

Documentation: Work Item Query Language (WIQL) syntax reference

Question 5, Domain 1, skill 1.3.1 Now with AI tools

You manage a GitHub repository named contoso/payments-api. A developer used GitHub Copilot Chat to draft a CODEOWNERS file, which is now in the .github/ folder of the main branch. It contains the line "/infra/ @contoso/platform" followed later by the line "/infra/ @contoso/security". Pull requests that change /infra/ target main and are opened as ready for review. Only @contoso/security is requested as a reviewer, but both teams must be requested automatically. The @contoso/platform team has the Read role on the repository, although each of its members has write access through another team. Which two actions should you perform? Each correct answer presents part of the solution. (Choose TWO.)

Choose TWO.

  1. Move the CODEOWNERS file into the docs/ folder of each pull request's head branch.
  2. Prefix the second /infra/ entry with ! so that it no longer overrides the first entry.
  3. Merge the two entries into one line: /infra/ @contoso/platform @contoso/security.
  4. Replace each team handle with the work email addresses of the individual team members.
  5. Give the @contoso/platform team the Write role on the payments-api repository.
Show answer and explanation

Answer: C and E. When the same pattern appears on separate lines, the later line wins, so all owners for a pattern must be listed on one line. A team used as a code owner must itself be visible and have explicit write access to the repository, even if its members already have write access some other way. Fixing both problems causes GitHub to request both teams on pull requests that change /infra/.

Why the other options are wrong:

  • A. Review requests use the CODEOWNERS file from the base branch, and .github/ is already a supported location that GitHub checks first.
  • B. CODEOWNERS doesn't support the gitignore ! negation syntax, and negation wouldn't add a second owner anyway.
  • D. Email addresses don't fix the separate-line problem, and listing individuals instead of the team adds upkeep every time membership changes.

Documentation: About code owners

Question 6, Domain 1, skill 1.3.2 New in AZ-401

A GitHub monorepo contains services/billing and services/web. A root AGENTS.md describes shared conventions and is owned by the platform team. The billing team requires Copilot cloud agent to run make verify before it finishes work in its service, and the web team requires npm run lint. Each team must manage its own agent guidance without editing a file owned by another team. What should you do?

  1. Add both commands to the root AGENTS.md under separate headings, one for each team.
  2. Add a CLAUDE.md file to each service folder and keep the root AGENTS.md file unchanged.
  3. Add a copilot-instructions.md file under a .github folder inside each service folder.
  4. Add an AGENTS.md file to services/billing and another AGENTS.md file to services/web.
Show answer and explanation

Answer: D. AGENTS.md files can be placed anywhere in the repository, and when Copilot works, the nearest AGENTS.md in the directory tree takes precedence. Putting one in each service folder lets each team own the guidance for its code while the root file keeps the shared conventions.

Why the other options are wrong:

  • A. The root file is owned by the platform team, so both teams would have to edit a file they don't own.
  • B. Copilot supports only a single CLAUDE.md in the repository root as an alternative to AGENTS.md, not one per folder.
  • C. Repository-wide instructions are read only from .github/copilot-instructions.md at the repository root, not from nested .github folders.

Documentation: Adding repository custom instructions for GitHub Copilot

Question 7, Domain 1, skill 1.3.3 New in AZ-401

Contoso's Azure DevOps organization is backed by Microsoft Entra ID. Developers will connect GitHub Copilot in Visual Studio Code to the remote Azure DevOps MCP Server by using the server entry shown. The agent must be able to read work items and wiki pages. It must not be able to change any Azure DevOps resource, and pipeline and repository tools must not be exposed. What should you add to the server entry?

{
  "servers": {
    "ado-remote-mcp": {
      "url": "https://mcp.dev.azure.com/contoso",
      "type": "http"
    }
  }
}
  1. "headers": { "X-MCP-Toolsets": "wit,wiki" }, and change the url to https://mcp.dev.azure.com/contoso/readonly
  2. "headers": { "X-MCP-Tools": "wit,wiki", "X-MCP-Toolsets": "readonly" }
  3. "headers": { "X-MCP-Toolsets": "wit,wiki", "X-MCP-Readonly": "true" }
  4. "args": ["-y", "@azure-devops/mcp", "contoso", "-d", "work-items", "wiki"]
Show answer and explanation

Answer: C. The remote Azure DevOps MCP Server limits the exposed tools with the X-MCP-Toolsets header (wit includes work item tools and search_workitem, wiki includes the wiki tools). X-MCP-Readonly: true limits the server to read-only operations, and the two headers can be combined. These headers only filter the tools; they don't grant permissions beyond what the signed-in user already has.

Why the other options are wrong:

  • A. The remote Azure DevOps server's documented read-only switch is the X-MCP-Readonly header; a /readonly URL path is a GitHub MCP server pattern, not an Azure DevOps one.
  • B. X-MCP-Tools takes individual tool names, shouldn't be combined with X-MCP-Toolsets, and readonly isn't a toolset value.
  • D. These are arguments for the local stdio server, not the remote HTTP endpoint, and they don't enforce read-only access.

Documentation: Set up the remote Azure DevOps MCP Server

Domain 2: Design and implement a source control strategy

Question 1, Domain 2, skill 2.1.1

You are refactoring the ordering service in a local clone of an Azure Repos repository. Your main working tree contains modified and untracked files that are not ready to commit, as shown in the exhibit. A severity 1 bug is reported on the release/4.2 branch and must be fixed immediately. You must not stash, commit, or discard the in-progress work, and you must not download the repository again. Which command should you run first?

$ git status --short
 M src/Ordering/OrderService.cs
 M src/Ordering/OrderValidator.cs
?? src/Ordering/Pricing/
$ git branch -r
  origin/main
  origin/release/4.2
  1. git stash push --include-untracked, then git switch release/4.2
  2. git clone --branch release/4.2 <repository-url> ../hotfix
  3. git worktree add -b hotfix/sev1 ../hotfix origin/release/4.2
  4. git switch -c hotfix/sev1 --track origin/release/4.2
Show answer and explanation

Answer: C. git worktree add creates a linked worktree in a separate folder that shares the existing repository's objects and refs, and -b creates the hotfix branch from origin/release/4.2 and checks it out there. Your refactoring files stay untouched in the main worktree, and nothing is stashed or downloaded again. The Git documentation describes this exact case: a temporary linked worktree for an emergency fix that you remove when done.

Why the other options are wrong:

  • A. Stashing the work is explicitly ruled out by the requirements.
  • B. A second clone downloads the repository again and keeps a separate object database, which violates the constraint.
  • D. Switching branches in the same working tree carries the uncommitted and untracked changes into the hotfix checkout, so the two pieces of work get mixed.

Documentation: git-worktree Documentation

Question 2, Domain 2, skill 2.1.2

You have an Azure DevOps project that contains an Azure Repos repository named Payments. Pull requests that target main and change files under /src/settlement/ must be approved by at least one member of the Settlement Leads group. Pull requests that change only other files must not require that group. A Settlement Lead who creates a pull request must not be able to satisfy the requirement with their own vote. What should you configure on the main branch?

  1. Require a minimum number of reviewers set to 1, and add Settlement Leads as an optional automatically included reviewer for /src/settlement/*
  2. An automatically included reviewers policy for Settlement Leads set to Required, with path filter /src/settlement/*, and Allow requestors to approve their own changes cleared
  3. An automatically included reviewers policy for Settlement Leads set to Required with no path filter, and Allow requestors to approve their own changes cleared
  4. An automatically included reviewers policy for Settlement Leads set to Required, with path filter /src/settlement/*, and Allow requestors to approve their own changes selected
Show answer and explanation

Answer: B. A Required automatically included reviewers policy that names a group blocks completion until at least one member of the group approves, and the path filter limits it to pull requests that touch /src/settlement/. Leaving Allow requestors to approve their own changes cleared means the author's own vote doesn't satisfy the policy.

Why the other options are wrong:

  • A. An optional reviewer isn't required to approve, so any single approval would satisfy the minimum reviewer policy.
  • C. Without a path filter, the group would be required on every pull request to main, which the requirements forbid.
  • D. Selecting Allow requestors to approve their own changes lets a Settlement Lead who authored the pull request satisfy the policy alone.

Documentation: Set and manage branch policies

Question 3, Domain 2, skill 2.1.4 New in AZ-401

Contoso is preparing to enable Copilot cloud agent in several GitHub repositories. The security team requires that any change to .github/copilot-instructions.md, to files under .github/agents/, or to .github/workflows/copilot-setup-steps.yml be approved by the Platform Security team before merge, whether a developer or Copilot proposes the change. Developers and Copilot must still be able to propose changes to those files in pull requests. What should you do?

  1. Create a push ruleset with a Restrict file paths rule that blocks pushes to the three paths in each repository
  2. Create a branch ruleset that targets copilot/** and add a Restrict updates rule with Platform Security in the bypass list
  3. Turn off Copilot cloud agent in the repositories until Platform Security has reviewed each of the configuration files
  4. Assign the paths to Platform Security in CODEOWNERS and enable Require review from Code Owners in the branch ruleset
Show answer and explanation

Answer: D. GitHub's guidance for rolling out Copilot in the cloud is to protect Copilot and MCP configuration files with a CODEOWNERS file and the Require review from Code Owners rule. Changes can still be proposed by anyone, including Copilot, but can't merge without the code owners' approval.

Why the other options are wrong:

  • A. A push rule blocks the pushes outright, so developers and Copilot couldn't propose changes to those files at all.
  • B. Restricting updates on copilot/** would stop Copilot from pushing its own work and does nothing for human pull requests.
  • C. Turning the agent off doesn't create an approval gate and removes the capability the company is rolling out.

Documentation: Building a secure cloud environment for agents in your enterprise; Available rules for rulesets

Question 4, Domain 2, skill 2.2.4 New in AZ-401

You need a client-side Git hook that rejects a commit when its message doesn't reference an Azure Boards work item. The commit must be refused before it's created, and the hook must read the message that the developer actually wrote. You wrote the following script and made it executable. Where should you save the script?

#!/usr/bin/env bash
msg=$(cat "$1")
if ! echo "$msg" | grep -qE 'AB#[0-9]+'; then
  echo "Commit message must reference a work item (AB#1234)"
  exit 1
fi
  1. As .git/hooks/commit-msg
  2. As .git/hooks/pre-commit
  3. As .git/hooks/post-commit
  4. As .git/hooks/pre-push
Show answer and explanation

Answer: A. The commit-msg hook is invoked by git commit with one parameter, the path of the file that holds the proposed message, and a non-zero exit aborts the commit. That matches a script that reads "$1" and exits 1 when no AB# reference is found.

Why the other options are wrong:

  • B. pre-commit takes no parameters and runs before the commit message exists, so it can't inspect the message.
  • C. post-commit runs after the commit is created and can't abort it.
  • D. pre-push runs at push time, after the commit already exists, and receives remote details rather than a message file.

Documentation: githooks Documentation; Introduction to Git hooks

Question 5, Domain 2, skill 2.2.5 New in AZ-401

Fabrikam has an Azure DevOps Services organization that uses Azure Repos, Azure Boards, and Azure Pipelines. The company plans to move 120 repositories to GitHub Enterprise Cloud by using GitHub Enterprise Importer. Product owners will keep planning in Azure Boards, and developers must keep linking their GitHub commits and pull requests to existing work items. You need to plan for work item traceability with the least effort. What should you do?

  1. Run GitHub Enterprise Importer with Azure Boards data included so that the work items become GitHub Issues.
  2. Use GitHub Actions Importer to convert the work items and their links into GitHub Projects items.
  3. Keep work items in Azure Boards and connect the migrated repositories through the Azure Boards app.
  4. Recreate the pull request links manually, because the importer drops work item links on pull requests.
Show answer and explanation

Answer: C. GitHub Enterprise Importer migrates Git source, pull requests, their user history, attachments, work item links on pull requests, and repository branch policies, but not the work items themselves. Azure Boards integrates with GitHub, so keeping work items in Boards and connecting the migrated repositories lets developers continue to use AB# links.

Why the other options are wrong:

  • A. The importer doesn't migrate Azure Boards work items to GitHub Issues.
  • B. GitHub Actions Importer converts CI/CD pipelines to workflows; it doesn't handle work items.
  • D. Work item links on pull requests are part of the data the importer migrates, so manual recreation isn't needed.

Documentation: Understand migrations from Azure DevOps to GitHub; Follow-up tasks

Domain 3: Design and implement build and release pipelines

Question 1, 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 2, 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 3, 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 4, 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 5, 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 6, 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 7, 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 8, 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 9, 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 10, 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 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

Domain 4: Design and implement a security and compliance plan

Question 1, Domain 4, skill 4.1.1

Contoso, Ltd. runs an Azure Functions app named func-orders that reads blobs from a storage account named stinvoices. The security team requires that no credential for this access be stored in code, app settings, or Azure Key Vault. The identity must be usable only by func-orders, and it must be removed automatically if func-orders is deleted. You need to configure authentication with the least administrative effort. What should you use?

  1. A user-assigned managed identity that is assigned to func-orders and granted Storage Blob Data Reader
  2. An app registration whose certificate is kept in Key Vault and loaded through a Key Vault reference
  3. An app registration that has a client secret stored as an encrypted application setting
  4. A system-assigned managed identity on func-orders that is granted Storage Blob Data Reader
Show answer and explanation

Answer: D. A system-assigned managed identity is created as part of the Azure resource, only that resource can use it to request tokens, and Azure deletes its service principal when the resource is deleted. Azure manages the credential, so nothing is stored, and you only enable the identity and add one role assignment.

Why the other options are wrong:

  • A. A user-assigned identity has an independent lifecycle, must be deleted explicitly, and can be attached to other resources, which breaks two of the requirements.
  • B. The certificate is a stored credential in Key Vault that you must rotate, which the security team prohibits.
  • C. A client secret in an app setting is a stored credential and adds rotation work.

Documentation: What is managed identities for Azure resources?

Question 2, Domain 4, skill 4.1.2

Your GitHub organization sets the default GITHUB_TOKEN workflow permissions to the restricted setting. A repository contains the following workflow. The job must check out the code, run a script, and open an issue that lists stale dependencies. You need to replace the comment with a permissions block that grants the least privilege that lets the job succeed. What should you use?

name: stale-deps
on:
  schedule:
    - cron: '0 2 * * *'
jobs:
  report:
    runs-on: ubuntu-latest
    # permissions block goes here
    steps:
      - uses: actions/checkout@v5
      - run: ./scripts/find-stale.sh > report.md
      - run: gh issue create --title "Stale dependencies" --body-file report.md
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1. permissions: { issues: write }
  2. permissions: { contents: read, issues: write }
  3. permissions: { contents: write, issues: write }
  4. permissions: { contents: read, pull-requests: write }
Show answer and explanation

Answer: B. When a permissions block lists any permission, every permission that isn't listed is set to none. The checkout step needs contents: read, and gh issue create needs issues: write, so both must be listed and nothing more.

Why the other options are wrong:

  • A. Listing only issues sets contents to none, so actions/checkout can't read the repository.
  • C. contents: write lets the job push commits and create releases, which is more than the job needs.
  • D. pull-requests: write doesn't allow creating issues, so gh issue create fails.

Documentation: Workflow syntax for GitHub Actions; Use GITHUB_TOKEN for authentication in workflows

Question 3, Domain 4, skill 4.1.3

A GitHub Actions workflow must deploy to Azure without storing a client secret. The Microsoft Entra app registration has a federated credential that matches the workflow, and the repository secrets AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_SUBSCRIPTION_ID exist. The azure/login step fails because the job can't request an OIDC token. What should you change?

on:
  push:
    branches: [main]
permissions:
  contents: read
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: azure/login@v2
        with:
          client-id: ${{ secrets.AZURE_CLIENT_ID }}
          tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
  1. Add a creds input that contains the service principal JSON from a repository secret.
  2. Change contents: read to contents: write so that the token can be exchanged.
  3. Add id-token: write to the workflow-level permissions block.
  4. Add actions: write to the permissions block so the job can reach the OIDC provider.
Show answer and explanation

Answer: C. A job needs id-token: write so that GitHub's OIDC provider issues a JSON Web Token that azure/login exchanges for an Azure access token. Because the workflow declares permissions, every permission it doesn't list is none, so id-token must be added explicitly; it doesn't grant write access to any resource.

Why the other options are wrong:

  • A. A creds JSON contains a client secret, which violates the no-secret requirement.
  • B. contents controls repository contents and has nothing to do with requesting an OIDC token.
  • D. actions controls workflow runs; only id-token: write allows the job to fetch an OIDC token.

Documentation: Configuring OpenID Connect in Azure; Workflow syntax for GitHub Actions

Question 4, Domain 4, skill 4.1.5

Contoso has an Azure DevOps organization that contains only private projects. You need to assign access levels at the lowest cost. Sixty business owners must view and edit work items and approve releases but never open code. Six QA leads must create test plans and test suites and author manual test cases. None of these users has a Visual Studio subscription or GitHub Enterprise license. Which two assignments should you make? Each correct answer presents part of the solution. (Choose TWO.)

Choose TWO.

  1. Business owners: Stakeholder
  2. Business owners: Basic
  3. QA leads: Basic
  4. QA leads: Basic + Test Plans
  5. QA leads: Stakeholder
Show answer and explanation

Answer: A and D. Stakeholder access is free for unlimited users and covers creating and editing work items and viewing and approving release pipelines, but not Azure Repos. Creating test plans and suites and authoring manual test cases is Test Case Management, which needs Basic + Test Plans or an equivalent Visual Studio subscription.

Why the other options are wrong:

  • B. Basic is a paid level, and these users don't need code access.
  • C. Basic doesn't include web-based test case management for creating test plans and suites.
  • E. Stakeholders have no access to Azure Test Plans in private projects.

Documentation: About access levels; Stakeholder access quick reference

Question 5, Domain 4, skill 4.2.1

You have an Azure DevOps project named Contoso. Twelve YAML pipelines reference a variable group named prod-secrets that is linked to an Azure key vault named kv-prod. When the security team rotates the value of an existing secret, the pipelines pick up the new value on the next run. Yesterday the team added a new secret named PaymentApiKey to kv-prod, but $(PaymentApiKey) doesn't resolve in any pipeline run. You need the pipelines to receive the new secret with the LEAST administrative effort. What should you do?

  1. Grant the service connection's identity the List permission on secrets in kv-prod.
  2. Edit the prod-secrets variable group and add PaymentApiKey to its mapped secrets.
  3. Reauthorize the service connection that prod-secrets uses on the Library page.
  4. Add an AzureKeyVault@2 task with SecretsFilter set to '*' to all twelve pipelines.
Show answer and explanation

Answer: B. A Key Vault-linked variable group maps secret names, not values. Value changes to secrets that are already mapped flow through automatically at runtime, but secrets added to or deleted from the vault are not added to the group; you must select them explicitly. Adding PaymentApiKey to the group fixes all twelve pipelines in one place.

Why the other options are wrong:

  • A. Existing secrets already resolve, so the identity clearly has Get and List; permissions aren't the gap.
  • C. The connection already works for the mapped secrets; reauthorizing doesn't add the new secret name to the group.
  • D. This would work but means editing twelve pipelines, which isn't the least effort when one variable group edit is enough.

Documentation: Link a variable group to secrets in Azure Key Vault

Question 6, Domain 4, skill 4.2.4

An Azure Pipelines secret variable named SvcConfig holds a JSON document that contains a service account name and password. A deployment script parses SvcConfig and, on failure, writes the parsed password to the log. Reviewers see the password in clear text even though SvcConfig is marked secret. You need to reduce the chance that such values appear in logs. What should you do?

  1. Store each sensitive value as its own secret variable and map each one to an environment variable.
  2. Turn on the Limit variables that can be set at queue time setting for the project.
  3. Declare SvcConfig in YAML with readonly: true so that scripts can't change its value.
  4. Set System.Debug to false so that the agent doesn't write diagnostic output.
Show answer and explanation

Answer: A. Azure Pipelines masks the exact secret value but never masks substrings. A field taken out of a structured secret, such as JSON, isn't masked. Microsoft advises against storing structured data in secrets; one secret per sensitive value, mapped explicitly into the environment, keeps each value maskable.

Why the other options are wrong:

  • B. This stops users from adding or overriding variables at queue time; it does nothing for log masking.
  • C. Read-only stops changes to the variable, not its contents appearing in logs.
  • D. The script itself writes the value; debug logging isn't the cause.

Documentation: Set secret variables

Question 7, Domain 4, skill 4.3.2

Contoso uses GitHub Advanced Security for Azure DevOps with secret push protection enabled on all Azure Repos repositories. A developer's push is rejected because a unit-test fixture contains a dummy connection string. The team confirms that it isn't a real credential. Policy requires push protection to stay enabled on the repository. What should the developer do?

  1. Include skip-secret-scanning:true in the commit message and push the commit again.
  2. Ask a Project Administrator to dismiss the secret alert, then retry the same push.
  3. Ask a Project Collection Administrator to turn off push protection briefly for the push.
  4. Make the same change in the Azure Repos web editor, which push protection doesn't check.
Show answer and explanation

Answer: A. In Azure DevOps, a developer can bypass a push protection block for a confirmed false positive by putting skip-secret-scanning:true in the commit message. Push protection stays on, and a secret scanning alert is still created after the push, so the bypass can be audited.

Why the other options are wrong:

  • B. A blocked push never reaches the repository, so there's no alert to dismiss, and dismissal doesn't unblock pushes.
  • C. Turning off push protection, even briefly, breaks the policy.
  • D. Push protection also blocks secrets in commits made through the web interface.

Documentation: Secret scanning for GitHub Advanced Security for Azure DevOps

Domain 5: Implement an instrumentation strategy

Question 1, Domain 5, skill 5.1.1

Fabrikam's platform team uses Azure Boards with Analytics enabled. For retrospectives, the team lead wants a dashboard chart that shows how long each user story closed in the last 30 days took from the moment a developer first moved it to Active until it was closed, so that the team can spot stories that stalled during development. Many stories sit in the backlog for months before anyone starts them, and that waiting time must not inflate the metric. What should you add to the team dashboard?

  1. A Lead Time widget for the Stories backlog level with a 30-day rolling period
  2. A Cycle Time widget for the Stories backlog level with a 30-day rolling period
  3. A Cumulative Flow Diagram widget for the Stories backlog over the last 30 days
  4. A Velocity widget that shows completed story points for the last six sprints
Show answer and explanation

Answer: B. Cycle time is measured from when a work item first enters an In Progress state category until it reaches a Completed state, so backlog waiting time is excluded. The Cycle Time widget plots each closed item as a point over a rolling period, which makes stalled stories visible as outliers.

Why the other options are wrong:

  • A. Lead time starts when the work item is created, so months of backlog waiting time would inflate every value.
  • C. A cumulative flow diagram shows item counts per board column over time, not the elapsed time of individual closed stories.
  • D. Velocity shows completed effort per sprint and says nothing about how long individual stories took.

Documentation: Configure lead time and cycle time widgets

Question 2, Domain 5, skill 5.2.1 New in AZ-401

Contoso runs an order API on Azure Kubernetes Service (AKS) with Application Insights. At 02:10, a Sev1 alert for failed requests fires. The on-call engineer wants the Azure Copilot Observability Agent to correlate application, infrastructure, and Azure platform signals around the alert and produce a report with findings and next steps. No Observability Agent resource exists, and the team doesn't want to provision anything new. What should the engineer do?

  1. Create an Observability Agent resource scoped to the Application Insights resource and leave Investigation selected
  2. Deploy an Azure SRE Agent and connect Azure Monitor as its incident platform
  3. Review the Smart Detection failure anomalies rule for the Application Insights resource
  4. Open the fired alert in the Azure portal and select Investigate
Show answer and explanation

Answer: D. Chat and deep investigations are available without provisioning an Observability Agent resource; the resource is needed only for autonomous operations. Selecting Investigate on a fired Azure Monitor alert is the recommended entry point because it hands the agent the affected resource, symptom, and firing time.

Why the other options are wrong:

  • A. An Observability Agent resource is only needed for autonomous correlation, and the team doesn't want to provision anything.
  • B. Deploying an SRE Agent provisions a new billable resource, which the team wants to avoid.
  • C. Smart Detection rules flag anomalies but don't run a cross-layer investigation that produces findings and next steps.

Documentation: Deep investigations in the Azure Copilot Observability Agent; Azure Copilot Observability Agent

Question 3, Domain 5, skill 5.2.2 New in AZ-401

Last month, a team created an Azure SRE Agent named sre-payments in East US 2. A new data residency policy requires the agent's compute to run in a European region. The payment workloads that the agent manages run in West Europe and must stay there. What should you do?

  1. Change the Region on the agent's Settings page to West Europe, and then restart the agent so the change takes effect
  2. Redeploy the agent's Bicep template with the location set to westeurope in the same resource group
  3. Create an agent in Sweden Central and grant its managed identity access to the payment resource groups
  4. Move the agent resource to a West Europe resource group by using Azure Resource Mover
Show answer and explanation

Answer: C. An agent's region is fixed at creation, so you must create a new agent in a supported European region such as Sweden Central. The region only determines where the agent's compute runs; with permissions on its managed identity, the agent can manage resources in any region, including West Europe.

Why the other options are wrong:

  • A. You can't change an agent's region after creation.
  • B. West Europe isn't a supported Azure SRE Agent region, and redeploying doesn't change an existing agent's region.
  • D. Moving the resource doesn't change its region, and the agent region can't be changed.

Documentation: Supported regions for Azure SRE Agent

Question 4, Domain 5, skill 5.3.3

A partner reports a failed call to your order API and sends the W3C traceparent header that its client sent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01. All your services send OpenTelemetry data to one workspace-based Application Insights resource. You need every request, dependency, and exception that your services recorded for that distributed trace. Which filter should you apply to the AppRequests, AppDependencies, and AppExceptions tables?

  1. where ParentId == "00f067aa0ba902b7"
  2. where OperationId == "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
  3. where OperationId == "4bf92f3577b34da6a3ce929d0e0e4736"
  4. where OperationId == "00f067aa0ba902b7"
Show answer and explanation

Answer: C. A traceparent header has the form version-traceid-parentid-flags. Application Insights maps the W3C trace-id to operation_Id (OperationId in Log Analytics), which every item in the distributed trace shares, while the parent-id maps to the Id of the calling span. Filtering on OperationId therefore returns the whole trace across components.

Why the other options are wrong:

  • A. ParentId holds the immediate parent, so this returns only items whose direct parent is the partner's span, not the whole trace.
  • B. OperationId stores only the 32-hex-character trace-id, not the whole traceparent header value.
  • D. 00f067aa0ba902b7 is the parent-id (span ID) of the caller, not the trace ID that OperationId stores.

Documentation: Microsoft Azure Monitor Application Insights JavaScript SDK configuration; Application Insights telemetry data model

Question 5, Domain 5, skill 5.3.4 New in AZ-401

Contoso uses Copilot cloud agent (formerly the coding agent) across 25 organizations in its GitHub Enterprise Cloud enterprise. The audit committee requires that records of agent activity, such as pull requests that Copilot created, be kept for three years and be searchable in the company's SIEM, which ingests data from Azure Event Hubs. What should you do?

  1. Rely on the actor:Copilot filter in the enterprise audit log, which keeps agent events for three years
  2. Export each organization's audit log as a CSV file once a month and upload the files to the SIEM
  3. Enable the Store local sessions in the Cloud policy so that agent session data stays on GitHub.com
  4. Configure audit log streaming for the enterprise with Azure Event Hubs as the destination
Show answer and explanation

Answer: D. The audit log records agent activity on GitHub, but it retains events for only 180 days. GitHub recommends streaming the audit log to a SIEM for long-term history; enterprise streaming covers all organizations, and Azure Event Hubs is a supported destination.

Why the other options are wrong:

  • A. The enterprise audit log keeps events, including agentic events, for 180 days only.
  • B. Manual monthly exports across 25 organizations add effort and risk gaps; streaming covers all organizations continuously.
  • C. That policy controls syncing of local CLI and app sessions; it doesn't extend audit retention or feed a SIEM.

Documentation: Reviewing audit logs for GitHub Copilot; Streaming the audit log for your enterprise

Question 6, Domain 5, skill 5.3.5 Now with AI tools

A Log Analytics workspace receives heartbeats from Azure Monitor Agent on 500 servers. Server SQL07 was shut down three hours ago, and server WEB12 stopped reporting 20 minutes ago. All other servers are healthy and report every minute. You run the following query to find servers that need attention. Which servers does the query return?

Heartbeat
| where TimeGenerated > ago(1h)
| summarize LastHeartbeat = max(TimeGenerated) by Computer
| where LastHeartbeat < ago(15m)
| project Computer, LastHeartbeat
  1. SQL07 only
  2. WEB12 only
  3. Both SQL07 and WEB12
  4. No servers, because max() returns one latest heartbeat across all computers
Show answer and explanation

Answer: B. The query keeps heartbeats from the last hour, finds each computer's latest heartbeat, and returns computers whose latest one is older than 15 minutes. WEB12 qualifies. SQL07 sent nothing in the last hour, so it has no rows to summarize and doesn't appear; detecting long-silent machines requires a wider time window.

Why the other options are wrong:

  • A. SQL07 has no heartbeat in the last hour, so the first where clause removes it before summarize runs.
  • C. The one-hour filter excludes servers that have been silent longer than an hour, such as SQL07.
  • D. summarize ... by Computer calculates max(TimeGenerated) separately for each computer.

Documentation: Azure Monitor Logs reference - Heartbeat

252 more questions, five timed 50-question simulations and the what's-new drill: $19.99, once.

Open the practice test