AZ-401 Cheat Sheet: Portal, CLI and YAML Task Map
Objectives and Microsoft Learn pages checked 2026-10-26
TL;DR
This cheat sheet lists what you are trying to do on the Microsoft AZ-401 exam (Designing and Implementing Microsoft Agentic DevOps Solutions), then the portal path, command or YAML that does it, and the trap attached. Read the trigger-phrase table last, the night before.
Beta notice. Both the exam and the Microsoft Certified: Agentic DevOps Engineer Expert credential are in beta. Passing score is 700, beta exams are not scored immediately, and Microsoft's official Practice Assessment is not currently available. Check the credential page for current status.
MSCertQuiz sells practice-exam access for AZ-401 and other Microsoft/GitHub certifications; this cheat sheet is written by the same team that builds and maintains that question bank.
Control who can deploy, and when
Checks belong to the resource owner and sit outside the YAML file. That single fact decides a large share of gating questions. Use Approvals and checks on the environment or service connection, because checks belong to the resource owner and sit outside the YAML. Approval, branch control, required template, exclusive lock and Azure Monitor alert checks all live there, and they run in categories: static first, then approvals, dynamic checks, and the lock last.
| Task | Path, command or YAML | Exam trap |
|---|---|---|
| Require a human sign-off before a stage hits production | Pipelines > Environments > (environment) > Approvals and checks > Approval | Authors editing YAML cannot remove it. All checks on every resource a stage uses must pass before the stage starts. |
| Allow only one branch to use a protected resource | Approvals and checks > Branch control, allowed branches as refs/heads/main | Branch names must be fully qualified. The check can also require that the branch has protection. |
| Force pipelines to extend a vetted template | Approvals and checks > Required template (repository, ref, path) | A pipeline that does not extend the template fails. Works on service connections as well as environments. |
| Serialize deployments to one environment | Exclusive lock check on the resource + lockBehavior in YAML | runLatest (the default) cancels older queued runs. sequential lets every run take its turn. |
| Gate on production health | Approvals and checks > Query Azure Monitor alerts (dynamic check) | Dynamic checks run in parallel with each other, after static checks. |
| Predict check order | Static (branch control, required template, evaluate artifact) > pre-check approvals > dynamic > post-check approvals > exclusive lock | Categories run one after another. If an earlier category fails, later ones never start, so no approver is notified. |
Sign in to Azure without a stored secret
Pick the identity by where the code runs, then check whether anything long-lived is still being stored. Use federation or a managed identity rather than a stored secret. GitHub Actions and Azure Pipelines sign in with a federated credential or workload identity federation, Azure resources use managed identities, and GitHub API calls use GITHUB_TOKEN with an explicit permissions block. Pick the identity by where the code runs.
| Task | Path, command or YAML | Exam trap |
|---|---|---|
| GitHub Actions to Azure | Federated identity credential on an Entra app or user-assigned managed identity; job permissions: id-token: write; azure/login with client-id, tenant-id, subscription-id | Default token audience is api://AzureADTokenExchange. The three IDs identify the identity; they are not a password. |
| Azure Pipelines to Azure | Azure Resource Manager service connection that uses workload identity federation | Service connections are protected resources, so checks can attach to them. |
| Azure resource calling another Azure resource | System-assigned or user-assigned managed identity | Exists only on an Azure resource. A GitHub-hosted runner is not one. |
| Workflow calling the GitHub API | GITHUB_TOKEN with an explicit permissions block | Reach for a GitHub App or a personal access token only when GITHUB_TOKEN cannot reach the target. |
Stop secrets and vulnerable code reaching main
Azure Repos features and GitHub features have different names. The exam can blend them in one scenario. Turn on GitHub Advanced Security for Azure DevOps, which adds secret scanning, push protection, dependency scanning and CodeQL. Repository scanning finds old secrets, push protection only checks new pushes, and an AdvancedSecurity status check on a branch policy blocks pull requests with findings. Copilot review and Autofix have their own setup traps.
| Task | Path, command or YAML | Exam trap |
|---|---|---|
| Turn on GitHub Advanced Security for Azure DevOps | Repository settings or the organization-level Enable all option | Standalone SKUs: Secret Protection (push protection, alerts) and Code Security (dependency alerts, CodeQL). Azure DevOps Services and Git repos only. |
| Find a secret committed months ago | Repository-level secret scanning (starts when Advanced Security is enabled) | Push protection evaluates only pushes made after it was enabled. |
| Scan dependencies | Dependency scanning pipeline task, or the one-click default-branch setting | Needs Marketplace tasks allowed: Organization settings > Pipelines > Settings > Disable Marketplace tasks must be off. |
| Run CodeQL | AdvancedSecurity-CodeQL-Analyze and AdvancedSecurity-Publish tasks in a pipeline | With several Advanced Security tasks, turn on Wait for Processing on those two. |
| Block a PR on findings | Branch policy > Status checks > AdvancedSecurity / NewHighAndCritical or AllHighAndCritical | NewHighAndCritical ignores the old backlog but needs a build validation policy that runs the Advanced Security tasks. |
| Automatic Copilot review on PRs in Azure Repos | Repos > Branches > Branch policies > Automatically request Copilot code review | Runs on an Azure Pipelines agent pool. Self-hosted pools and Managed DevOps Pools are not supported. |
| Copilot Autofix cannot create its PR | Allow the copilot-autofix/ branch prefix; grant Contribute and Create branch to the GitHub Copilot identity | Author email is noreply@dev.azure.com. A commit-author email policy that rejects it blocks the push. |
Give an AI agent tools without handing over the keys
This is the new ground in AZ-401. Limits must be enforced by configuration, identity or run mode. An instruction in a prompt is not a control. Enforce agent limits through configuration, identity or run mode, never through a prompt. Narrow the Azure DevOps MCP server with toolset and read-only headers, set SRE Agent to Review mode with a scoped managed identity, give the Observability Agent only the roles it needs, and keep agentic workflow writes in safe outputs.
| Task | Path, command or YAML | Exam trap |
|---|---|---|
| Connect an assistant to Azure DevOps | Remote MCP server at https://mcp.dev.azure.com/{organization} (streamable HTTP, Microsoft Entra ID sign-in) | Organizations backed only by a personal Microsoft account are not supported by the remote server. |
| Narrow what the MCP server exposes | Request headers X-MCP-Toolsets (for example repos,wiki,wit), X-MCP-Tools, X-MCP-Readonly: true | Do not combine X-MCP-Tools with X-MCP-Toolsets. Readonly removes write tools at the server. |
| Client cannot do Entra sign-in to the remote server | Local MCP server: Node.js 20+ and npx, stdio transport, PAT or Entra ID | Remote is the recommended first choice when the client supports it. |
| Require approval for agent actions on Azure | Azure SRE Agent > incident response plan > autonomy level: Review or Autonomous | Run mode governs approval. Permissions govern access. The agent needs both. Only SRE Agent Administrators can approve. |
| Limit the SRE Agent blast radius | Role assignments on the agent managed identity | The agent is constrained only by those permissions. It never runs delete or remove commands and blocks az keyvault commands. |
| Autonomous Observability Agent | Observability Agent resource with a managed identity: Issue Contributor on the Azure Monitor workspace, Monitoring Reader on subscriptions | Grant roles to a user-assigned identity before creation, to a system-assigned one after. Custom instructions (8,192 characters) grant nothing and cannot trigger changes. |
| Author a GitHub Agentic Workflow | Markdown file with YAML frontmatter, compiled with gh aw compile | The agent job is read-only by default. Writes happen through safe outputs in separate jobs. |
| Start Copilot coding agent from an Azure Boards work item | Start GitHub Copilot from the work item (Azure Boards to GitHub connection required) | Once started it cannot be cancelled. Manage or discard the resulting pull request in GitHub. |
Fix or move Git history
Know which commands change history and which only add to it. Commands that add commits, such as revert, are safe on shared branches, while rewriting history needs a force-push and fresh clones. Use reflog to recover local commits, worktrees for parallel work, filter-repo or BFG after revoking a leaked secret, and gh gei to move a repository from Azure DevOps to GitHub.
| Task | Path, command or YAML | Exam trap |
|---|---|---|
| Recover commits after a bad reset | git reflog, then git branch rescue <sha> | Local reflog only. It does not exist for a fresh clone. |
| Undo a merge on a shared branch | git revert -m 1 <merge-sha> | Adds a new commit, so teammates are not forced to rewrite anything. |
| Remove a leaked secret from all history | Revoke the secret first, then rewrite with git filter-repo or BFG, force-push, and have everyone re-clone | Revert leaves the secret in history. Rewriting without revoking leaves a live credential. |
| Work on a hotfix beside a feature | git worktree add ../hotfix release/1.4 | Second working directory, one shared object store. |
| Mark a release | git tag -a v1.4.0 -m "release", then git push origin v1.4.0 | A normal push does not send tags. |
| Check code before each commit | .git/hooks/pre-commit, executable; share with git config core.hooksPath | The hooks folder is not versioned, so a shared path is how a team gets one policy. |
| Move a repository from Azure DevOps to GitHub | gh gei migrate-repo with --ado-org, --ado-team-project, --ado-repo, --github-org, --github-repo | Enterprise Live Migrations (preview) uses az devops migrations create and requires cutover within 21 days of the initial sync. |
Ship packages and versions
Feeds are where promotion and upstream rules hide. Publish packages to the feed itself and share validated versions through feed views such as @release, which are read-only filters. Upstream sources save packages on first install, and a version that already exists upstream cannot be published until the upstream is disabled. Use SemVer for compatibility and CalVer for date-based releases.
| Task | Path, command or YAML | Exam trap |
|---|---|---|
| Share only validated package versions | Artifacts feed views: @local, @prerelease, @release | Publish to the feed itself. Views are read-only filters and you cannot publish into one. |
| Consume a public registry safely | Upstream source on the feed | Packages are saved on first install. You cannot publish a version that already exists upstream: disable the upstream, publish, re-enable. |
| Version a library or pipeline artifact | SemVer MAJOR.MINOR.PATCH, or CalVer for date-based releases | SemVer signals compatibility. CalVer signals recency. |
Measure and investigate
Queries below target the Application Insights Logs schema. Query the Application Insights Logs schema, where the requests table holds inbound calls and dependencies holds outbound ones. Filter failures with success == false, use percentile with bin for tail latency, and union requests, dependencies, exceptions and traces on operation_Id to follow one request across services.
| Task | Path, command or YAML | Exam trap |
|---|---|---|
| Failed requests by operation, last hour | requests | where timestamp > ago(1h) and success == false | summarize count() by name | The requests table is inbound calls. dependencies is outbound. |
| 95th percentile latency by 5 minutes | requests | summarize percentile(duration, 95) by bin(timestamp, 5m) | Percentiles expose tail latency that an average hides. |
| Follow one request across services | union requests, dependencies, exceptions, traces | where operation_Id == "<id>" | order by timestamp asc | Distributed tracing correlates on operation_Id across services. |
If the question says this, think that
Each row pairs a scenario phrase with the answer it usually points to. Most rows come down to one idea: put the control where the author of the YAML or the agent cannot remove it, such as a resource-level check, a scoped identity, a read-only setting or a revoked secret.
| Phrase in the scenario | Answer it points to |
|---|---|
| Developers can edit the pipeline YAML, and a gate is required | Approvals and checks on the environment or service connection, not a YAML condition |
| No credentials to rotate, workload runs on GitHub-hosted runners | Federated credential with OIDC, not a managed identity on the runner |
| A secret was committed long ago | Repository scanning finds history, push protection only blocks new pushes |
| Fail the PR only for newly introduced high findings | AdvancedSecurity / NewHighAndCritical status check plus build validation |
| Each deployment carries ordered, non-cumulative changes | Exclusive lock with lockBehavior: sequential |
| Humans must approve before the agent changes Azure | Review run mode, plus a narrowly scoped managed identity |
| The agent must be unable to write | Read-only MCP header, read-only run mode or safe outputs, not a prompt rule |
| Copilot review on PRs, builds run on a self-hosted pool | Unsupported pool type: pick a supported pool for the review job |
| Credential already pushed to shared history | Revoke first, then rewrite history and force-push |
| Consumers should receive only tested packages | Promote to an @release view and point consumers at it |
| Latency spike somewhere in a chain of services | Application Insights distributed tracing on operation_Id |
What Microsoft publishes about weighting
Domain weights below come from Microsoft's AZ-401 study guide. This draft deliberately omits exam price, duration and question count because the pages checked do not state them. Confirm those on Microsoft Learn before you book.
| Domain | Weight |
|---|---|
| Design and implement build and release pipelines | 35-40% |
| Design and implement processes and communications | 15-20% |
| Design and implement a security and compliance plan | 15-20% |
| Implement an instrumentation strategy | 15-20% |
| Design and implement a source control strategy | 10-15% |
Turn the table rows into reflexes
A cheat sheet only helps if the trap rows come to mind under time pressure. Work scenario questions on the same rows in the AZ-401 practice quiz, or check where you stand with the AZ-401 readiness quiz. The free question set with full rationale and the study guide cover the same ground in prose. See the AZ-401 certification page or browse all certifications.
Sources: Approvals and checks, remote Azure DevOps MCP Server, SRE Agent run modes.