Skip to main content
Practice set 1 is free for every certification. Unlock sets 2-5 for $10.
Practice Exam

AZ-401 — Agentic DevOps Engineer Expert

Test your knowledge with official exam-style questions

Questions25Passing700Exam time

Questions and options are shuffled each attempt

Email me this practice set

Get a link sent to your inbox so you can pick this back up anytime.

▶Microsoft Certified: Agentic DevOps Engineer Expert — Practice Set 1: All Questions & Explanations

Full question text, answer options, and explanations for this practice set — a spoiler-free alternative is the interactive quiz above for scored, shuffled practice.

  1. 1. Your team keeps code in GitHub repositories that are connected to an Azure Boards project. A developer wants a pull request to be linked to work item 482 and, when the pull request merges into the default branch, move that work item to the Resolved state category. Which text should the developer put in the pull request description?

    • A. Related to #482
    • B. Fixes AB#482(correct)
    • C. Fixes GH-482
    • D. AB#482 in the pull request title only

    Explanation: Azure Boards recognizes AB#{ID} in a pull request description and applies keywords such as fix, fixes, or fixed to the AB# reference that follows. By default the work item moves to the first state in the Resolved category (or Completed if none exists) once the pull request is merged into the default branch. Why the other options are wrong. A: A bare # reference points to a GitHub issue or pull request number, not to an Azure Boards work item, and no state transition keyword is applied to a work item. C: GH-482 is not a recognized Azure Boards mention syntax, so neither a link nor a state transition is created. D: AB# mentions create links only in commit messages, pull request descriptions, or issue descriptions; a mention in the title does not create the link, and without a keyword like fix, fixes or fixed there is no state transition.

  2. 2. Engineers use Visual Studio Code with GitHub Copilot in agent mode. They want to ask natural-language questions about current-sprint work items and pull requests without installing or hosting anything locally. The Azure DevOps organization is backed by a Microsoft Entra tenant. Which approach should you recommend?

    • A. Install the local Azure DevOps MCP Server on every engineer workstation by using Node.js 20 or later and register it in each editor's MCP configuration
    • B. Create a service hook that posts work item changes and pull request events to the Copilot chat window every time something is updated
    • C. Configure the remote Azure DevOps MCP Server, an Azure DevOps-hosted endpoint that uses Microsoft Entra authentication(correct)
    • D. Export work items to a CSV file each night and attach it to the Copilot prompt

    Explanation: Azure DevOps provides remote and local MCP servers. The remote server is a Microsoft-hosted endpoint (streamable HTTP, Microsoft Entra authentication), needs no installation or hosting, and is supported in Visual Studio Code with GitHub Copilot. The organization being backed by Microsoft Entra satisfies its prerequisite. Why the other options are wrong. A: The local server works, but it requires a local installation. It is intended for clients that cannot authenticate to the remote server; the remote server is recommended when the environment supports it. B: Service hooks push events to subscribers; they do not give an AI assistant on-demand, queryable access to work items and pull requests. D: This creates stale data and manual effort, and it bypasses the MCP server that is designed to give an assistant live Azure DevOps context.

  3. 3. A product owner states this business KPI: "Customers should wait less time between requesting a feature and having it available." Which DevOps success metric best translates this KPI for the delivery process?

    • A. Lead time, measured from when a work item is created until it is completed(correct)
    • B. Code coverage percentage of the unit test suite
    • C. Number of commits per developer per week
    • D. Average CPU utilization of the build agents

    Explanation: Lead time covers the whole elapsed period from request (work item creation) to completion, which maps directly to the customer-facing wait expressed in the KPI. Cycle time, by contrast, only starts when the team begins active work. Why the other options are wrong. B: Code coverage is a quality indicator for testing; it says nothing about how long customers wait for requested features. C: Commit count is an activity measure, not an outcome measure of how quickly a request becomes delivered value. D: Agent utilization is an infrastructure efficiency measure and is unrelated to customer wait time.

  4. 4. Your platform team wants GitHub Copilot to follow a stricter rule set (Bicep only, never edit production parameter files) only when it works on files under the infra folder, without changing behavior elsewhere in the repository. What should you add to the repository?

    • A. Put the rules in .github/copilot-instructions.md and describe the infra folder restriction in a heading at the top of the file
    • B. A path-specific .github/instructions/infra.instructions.md file with an applyTo glob matching the infra folder(correct)
    • C. Add a CODEOWNERS entry that assigns the platform team as the owner of the infra folder and requires their review on every change
    • D. Add a pull request template that lists the Bicep-only and no-production-parameter rules for anyone changing the infra folder

    Explanation: Path-specific custom instructions are stored in NAME.instructions.md files under .github/instructions. Each file starts with an applyTo frontmatter glob so the rules are used only when Copilot works on matching files, which is exactly the scoping requested. Why the other options are wrong. A: That file holds repository-wide instructions that apply to every request in the repository, so the stricter rules would also apply to unrelated files. C: CODEOWNERS requests human reviewers on pull requests; it does not instruct Copilot or restrict how an agent edits files. D: A template reminds humans when they open a pull request; it is not read by Copilot as instructions during agentic development.

  5. 5. A 40-person team deploys to production several times a day, hides unfinished work behind feature flags, and wants short-lived branches with minimal merge conflicts. Which branching strategy fits best?

    • A. Git flow with a long-lived develop branch and formal release branches
    • B. One long-lived feature branch per squad, merged at the end of each quarter
    • C. Trunk-based development with very short-lived branches merged into the main branch frequently(correct)
    • D. A new release branch for every sprint that is maintained for a year

    Explanation: Trunk-based development keeps branches very short-lived and integrates to the main branch continuously. Combined with feature flags it lets unfinished work be merged safely, reduces merge conflicts, and supports frequent production deployments. Why the other options are wrong. A: Git flow suits scheduled, versioned releases. Its long-lived branches and multi-step merges add delay and conflict risk for a team deploying many times per day. B: Long-lived branches accumulate divergence and large, risky merges, which is the opposite of the requirement. D: Per-sprint maintained release branches multiply the maintenance burden and are meant for supporting several versions, not continuous deployment.

  6. 6. In Azure Repos you must guarantee a linear history on main where every pull request lands as a single commit, for all contributors. Which branch policy should you configure?

    • A. Require a minimum number of reviewers set to two
    • B. Build validation with a required pipeline
    • C. Automatically included reviewers with a path filter
    • D. Limit merge types, allowing only squash merge(correct)

    Explanation: The Limit merge types policy lets you allow only specific completion strategies. Squash merge creates a linear history with a single commit in the target branch that contains the changes from the source branch. Why the other options are wrong. A: Reviewer count controls approvals; it does not control how commits from the pull request are combined into the target branch. B: Build validation checks that the change builds and tests pass; it does not restrict the merge strategy. C: This adds required reviewers for certain paths and has no effect on the merge type used to complete the pull request.

  7. 7. A team adds a pre-commit hook that runs a linter. After new developers clone the repository, the hook is not active, and some developers push with the --no-verify option. Azure Repos and GitHub are the only hosting options. Which design is most reliable?

    • A. Commit the .git/hooks folder to the repository so every clone receives the hooks, and make the hook scripts executable on checkout
    • B. Share the hooks through a tracked folder and core.hooksPath, and enforce the same checks on the server with build validation or required status checks(correct)
    • C. Install custom server-side pre-receive hooks on the Azure Repos and GitHub.com services so the linter runs on every push to the shared remote repositories
    • D. Rely on code review to catch lint failures because client hooks cannot be trusted at all and can always be skipped with --no-verify

    Explanation: Client-side hooks are local convenience: sharing them through a tracked folder plus core.hooksPath makes them easy to adopt, but they can be skipped. Authoritative enforcement belongs in server-side controls such as build validation policies in Azure Repos or required status checks in GitHub branch protection. Why the other options are wrong. A: The .git directory is not versioned content, so hook scripts placed there are not cloned. C: The hosted services do not allow customers to install custom server-side hooks; policy enforcement is done with branch policies or branch protection rules instead. D: Client hooks are still valuable for fast local feedback. The gap is enforcement, which should be closed by pipeline checks rather than by dropping automation.

  8. 8. Your Azure Artifacts feed receives every build of an internal library. Consumers must only see versions that passed validation, while developers still need access to all builds. What should you do?

    • A. Create a second Azure DevOps organization and republish the validated packages there
    • B. Delete the unvalidated versions from the feed after each build so that only validated packages remain visible to consumers
    • C. Promote validated package versions to the @Release view and point consumers at that view(correct)
    • D. Encode validation status into the numeric part of the version, for example 1.2.3

    Explanation: Feed views are read-only subsets of a feed. Every feed has @local, @prerelease and @release views; promoting packages that passed validation to @Release lets consumers see only tested, production-ready versions while the base feed still holds all builds for developers. Why the other options are wrong. A: This duplicates infrastructure and governance, when feed views already provide a read-only subset of the same feed. B: Package versions are immutable and shared by consumers; deleting them is destructive and removes the feed history that developers still need. D: Quality is not known when the version number is assigned, so the numeric SemVer segments cannot communicate validation status. Feed views are the intended mechanism.

  9. 9. A shared library is currently at version 2.4.7. The next release removes a public method, which breaks existing consumers. Under semantic versioning, which version number should you publish?

    • A. 2.5.0
    • B. 2.4.8
    • C. 2.4.7-rc.1
    • D. 3.0.0(correct)

    Explanation: In SemVer, MAJOR.MINOR.PATCH, a backward-incompatible change requires incrementing MAJOR and resetting MINOR and PATCH, so 2.4.7 becomes 3.0.0. Why the other options are wrong. A: Incrementing the MINOR segment signals backward-compatible new functionality, not a breaking change. B: Incrementing the PATCH segment signals backward-compatible bug fixes only. C: This is a pre-release label on the existing version; it does not communicate a breaking change.

  10. 10. After a canary stage in an Azure Pipelines YAML deployment, the production stage must not start while Azure Monitor alerts are active for the application. Which check should you add to the production environment?

    • A. Query Azure Monitor alerts(correct)
    • B. Business hours
    • C. Required template
    • D. Exclusive lock

    Explanation: The Query Azure Monitor alerts check succeeds only if no alert rules are activated at the time of evaluation, and it is re-evaluated at the configured interval until it passes or times out. It is designed for staged rollouts where application health decides whether to continue. Why the other options are wrong. B: This check only delays a stage until an allowed time window; it does not evaluate application health. C: This check enforces that the pipeline extends a specific YAML template; it does not look at runtime health. D: This check serializes runs that use the resource; it does not evaluate alerts.

  11. 11. Deployments must reach an Azure SQL database that has no public endpoint. Your team wants autoscaling build capacity, to avoid maintaining always-on build VMs, and to keep agents inside your virtual network. Which option fits best?

    • A. Microsoft-hosted agents with the largest available hosted image, scaled out to the maximum number of parallel jobs
    • B. A Managed DevOps Pools or Virtual Machine Scale Set agent pool deployed in your virtual network(correct)
    • C. A single dedicated self-hosted VM in the virtual network that is always running, with the agent installed as a service
    • D. Developer laptops registered as agents and connected to the virtual network through a point-to-site VPN

    Explanation: Scale set agents are self-hosted agents that autoscale, can run in your virtual network to reach private resources, and avoid dedicated always-on agents. Managed DevOps Pools is the evolution of scale set agent pools with Microsoft managing more of the infrastructure. Why the other options are wrong. A: These agents run outside your network, so they cannot reach a private-only database without opening network paths that the requirement forbids. C: It can reach the private network, but it does not autoscale and you must keep it patched and running around the clock. D: This is unreliable, unmanageable, and creates a security and availability risk.

  12. 12. The security team requires every production pipeline in the organization to include a mandatory vulnerability-scan stage that teams cannot remove or reorder. Which design enforces this?

    • A. Publish an includes template that contains the vulnerability-scan stage and ask every team to reference it from the production pipelines they own
    • B. Store the scan settings in a variable group that every production pipeline is required to link and read before it deploys
    • C. Create a task group for the scan task and ask each team to add it as the last step of its production pipeline stages
    • D. Require pipelines to extend a template that defines the mandatory stages, enforced by the Required template check on production resources(correct)

    Explanation: Extends templates define the structure that a pipeline must follow, and the Required template check fails any pipeline that does not extend the referenced template when it uses the protected resource, so the mandatory scan stage cannot be skipped. Why the other options are wrong. A: An includes template only inserts content where a team chooses to reference it; nothing stops a team from omitting it. B: A variable group supplies values; it cannot add or protect a stage in a pipeline. C: Task groups apply to classic pipelines and are optional to use; they do not enforce pipeline structure in YAML.

  13. 13. A web app runs in an Azure App Service Standard plan. You need zero-downtime releases with fully warmed-up instances and a one-step way to return to the last known good version. What should you do?

    • A. Stop the production app, deploy, and start it again during a planned maintenance window outside business hours
    • B. Deploy directly to production and rely on the platform to restart instances gradually during the rollout
    • C. Deploy to a staging slot, warm it up, swap it into production, and swap again to roll back(correct)
    • D. Scale the plan out to more instances before each release

    Explanation: Deployment slots are live apps with their own host names. A swap warms all instances in the source slot first and then switches routing, so no requests are dropped. After a swap the previous production app sits in the other slot, so repeating the swap returns to the last known good site. Why the other options are wrong. A: This causes downtime on every release and does not satisfy the zero-downtime requirement. B: Direct deployment restarts the live app and gives no warmed-up copy or immediate rollback target. D: More instances add capacity but do not give a validated, warmed-up target or a quick rollback path.

  14. 14. A company ships the same build to internal employees first, then to a pilot customer group, then to all regions. Each expansion is gated on telemetry from the previous audience. Which deployment strategy does this describe?

    • A. Blue-green deployment
    • B. Ring-based deployment (progressive exposure by audience)(correct)
    • C. A/B testing
    • D. Recreate (stop and replace) deployment

    Explanation: Ring deployments expose a release to defined audience groups in order of increasing risk and scale, using monitoring data at each ring to decide whether to continue. That matches the employee, pilot, then global progression with telemetry gates. Why the other options are wrong. A: Blue-green keeps two full environments and switches all traffic from one to the other; it does not expand audience in stages. C: A/B testing compares variants of a feature to measure which performs better; it does not roll out one build to progressively larger audiences. D: Recreate stops the old version before starting the new one; it has no staged audiences or telemetry gates.

  15. 15. Before a production approval, reviewers must see which resources a Bicep deployment will create, modify, or delete, without changing any existing resource. Which step should the pipeline run before the approval?

    • A. az deployment group what-if against the production resource group(correct)
    • B. az deployment group create against a development resource group
    • C. bicep build to compile the template to JSON
    • D. az group export on the production resource group

    Explanation: The what-if operation previews how resources would change if the Bicep file were deployed, without making changes to existing resources. Running it in a stage before the approval gives reviewers the create, modify, and delete information they need. Why the other options are wrong. B: Deploying to development shows how the template behaves there, not what will change in production, and it makes real changes. C: Compilation checks the template syntax but does not compare the template to the current state of the production resources. D: Exporting captures the current state; it does not predict what a deployment will change.

  16. 16. The nightly pipeline now takes twice as long as before and intermittently fails on tests that pass when rerun. Which TWO actions address both the visibility and the duration problem?

    • A. Use pipeline and test analytics to track failure rate, duration trend, and flaky tests(correct)
    • B. Increase the retention period for pipeline runs
    • C. Remove the test stage from the nightly run
    • D. Add dependency caching and run independent test jobs in parallel(correct)
    • E. Disable all branch policies on the default branch

    Explanation: Maintaining a pipeline means monitoring failure rate, duration, and flaky tests, and then optimizing for time and reliability. Analytics make the trend and the unreliable tests visible, while caching and parallelism directly reduce duration. Why the other options are wrong. B: Retention controls how long old runs are kept; it does not diagnose failures or reduce run duration. C: This hides the failures instead of fixing them and removes the quality signal the pipeline exists to provide. E: Branch policies are unrelated to nightly duration or flaky tests and removing them lowers quality controls.

  17. 17. An Azure Function app must read secrets from Azure Key Vault at runtime. The security team forbids storing credentials in app settings. Which identity approach should you use?

    • A. Create a service principal with a client secret and store the secret in app settings
    • B. Embed a personal access token in the function code
    • C. Enable a managed identity on the function app and grant it access to Key Vault(correct)
    • D. Use the storage account key of the function app to authenticate to Key Vault

    Explanation: A managed identity is intended for Azure-hosted workloads: Azure manages the credential lifecycle, so there is nothing to store or rotate. Granting that identity access to the vault lets the function retrieve secrets at runtime. Why the other options are wrong. A: This stores a credential in app settings, which is forbidden, and it adds a secret to rotate. B: A personal access token is tied to a person, is not an Azure resource credential for Key Vault, and would be embedded in code. D: Storage account keys do not authenticate to Key Vault, and sharing them widens access unnecessarily.

  18. 18. A YAML pipeline must read secrets from Azure Key Vault at run time and use them as masked variables, with no secret stored in the pipeline definition. Which TWO things must be in place?

    • A. A classic personal access token with full scope stored as a secret variable
    • B. An Azure Resource Manager service connection, authorized for the pipeline, that uses workload identity federation or a managed identity(correct)
    • C. The Owner role for the identity on the whole subscription
    • D. A secure file containing the vault access keys
    • E. The identity behind the connection has Get and List permissions on the vault secrets(correct)

    Explanation: The Azure Key Vault task uses an Azure Resource Manager service connection to authenticate, and the identity needs permission to get and list secrets. The task then exposes the secrets as masked variables for later steps. Why the other options are wrong. A: A personal access token is not how a pipeline authenticates to Key Vault, and a full-scope token is excessive. C: This grants far more access than needed and does not by itself grant the vault secret permissions. D: Key Vault does not use shared access keys, and storing credentials in a secure file defeats the purpose.

  19. 19. Developers working in Azure Repos occasionally commit API keys. You want to stop a push that contains a secret before the secret reaches the remote repository. Which capability should you enable?

    • A. CodeQL code scanning configured as a required build validation policy on pull requests to the default branch
    • B. Push protection in GitHub Advanced Security for Azure DevOps (Secret Protection)(correct)
    • C. Dependency scanning enabled on the repository with alerts sent to the security team
    • D. A branch policy that requires a minimum number of reviewers

    Explanation: Push protection checks pushes for commits that expose secrets and blocks them before they land. It is enabled together with Secret Protection (or Advanced Security) for the repository. It evaluates only pushes made after it is enabled. Why the other options are wrong. A: Code scanning finds code-level vulnerabilities such as injection flaws; it is pipeline-based and does not block pushes that contain secrets. C: Dependency scanning looks for known vulnerabilities in open-source packages, not for credentials in commits. D: Reviews happen at pull request time, after the secret has already been pushed to the remote branch.

  20. 20. A workflow only needs to post a comment on pull requests. The organization default gives GITHUB_TOKEN read and write access to all scopes. How should you apply least privilege?

    • A. Replace GITHUB_TOKEN with a classic personal access token that has repo scope, stored as an organization secret that every workflow can read
    • B. Use an administrator personal access token stored as an organization secret so the call never fails
    • C. Disable GITHUB_TOKEN for the repository and remove every permissions block from the workflow files
    • D. Add a permissions block granting only pull-requests: write to the job, and set the repository default to read-only(correct)

    Explanation: GITHUB_TOKEN is created for each job and scoped to the repository that contains the workflow. Setting the default to read-only and granting only the permission a job needs through the permissions key follows least privilege. Why the other options are wrong. A: A classic personal access token with repo scope is far broader, is tied to a user, and does not reduce privilege. B: This maximizes privilege and creates a dependency on one person. C: The workflow needs a token to post comments; disabling it would break the workflow rather than narrow its access.

  21. 21. The security team wants a single console that shows code, secret, dependency, and infrastructure-as-code findings from both its Azure DevOps organization and its GitHub organization. What should you do?

    • A. Onboard both environments to Microsoft Defender for Cloud DevOps security(correct)
    • B. Review each platform separately because Defender for Cloud supports only Azure DevOps
    • C. Send all findings to a Teams channel and review them manually
    • D. Create an Azure Policy assignment on the subscription

    Explanation: DevOps security in Defender for Cloud provides a central console across multi-pipeline environments including Azure DevOps and GitHub. It shows total scan findings for code, secrets, dependencies, and infrastructure-as-code grouped by severity and type. Why the other options are wrong. B: Defender for Cloud DevOps security supports Azure DevOps, GitHub, and GitLab environments. C: A chat channel does not provide the unified inventory, posture, and findings view of the DevOps security console. D: Azure Policy governs Azure resources and does not collect scan findings from DevOps platforms.

  22. 22. A manager wants a dashboard widget that shows how long the team takes to finish work items after they start working on them. Which widget should you add?

    • A. Lead Time
    • B. Cycle Time(correct)
    • C. Velocity
    • D. Burndown

    Explanation: Cycle time is the elapsed time from when a work item first enters an In Progress state until it reaches a Completed state. It highlights process bottlenecks, whereas lead time starts at work item creation. Why the other options are wrong. A: Lead time is measured from when a work item is created, so it includes waiting time before work starts. C: Velocity summarizes how much work is completed per iteration, not elapsed time per item. D: Burndown shows remaining work over an iteration, not per-item elapsed time.

  23. 23. In a GitHub Actions deployment job you want a final step that notifies the on-call channel only when any earlier step in the job fails. Which condition should the notification step use?

    • A. if: always()
    • B. continue-on-error: true on the earlier steps
    • C. needs: [deploy] on the job
    • D. if: failure()(correct)

    Explanation: The failure() status check function returns true when a previous step in the job has failed, so a step with if: failure() runs only in that case and can post the alert. Why the other options are wrong. A: This runs the step on success and on failure, so the on-call channel would be notified for every run. B: This lets the job continue after a failure but does not create a notification and can hide the failure. C: The needs key orders jobs; it does not run a step conditionally on failure.

  24. 24. You are enabling Azure SRE Agent for production incidents. The operations lead requires that the agent proposes Azure infrastructure changes and waits for human approval before executing them. Which run mode should you use?

    • A. Autonomous mode
    • B. Autonomous mode with the agent granted the Reader role
    • C. Review mode, where only SRE Agent Administrators approve actions(correct)
    • D. Remove the incident platform connector

    Explanation: Review mode makes the agent propose actions for Azure infrastructure operations and ask for approval; only SRE Agent Administrators can approve. It is the recommended mode for production incidents. Why the other options are wrong. A: In autonomous mode the agent executes immediately and reports what it did, so no approval is requested. B: The role limits what the agent can reach but run modes decide whether approval is requested; this does not implement an approval workflow. D: Without a connector the agent would not receive incidents; it does not add an approval step.

  25. 25. In the Application Insights Logs experience you need the 95th percentile of request duration per cloud role over the last hour, in 5-minute buckets. Which query is correct?

    • A. requests | where timestamp > ago(1h) | summarize p95 = percentile(duration, 95) by bin(timestamp, 5m), cloud_RoleName(correct)
    • B. requests | where timestamp < ago(1h) | summarize p95 = percentile(duration, 95) by bin(timestamp, 5m), cloud_RoleName
    • C. SELECT percentile(duration, 95) FROM requests GROUP BY cloud_RoleName
    • D. requests | where timestamp > ago(1h) | summarize avg(duration) by bin(timestamp, 5m), cloud_RoleName

    Explanation: KQL pipes tabular data through operators. The where operator with ago(1h) limits the window, and summarize with percentile(duration, 95) grouped by bin(timestamp, 5m) and cloud_RoleName produces the requested per-role 5-minute buckets. Why the other options are wrong. B: The comparison is reversed, so it returns data older than one hour instead of the last hour. C: This is SQL syntax, not KQL, and it has no time filter or 5-minute binning. D: This computes the average duration rather than the 95th percentile that was requested.