Free AZ-401 practice questions: 20 with answers

Updated November 23, 2026

Twenty original scenario questions, spread over the five AZ-401 domains in proportion to Microsoft’s published weights: three on processes and communications, two on source control, seven on build and release pipelines, four on security and compliance and four on instrumentation. AZ-401 is a beta exam, so the objectives may still change; these questions follow the study guide as it stands. Every question has a single correct answer. Read the constraint in the scenario first, then rule out the options that break it.

Design and implement processes and communications

Question 1. A coding agent is allowed to open pull requests in your repository. The team wants it to keep working without supervision on small tasks, but to stop runaway behaviour and keep a person accountable for what reaches main. Which requirement should you specify?

  • A. Unlimited iterations, with every action logged afterwards
  • B. A maximum iteration count and a human approval before merge
  • C. Administrator rights so the agent never gets blocked
  • D. Forbid the agent from opening pull requests at all
Show answer

Answer: B

Bounding the loop with a maximum number of iterations and requiring a human approval before merge limits runaway behaviour and keeps a person accountable. Unlimited iterations with only logging does not stop a runaway loop, giving the agent administrator rights increases the risk, and banning the agent from opening pull requests removes the benefit without addressing the design question.

Want more questions like this? Full AZ-401 practice tests →

Question 2. A developer used an AI assistant to write a query that is meant to show the average lead time for changes over the last 30 days. The dashboard number looks much lower than expected. What should you do first?

  • A. Publish it, because the query ran without errors
  • B. Ask the assistant to adjust the query until the number looks higher
  • C. Review the time filter and aggregation, and compare the result with known records
  • D. Replace the metric with the number of commits
Show answer

Answer: C

Generated queries must be reviewed and validated before they drive decisions: check the time range, the filters and the aggregation, and compare the result with a few known records. Publishing the number because the query ran, asking the assistant to make the number higher, or switching to a metric that is easier to produce all skip the validation step.

Want more questions like this? Full AZ-401 practice tests →

Question 3. Your team plans work in Azure Boards but keeps the code in GitHub. You want pull requests to appear on the related work items without migrating either tool. What should you do?

  • A. Connect the GitHub repository to Azure Boards and reference work item IDs in pull requests
  • B. Migrate every work item into GitHub Issues first
  • C. Paste pull request URLs into the work items by hand once a week
  • D. Track the links in a shared spreadsheet
Show answer

Answer: A

Azure Boards can be connected to a GitHub repository, and mentioning the work item ID in commits and pull requests (the AB# syntax) links them to the item. Migrating all work items to GitHub is unnecessary, copying links by hand does not scale and is error-prone, and a spreadsheet gives no live link between the tools.

Want more questions like this? Full AZ-401 practice tests →

Design and implement a source control strategy

Question 4. Several AI agents work on different tasks in the same repository on one build machine, and they keep overwriting each other's checked-out files. What is the most appropriate fix?

  • A. Ask each agent to run git stash before it starts
  • B. Put all agents on a single shared branch
  • C. Run git bisect at the start of each task
  • D. Give each agent its own Git worktree
Show answer

Answer: D

Git worktrees give each agent its own working directory and branch checked out from the same repository, so the agents stop interfering. Stashing between tasks is manual and does not allow parallel work, a single shared branch makes the conflicts worse, and bisect is a debugging command, not a way to isolate working copies.

Want more questions like this? Full AZ-401 practice tests →

Question 5. A developer deleted a local branch that held three unpushed commits. The work is needed. Which approach recovers it?

  • A. Run git clean to restore the files
  • B. Find the old tip in git reflog and create a branch at that commit
  • C. Run git fetch to download the commits from the remote
  • D. Run git gc with an immediate prune
Show answer

Answer: B

The reflog records where branch tips pointed, so you can find the last commit of the deleted branch and create a new branch at it. Cleaning untracked files does not bring back commits, fetching cannot restore commits that were never pushed, and pruning unreachable objects would make the loss permanent.

Want more questions like this? Full AZ-401 practice tests →

Design and implement build and release pipelines

Question 6. Your team publishes a shared library. The next release changes a method signature in a way that breaks existing callers. The current version is 2.4.1. Which version number follows semantic versioning?

  • A. 2.4.2
  • B. 2.5.0
  • C. 3.0.0
  • D. 2.4.1-breaking
Show answer

Answer: C

Under SemVer a breaking change increments the major version and resets minor and patch, giving 3.0.0. 2.4.2 signals a bug fix, 2.5.0 signals a backward-compatible feature, and 2.4.1-breaking is not a valid way to signal a breaking change to consumers.

Want more questions like this? Full AZ-401 practice tests →

Question 7. In an Azure Artifacts feed, developers publish new package versions many times a day. Consumers should only be able to restore versions that passed integration testing. Which feature fits?

  • A. Promote tested versions to a release view and have consumers use that view
  • B. Create a second feed and copy versions into it by hand
  • C. Delete each untested version manually every evening
  • D. Publish the list of good versions on a wiki page
Show answer

Answer: A

Feed views let you promote a package version to a view such as release once it passes your checks, and consumers restore from that view. A separate feed copied by hand is more work and error-prone, deleting untested versions manually does not scale, and telling consumers to read a wiki does not enforce anything.

Want more questions like this? Full AZ-401 practice tests →

Question 8. Copilot generates unit tests for a service. The team wants to ensure that code coverage cannot silently fall below the agreed threshold. What is the most reliable control?

  • A. Ask Copilot in each pull request whether coverage looks fine
  • B. A pipeline quality gate that fails the build below the coverage threshold
  • C. Trust that generated tests are complete
  • D. Review coverage manually once a quarter
Show answer

Answer: B

A coverage threshold enforced as a quality gate in the pipeline or branch policy is deterministic and blocks the merge when coverage drops. A comment from an AI reviewer is advice, not an enforced gate, and trusting the generated tests or checking coverage once a quarter lets regressions through.

Want more questions like this? Full AZ-401 practice tests →

Question 9. Deployments to the production environment in a YAML pipeline must be approved by the release manager, and must not proceed while a critical monitoring alert is active. What should you configure?

  • A. A comment in the YAML asking people to check alerts
  • B. A pipeline variable that developers set to true when it is safe
  • C. A longer stage timeout
  • D. Approvals and an alert check on the production environment
Show answer

Answer: D

Azure Pipelines environments support approvals and checks, including a check that evaluates monitoring alerts, so the stage waits for both conditions. Separate pipelines with comments, a variable that a developer sets, or a longer timeout do not enforce either condition.

Want more questions like this? Full AZ-401 practice tests →

Question 10. A web app on Azure App Service needs releases with minimal downtime, and the team wants to warm up the new version before users reach it, with a fast way back. Which approach fits?

  • A. Stop the app, deploy, then start it again
  • B. Deploy directly over the running production files
  • C. Deploy to a staging slot, warm it up, then swap
  • D. Rebuild the app from scratch every night
Show answer

Answer: C

Deploying to a staging slot, warming it up and then swapping with production puts the new version live with little downtime, and swapping back is the rollback. Stopping the app for the deployment causes downtime, deploying straight over production gives no warm-up, and a nightly rebuild is not a release strategy.

Want more questions like this? Full AZ-401 practice tests →

Question 11. A critical fix is needed in production within the hour, while main already contains unreleased work. What should the hotfix path look like?

  • A. Branch from the production release, apply the fix, run fast automated checks with expedited approval, then merge back to main
  • B. Release everything on main immediately
  • C. Edit production directly and skip all pipelines
  • D. Wait for the next scheduled release
Show answer

Answer: A

A hotfix branch cut from the code that is in production, with a minimal but still automated set of checks and an expedited approval, ships the fix without the unreleased work, and the fix is then merged back into main. Releasing all of main skips the intent of isolating the change, skipping all tests and approvals removes safety, and waiting for the next scheduled release ignores the urgency.

Want more questions like this? Full AZ-401 practice tests →

Question 12. A pipeline test fails about one run in ten with no code change, and developers re-run the build until it passes. The failures slow every merge. What is the best long-term action?

  • A. Configure the pipeline to retry the whole build up to five times
  • B. Identify the flaky test from run history, quarantine it and fix the cause
  • C. Lower the coverage threshold until the build passes
  • D. Delete the whole test suite
Show answer

Answer: B

Tracking the failure pattern to identify the flaky test, then quarantining and fixing it, restores trust in the pipeline. Automatic re-runs hide the problem and cost time, lowering the coverage threshold or deleting all tests removes protection rather than fixing the cause.

Want more questions like this? Full AZ-401 practice tests →

Design and implement a security and compliance plan

Question 13. A GitHub Actions workflow deploys to Azure and currently uses a client secret stored as a repository secret. You want to remove the stored secret. What should you implement?

  • A. A client secret with a ten-year expiry
  • B. The same secret stored in a plain pipeline variable
  • C. A federated credential so the workflow signs in with its OIDC token
  • D. The secret committed to a private repository
Show answer

Answer: C

Workload identity federation lets the workflow exchange its GitHub OIDC token for an Azure token through a federated credential on the Entra identity, so there is no secret to store or rotate. A longer expiry or a secret in a variable still leaves a credential to leak, and committing the secret to the repository is worse.

Want more questions like this? Full AZ-401 practice tests →

Question 14. An automation must create pull requests across many repositories in your organization. It should not depend on any individual employee's account and should have only the permissions it needs. Which credential fits best?

  • A. A personal access token from a senior engineer
  • B. GITHUB_TOKEN from one repository’s workflow
  • C. A shared administrator account
  • D. A GitHub App installed on the repositories
Show answer

Answer: D

A GitHub App has its own identity with fine-grained permissions, works across repositories and does not depend on a person. A personal access token is tied to a user and tends to be broad and long-lived, GITHUB_TOKEN only covers the repository where the workflow runs, and a shared administrator account is the opposite of least privilege.

Want more questions like this? Full AZ-401 practice tests →

Question 15. An Azure Pipelines deployment needs a database password that you cannot avoid. The password must be centrally managed and rotated, and the pipeline should hold no copy of it. What is the best design?

  • A. Store it in Key Vault and grant the pipeline identity read access to that secret
  • B. Duplicate it as a secret variable in every pipeline
  • C. Keep a secure file per team and update each one by hand
  • D. Email it to the release manager before each deployment
Show answer

Answer: A

Keeping the secret in Azure Key Vault and letting the pipeline identity read it at run time through role-based access (for example the Key Vault Secrets User role) keeps one managed copy. Secret variables in each pipeline create many copies, a secure file per team is hard to rotate, and an email to the release manager is not a control.

Want more questions like this? Full AZ-401 practice tests →

Question 16. Security wants developers blocked from pushing commits that contain credentials, before the secret ever reaches the repository history. Which GitHub Advanced Security capability does this?

  • A. Dependency scanning
  • B. Secret scanning with push protection
  • C. Code scanning with CodeQL on a schedule
  • D. A weekly manual search of the repository
Show answer

Answer: B

Push protection, part of secret scanning, blocks a push that contains a detected secret. Dependency scanning looks for vulnerable libraries, code scanning looks for flaws in your own code, and scanning later does not prevent the secret from entering history in the first place.

Want more questions like this? Full AZ-401 practice tests →

Implement an instrumentation strategy

Question 17. Customers report that checkout is slow. A request passes through a web front end, an API, a payment service and a database. You need to see which hop adds the delay. What should you use?

  • A. The average CPU of the web front end
  • B. A daily count of requests
  • C. Distributed tracing and the transaction view in Application Insights
  • D. The list of recent deployments
Show answer

Answer: C

Distributed tracing in Application Insights shows the end-to-end transaction and the duration of each dependency call, so the slow hop is visible. CPU averages on one server, a count of requests, or the deployment history do not show where time is spent within a request.

Want more questions like this? Full AZ-401 practice tests →

Question 18. A teammate shares this query: AppRequests | where TimeGenerated > ago(1h) | summarize count() by ResultCode | order by count_ desc. What does it return?

  • A. The average duration of each operation in the last day
  • B. Every individual request in the last hour
  • C. The total number of requests since the app was created
  • D. The number of requests per result code in the last hour, highest first
Show answer

Answer: D

It filters to the last hour, counts requests for each result code and sorts the codes from most to fewest. It does not calculate durations, it does not list individual requests, and it is limited to one hour rather than all time.

Want more questions like this? Full AZ-401 practice tests →

Question 19. The Azure SRE Agent reports that a production web app is failing and recommends restarting it. What is the right way to treat this recommendation?

  • A. Verify the evidence in metrics and logs, and act within the approval settings you configured
  • B. Restart immediately, because agents are always right
  • C. Ignore agent findings in production
  • D. Give the agent owner rights so that it can restart anything without review
Show answer

Answer: A

An agent finding is a lead to verify against metrics, logs and traces, and any action should follow the autonomy and approval settings you configured. Acting immediately without checking, ignoring all findings or giving the agent unrestricted rights skips the verification and least-privilege principles.

Want more questions like this? Full AZ-401 practice tests →

Question 20. Compliance requires that you can later review what the GitHub Copilot agent did in your repositories. What should you plan?

  • A. Disable logging to reduce storage cost
  • B. Configure collection of Copilot agent logs and keep them with a suitable retention period
  • C. Ask the agent to summarise its own history when an auditor asks
  • D. Read only the titles of its pull requests
Show answer

Answer: B

To audit agent activity you need to collect its logs, store them where they can be queried and apply a retention period that satisfies the requirement. Turning logging off to save cost removes the evidence, relying on the agent to describe its past actions is not reliable, and reading only pull request titles misses what the agent actually did.

Want more questions like this? Full AZ-401 practice tests →

After the questions

Tally your misses by domain, not in total. If most of your wrong answers are in the pipelines group, that is where the weight is, so go back to the pipelines guide. For the other four areas see processes, source control, security and instrumentation. The cheat sheet condenses the decision rules, and the study plan shows how to spread the weeks. Because the exam is in beta and no official practice assessment exists, treat these questions as a self-test of the outline, not a prediction of the real exam.