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.

TaskPath, command or YAMLExam trap
Require a human sign-off before a stage hits productionPipelines > Environments > (environment) > Approvals and checks > ApprovalAuthors 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 resourceApprovals and checks > Branch control, allowed branches as refs/heads/mainBranch names must be fully qualified. The check can also require that the branch has protection.
Force pipelines to extend a vetted templateApprovals 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 environmentExclusive lock check on the resource + lockBehavior in YAMLrunLatest (the default) cancels older queued runs. sequential lets every run take its turn.
Gate on production healthApprovals and checks > Query Azure Monitor alerts (dynamic check)Dynamic checks run in parallel with each other, after static checks.
Predict check orderStatic (branch control, required template, evaluate artifact) > pre-check approvals > dynamic > post-check approvals > exclusive lockCategories 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.

TaskPath, command or YAMLExam trap
GitHub Actions to AzureFederated identity credential on an Entra app or user-assigned managed identity; job permissions: id-token: write; azure/login with client-id, tenant-id, subscription-idDefault token audience is api://AzureADTokenExchange. The three IDs identify the identity; they are not a password.
Azure Pipelines to AzureAzure Resource Manager service connection that uses workload identity federationService connections are protected resources, so checks can attach to them.
Azure resource calling another Azure resourceSystem-assigned or user-assigned managed identityExists only on an Azure resource. A GitHub-hosted runner is not one.
Workflow calling the GitHub APIGITHUB_TOKEN with an explicit permissions blockReach 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.

TaskPath, command or YAMLExam trap
Turn on GitHub Advanced Security for Azure DevOpsRepository settings or the organization-level Enable all optionStandalone SKUs: Secret Protection (push protection, alerts) and Code Security (dependency alerts, CodeQL). Azure DevOps Services and Git repos only.
Find a secret committed months agoRepository-level secret scanning (starts when Advanced Security is enabled)Push protection evaluates only pushes made after it was enabled.
Scan dependenciesDependency scanning pipeline task, or the one-click default-branch settingNeeds Marketplace tasks allowed: Organization settings > Pipelines > Settings > Disable Marketplace tasks must be off.
Run CodeQLAdvancedSecurity-CodeQL-Analyze and AdvancedSecurity-Publish tasks in a pipelineWith several Advanced Security tasks, turn on Wait for Processing on those two.
Block a PR on findingsBranch policy > Status checks > AdvancedSecurity / NewHighAndCritical or AllHighAndCriticalNewHighAndCritical ignores the old backlog but needs a build validation policy that runs the Advanced Security tasks.
Automatic Copilot review on PRs in Azure ReposRepos > Branches > Branch policies > Automatically request Copilot code reviewRuns on an Azure Pipelines agent pool. Self-hosted pools and Managed DevOps Pools are not supported.
Copilot Autofix cannot create its PRAllow the copilot-autofix/ branch prefix; grant Contribute and Create branch to the GitHub Copilot identityAuthor 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.

TaskPath, command or YAMLExam trap
Connect an assistant to Azure DevOpsRemote 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 exposesRequest headers X-MCP-Toolsets (for example repos,wiki,wit), X-MCP-Tools, X-MCP-Readonly: trueDo 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 serverLocal MCP server: Node.js 20+ and npx, stdio transport, PAT or Entra IDRemote is the recommended first choice when the client supports it.
Require approval for agent actions on AzureAzure SRE Agent > incident response plan > autonomy level: Review or AutonomousRun mode governs approval. Permissions govern access. The agent needs both. Only SRE Agent Administrators can approve.
Limit the SRE Agent blast radiusRole assignments on the agent managed identityThe agent is constrained only by those permissions. It never runs delete or remove commands and blocks az keyvault commands.
Autonomous Observability AgentObservability Agent resource with a managed identity: Issue Contributor on the Azure Monitor workspace, Monitoring Reader on subscriptionsGrant 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 WorkflowMarkdown file with YAML frontmatter, compiled with gh aw compileThe agent job is read-only by default. Writes happen through safe outputs in separate jobs.
Start Copilot coding agent from an Azure Boards work itemStart 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.

TaskPath, command or YAMLExam trap
Recover commits after a bad resetgit reflog, then git branch rescue <sha>Local reflog only. It does not exist for a fresh clone.
Undo a merge on a shared branchgit revert -m 1 <merge-sha>Adds a new commit, so teammates are not forced to rewrite anything.
Remove a leaked secret from all historyRevoke the secret first, then rewrite with git filter-repo or BFG, force-push, and have everyone re-cloneRevert leaves the secret in history. Rewriting without revoking leaves a live credential.
Work on a hotfix beside a featuregit worktree add ../hotfix release/1.4Second working directory, one shared object store.
Mark a releasegit tag -a v1.4.0 -m "release", then git push origin v1.4.0A normal push does not send tags.
Check code before each commit.git/hooks/pre-commit, executable; share with git config core.hooksPathThe hooks folder is not versioned, so a shared path is how a team gets one policy.
Move a repository from Azure DevOps to GitHubgh gei migrate-repo with --ado-org, --ado-team-project, --ado-repo, --github-org, --github-repoEnterprise 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.

TaskPath, command or YAMLExam trap
Share only validated package versionsArtifacts feed views: @local, @prerelease, @releasePublish to the feed itself. Views are read-only filters and you cannot publish into one.
Consume a public registry safelyUpstream source on the feedPackages 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 artifactSemVer MAJOR.MINOR.PATCH, or CalVer for date-based releasesSemVer 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.

TaskPath, command or YAMLExam trap
Failed requests by operation, last hourrequests | where timestamp > ago(1h) and success == false | summarize count() by nameThe requests table is inbound calls. dependencies is outbound.
95th percentile latency by 5 minutesrequests | summarize percentile(duration, 95) by bin(timestamp, 5m)Percentiles expose tail latency that an average hides.
Follow one request across servicesunion requests, dependencies, exceptions, traces | where operation_Id == "<id>" | order by timestamp ascDistributed 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 scenarioAnswer it points to
Developers can edit the pipeline YAML, and a gate is requiredApprovals and checks on the environment or service connection, not a YAML condition
No credentials to rotate, workload runs on GitHub-hosted runnersFederated credential with OIDC, not a managed identity on the runner
A secret was committed long agoRepository scanning finds history, push protection only blocks new pushes
Fail the PR only for newly introduced high findingsAdvancedSecurity / NewHighAndCritical status check plus build validation
Each deployment carries ordered, non-cumulative changesExclusive lock with lockBehavior: sequential
Humans must approve before the agent changes AzureReview run mode, plus a narrowly scoped managed identity
The agent must be unable to writeRead-only MCP header, read-only run mode or safe outputs, not a prompt rule
Copilot review on PRs, builds run on a self-hosted poolUnsupported pool type: pick a supported pool for the review job
Credential already pushed to shared historyRevoke first, then rewrite history and force-push
Consumers should receive only tested packagesPromote to an @release view and point consumers at it
Latency spike somewhere in a chain of servicesApplication 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.

DomainWeight
Design and implement build and release pipelines35-40%
Design and implement processes and communications15-20%
Design and implement a security and compliance plan15-20%
Implement an instrumentation strategy15-20%
Design and implement a source control strategy10-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.