AZ-401 sample questions: 5 worked examples
These five scenario questions cover the AZ-401 domains as described in Microsoft’s beta skills outline. Decide first, then open the explanation: the reasons the wrong options fail are the useful part. All questions are original, written from the published outline, and none comes from a real exam. Because AZ-401 is in beta, the outline can change.
Question 1. Your organization lets GitHub Copilot coding agent open pull requests into a repository that deploys to production. Security requires that agent-authored changes get the same scrutiny as human changes. What should you configure?
- A. Give the agent repository admin rights so it can fix failing checks itself
- B. Require pull request reviews and passing status checks through branch protection rules
- C. Disable required status checks for branches the agent creates
- D. Review agent changes after they have been merged
Show answer
Answer: B
Branch protection rules (or branch policies in Azure DevOps) apply to every pull request regardless of author, so requiring review and passing status checks on the protected branch gives agent changes the same gates as human ones. Giving the agent admin rights removes the controls, disabling the checks for agent branches creates a bypass, and reviewing only after the merge detects problems too late.
Want more questions like this? Full AZ-401 practice tests →
Question 2. A GitHub Actions workflow deploys to Azure using a service principal client secret stored as a repository secret. The secret expires every six months and has leaked once already. Which change best removes this risk?
- A. Extend the secret expiry to ten years
- B. Store a copy of the secret in a second repository secret
- C. Replace the client secret with a personal access token
- D. Configure federated credentials so the workflow authenticates with OIDC and no stored secret
Show answer
Answer: D
Workload identity federation lets the workflow exchange its short-lived OIDC token for an Azure access token, so no long-lived secret exists to store, rotate or leak. Longer expiry and encrypted copies still leave a secret to steal, and a personal access token is also a long-lived credential and ties the deployment to one person.
Want more questions like this? Full AZ-401 practice tests →
Question 3. A web app on Azure App Service must be released with almost no downtime, and the team wants to validate the new version with production settings before any user reaches it, with an instant way back. Which approach fits?
- A. Deploy to a staging slot, validate it, then swap slots
- B. Stop the app, copy the new files, then start it
- C. Deploy straight to the production slot during business hours
- D. Redeploy every night and hope the new version works
Show answer
Answer: A
Deploying to a staging slot, warming and validating it, then swapping slots gives a near-zero-downtime release, and swapping back is the rollback. Stopping the app and copying files causes downtime, deploying straight to production skips validation, and a nightly redeploy does not give a controlled switch or a fast rollback.
Want more questions like this? Full AZ-401 practice tests →
Question 4. The Azure SRE Agent has raised an incident that says response times for an API rose after a release. Which first step best follows the intent of an agent-assisted investigation?
- A. Roll back every release from the last month
- B. Delete the alert because the agent may be wrong
- C. Review the evidence the agent cites, such as traces and the deployment timeline, and confirm the cause
- D. Accept the diagnosis and close the incident without looking
Show answer
Answer: C
An agent finding is a lead, not proof: you review the evidence it cites, such as traces, metrics and the deployment timeline, and confirm the cause before acting. Rolling back blindly may fix nothing, deleting the alert hides the problem, and accepting the diagnosis without checking defeats the point of keeping a human accountable.
Want more questions like this? Full AZ-401 practice tests →
Question 5. A team wants an AI assistant in the IDE to read and update Azure Boards work items and GitHub issues using one consistent integration instead of custom scripts per tool. What should they configure?
- A. A custom script for each tool, run by hand
- B. The Azure DevOps and GitHub MCP servers with scoped permissions
- C. A wiki page that describes the work items
- D. One shared personal access token for the whole team
Show answer
Answer: B
MCP servers expose tools and data, such as the Azure DevOps and GitHub MCP servers, to an AI client through a standard protocol, with scoped permissions. Per-tool scripts are the inconsistent approach being replaced, a wiki page does not give an assistant any access, and sharing one person’s personal access token breaks accountability and least privilege.
Want more questions like this? Full AZ-401 practice tests →
Keep going
The domain guides each include three more questions: processes, source control, pipelines, security and instrumentation. Mark weak spots in the study plan.