All Microsoft exams

Free AZ-401 practice test: 30 questions with answers

30 original questions for Designing and Implementing Microsoft Agentic DevOps Solutions (beta), drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.

Free questions
30
Full bank
100 questions

AZ-401 exam guide: topics, cost and format

All 30 AZ-401 questions with answers

The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.

Design and implement build and release pipelines (6 questions)

  1. Question 1

    In an Azure Pipelines YAML file, which key starts a run automatically when commits reach the main branch?

    1. Apool
    2. Bschedules
    3. Ctrigger
    4. Dresources
    Show answer and explanation
    Correct answer: C

    The trigger key defines which branch pushes start the pipeline automatically. schedules runs on a timer, resources declare external dependencies such as repositories or pipelines, and pool selects the agent pool.

  2. Question 2

    A set of build steps is used by many pipelines and must be maintained in one file. Which Azure Pipelines YAML keyword references that reusable file?

    1. Aimport
    2. Binclude
    3. Creuse
    4. Dtemplate
    Show answer and explanation
    Correct answer: D

    The template keyword references a reusable YAML file that can be included at stage, job or step level. include, import and reuse are not keywords used for template references in Azure Pipelines YAML.

  3. Question 3

    A pipeline needs database connection secrets from Azure Key Vault, without storing them in the YAML file. What should be configured?

    1. AA variable group linked to the Azure Key Vault
    2. BThe secret in the pipeline's display name
    3. CHardcoded secrets in the YAML file marked as comments
    4. DA .env file committed to the repository
    Show answer and explanation
    Correct answer: A

    A variable group linked to Key Vault pulls the secret values at run time, so the YAML stays free of secrets. Hardcoded values, committed environment files and display names all expose the secret.

  4. Question 4

    A pipeline deploys to Azure and must authenticate without a stored client secret. Which service connection type is recommended?

    1. APersonal access token typed into YAML
    2. BWorkload identity federation service connection
    3. CA developer's personal account credentials
    4. DService principal with a client secret in pipeline variables
    Show answer and explanation
    Correct answer: B

    Workload identity federation exchanges short-lived tokens between the pipeline and Entra ID, so no long-lived secret is needed. The other options store long-lived secrets or personal credentials, which are harder to rotate and audit.

  5. Question 5

    Production deployments must pause until a release manager approves them. Which configuration achieves this?

    1. ARequire commit signing for the deployment
    2. BAdd a fixed wait timer in the pipeline schedule
    3. CCreate a branch named prod and deploy from it
    4. DAdd approvals and checks to the production environment
    Show answer and explanation
    Correct answer: D

    Approvals and checks on an environment hold the deployment until the named approvers respond. A branch name, a schedule delay and commit signing do not require a person to approve the deployment.

  6. Question 6

    Which two statements about deployment strategies are correct? (Choose two.)

    1. AFeature flags require a redeploy each time they are switched
    2. BBlue-green deployment keeps the previous environment available for a quick rollback
    3. CCanary releases send a small share of traffic to the new version first
    4. DRolling updates always cause downtime
    5. ERecreate deployments provide zero downtime
    Show answer and explanation
    Correct answer: B, C

    Blue-green keeps the old environment ready for rollback, and canary releases limit exposure by sending a fraction of traffic first. Rolling updates can avoid downtime, recreate deployments stop the old version first, and feature flags are switched without redeploying.

Design and implement a source control strategy (6 questions)

  1. Question 7

    A repository must route pull requests that touch the /infra folder automatically to the platform team for review. Which file should be used?

    1. Agitignore
    2. Bworkflow env file
    3. Cdependabot.yml
    4. DCODEOWNERS
    Show answer and explanation
    Correct answer: D

    A CODEOWNERS file maps paths to owners, and GitHub and Azure Repos can request their review on matching pull requests. .gitignore excludes files from tracking, dependabot.yml configures dependency updates, and the workflow env file sets variables.

  2. Question 8

    A repository contains large binary design files that must be versioned without bloating the normal Git history. Which tool is designed for this?

    1. AGit submodules
    2. Bgit stash
    3. Cgit bisect
    4. DGit LFS
    Show answer and explanation
    Correct answer: D

    Git LFS stores large files outside the normal object store and keeps lightweight pointers in the history. Submodules link separate repositories, stash saves uncommitted work, and bisect finds the commit that introduced a bug.

  3. Question 9

    A team wants each feature branch to land on main as one clean commit. Which merge strategy does this?

    1. ACherry-pick each commit manually
    2. BFast-forward only
    3. CSquash merge
    4. DOctopus merge
    Show answer and explanation
    Correct answer: C

    A squash merge combines all commits from the feature branch into a single commit on the target branch. Fast-forward only keeps the individual commits, octopus merges combine many branches at once, and manual cherry-picking is error-prone.

  4. Question 10

    A developer accidentally commits an API token to a GitHub repository. Which control blocks such pushes before they land?

    1. ASecret scanning with push protection
    2. BDependabot version updates for npm
    3. CDefault CodeQL analysis workflow
    4. DRequired code review comments
    Show answer and explanation
    Correct answer: A

    Secret scanning with push protection checks pushes for known secret patterns and blocks them before they reach the repository. Dependabot updates libraries, CodeQL finds code vulnerabilities, and review comments do not stop a push.

  5. Question 11

    Pull requests must not be merged into main until the build and tests pass. Which branch protection setting enforces this?

    1. ARequire signed commits with verified GPG or SSH keys
    2. BRequire linear history with squash or rebase merges
    3. CAllow force pushes for administrators
    4. DRequire status checks to pass before merging
    Show answer and explanation
    Correct answer: D

    Required status checks block the merge until the named builds or tests report success. Signed commits verify authorship, force-push settings govern history rewriting, and linear history controls merge shape but not test results.

  6. Question 12

    Which two controls help enforce review policy on protected branches in Azure Repos or GitHub? (Choose two.)

    1. ABranch policies requiring a minimum number of reviewers
    2. BRequired status checks before a merge
    3. CA wiki page listing recommended practices
    4. DA shared repository administrator password
    5. EEmail reminders sent to reviewers
    Show answer and explanation
    Correct answer: A, B

    Branch policies with minimum reviewers and required status checks are enforced by the platform before a merge completes. A wiki page and reminder emails only advise, and a shared administrator password is an insecure access practice.

Design and implement processes and communications (6 questions)

  1. Question 13

    A team wants commits and pull requests to link automatically to Azure Boards work items. Which convention achieves this?

    1. AInclude AB# followed by the work item number in the commit message or pull request title
    2. BAdd the work item ID to the repository name so the sprint board and cards pick up related changes
    3. CTag the release manually after each sprint review, typing the version label into the Git tags page.
    4. DCreate a service hook that emails the product owner and the scrum master each time a sprint review.
    Show answer and explanation
    Correct answer: A

    The AB# mention in commit messages and pull request titles creates a link between the code change and the work item. Repository names and manual tags do not create those links, and email hooks only notify people.

  2. Question 14

    Which practice most directly reduces batch size and cycle time in a DevOps workflow?

    1. AQuarterly release freezes with manual sign-off by the lead
    2. BTrunk-based development with small, frequent merges
    3. CBig-bang integration of every module in the staging environment
    4. DLong-lived feature branches merged into main at release time
    Show answer and explanation
    Correct answer: B

    Small frequent merges to a shared trunk surface integration problems early and shorten the time from change to production. Long-lived branches, freezes and big-bang integration all increase batch size and delay feedback.

  3. Question 15

    After a production incident, the operations and development teams need to learn from it without assigning personal blame. Which practice fits?

    1. AA change advisory board review for every commit
    2. BA quarterly penetration test
    3. CA blameless postmortem with shared action items
    4. DA manual test sign-off by one person
    Show answer and explanation
    Correct answer: C

    Blameless postmortems focus on system causes and shared follow-up actions, which improves future reliability. Change boards for every commit slow delivery, penetration tests are periodic security checks, and single sign-off does not address learning.

  4. Question 16

    Stakeholders must be notified by email when a work item they follow changes state in Azure Boards. Which feature provides this?

    1. AArtifact feeds for NuGet and npm
    2. BDeployment groups for VM targets
    3. CNotifications and subscriptions
    4. DService connections to Azure DevOps
    Show answer and explanation
    Correct answer: C

    Notifications and subscriptions let users and teams follow work items and receive alerts on changes. Service connections link pipelines to external services, deployment groups target machines, and artifact feeds store packages.

  5. Question 17

    Which two practices improve collaboration between development and operations teams? (Choose two.)

    1. AShared ownership of production incidents and on-call rotation
    2. BSeparate teams with no access to production logs
    3. CHandoffs through a ticket queue only
    4. DRestricting developers from viewing pipeline runs
    5. EShared dashboards showing deployments and incidents
    Show answer and explanation
    Correct answer: A, E

    Shared dashboards and shared incident ownership give both teams the same view of production health and responsibility. Blocking log access, ticket-only handoffs and hiding pipeline runs create silos that slow recovery.

  6. Question 18

    A DevOps team tracks the DORA metric that measures the time from a code commit to that change running in production. Which metric is this?

    1. AChange failure rate
    2. BMean time to recovery
    3. CDeployment frequency
    4. DLead time for changes
    Show answer and explanation
    Correct answer: D

    Lead time for changes measures how long a committed change takes to reach production. Mean time to recovery measures how quickly service is restored after a failure, change failure rate measures the share of deployments that cause problems, and deployment frequency counts how often deployments happen.

Design and implement a security and compliance plan (6 questions)

  1. Question 19

    Which two actions secure a pipeline's access to Azure resources? (Choose two.)

    1. AShare one personal access token across all projects
    2. BUse workload identity federation instead of stored secrets
    3. CScope the service connection to a specific resource group
    4. DGrant Owner at the root management group to every pipeline
    Show answer and explanation
    Correct answer: B, C

    Federated credentials avoid stored secrets, and scoping the connection limits what a compromised pipeline can reach. Root-level Owner and shared tokens give far more access than a pipeline needs.

  2. Question 20

    A security team wants to find misconfigured infrastructure code and exposed secrets across repositories from one place. Which service fits?

    1. AAzure Cost Management and Billing budget alerts
    2. BAzure Load Testing service for web endpoints
    3. CMicrosoft Defender for Cloud DevOps security
    4. DAzure Site Recovery replication for virtual machines
    Show answer and explanation
    Correct answer: C

    Defender for Cloud's DevOps security capability scans connected repositories and pipelines for code, IaC and secret issues. The other services cover cost, load testing and disaster recovery rather than DevOps security posture.

  3. Question 21

    A compliance audit requires a list of every software component inside each build artifact. Which deliverable should the pipeline produce?

    1. AAn hourly key rotation log file
    2. BA software bill of materials (SBOM)
    3. CA list of open firewall ports
    4. DA certificate rotation schedule
    Show answer and explanation
    Correct answer: B

    An SBOM enumerates the components and versions in an artifact, which supports audits and vulnerability tracking. Firewall ports, certificate schedules and key logs do not describe software components.

  4. Question 22

    An Azure Policy must prevent creation of resources that do not meet a required tag standard. Which policy effect blocks the request?

    1. AAudit
    2. BDeny
    3. CDeployIfNotExists
    4. DAuditIfNotExists
    Show answer and explanation
    Correct answer: B

    The Deny effect blocks a non-compliant request before the resource is created. Audit only reports non-compliance, AuditIfNotExists reports missing related resources, and DeployIfNotExists remediates by deploying resources rather than blocking.

  5. Question 23

    Which two actions reduce the risk from compromised developer credentials? (Choose two.)

    1. ARequire phishing-resistant authentication for administrator accounts
    2. BShare developer accounts across the team
    3. CDisable audit logs to reduce noise
    4. DEnforce MFA through Conditional Access
    Show answer and explanation
    Correct answer: A, D

    MFA through Conditional Access and phishing-resistant methods for privileged accounts make stolen passwords much less useful. Shared accounts remove accountability, and disabling audit logs removes the evidence needed to detect misuse.

  6. Question 24

    A repository should receive pull requests that upgrade dependencies with known vulnerabilities automatically. Which GitHub feature does this?

    1. ASecret scanning alerts
    2. BDependabot security updates
    3. CCode scanning default setup
    4. DCodespaces prebuilds
    Show answer and explanation
    Correct answer: B

    Dependabot security updates open pull requests that upgrade vulnerable dependencies to fixed versions. Secret scanning finds credentials, code scanning finds code issues, and Codespaces prebuilds speed up development environments.

Implement an instrumentation strategy (6 questions)

  1. Question 25

    A team needs to follow one user request across several microservices to find which call introduced latency. Which Application Insights capability provides this?

    1. ADistributed tracing with end-to-end transaction view
    2. BDaily cost reports grouped by resource group
    3. CStatic code analysis of source files and tests
    4. DBackup retention reports for recovery vaults
    Show answer and explanation
    Correct answer: A

    Distributed tracing correlates telemetry across services with a shared operation ID, so the end-to-end transaction shows where time was spent. Cost reports, code analysis and backup reports do not trace requests across services.

  2. Question 26

    Which query language is used to analyze logs and telemetry stored in Azure Monitor Log Analytics?

    1. AKusto Query Language (KQL)
    2. BPromQL only
    3. CLucene query syntax only
    4. DT-SQL only
    Show answer and explanation
    Correct answer: A

    Log Analytics uses Kusto Query Language, known as KQL, to query tables of logs and telemetry. The other languages are used by different products and are not the native query language here.

  3. Question 27

    A web app must report unhandled exceptions and dependency failures to Application Insights with no code changes beyond enabling the agent. Which capability does this?

    1. AAuto-instrumentation agent
    2. BCustom metrics loaded from a CSV file
    3. CAvailability test only
    4. DDeleting the Log Analytics workspace
    Show answer and explanation
    Correct answer: A

    The auto-instrumentation agent collects exceptions, requests and dependency calls without code changes. An availability test checks endpoints from outside, CSV metrics are not an instrumentation method, and deleting a workspace removes the data store.

  4. Question 28

    An alert must run a KQL query on a schedule and fire when the result exceeds a threshold. Which Azure Monitor alert type fits?

    1. AService Health advisory
    2. BMetric alert on a static threshold
    3. CActivity log alert
    4. DLog search alert rule
    Show answer and explanation
    Correct answer: D

    A log search alert rule runs a KQL query at an interval and triggers when results meet a condition. Activity log alerts watch control-plane events, metric alerts evaluate numeric metrics, and Service Health advisories report platform events.

  5. Question 29

    A team wants the 95th percentile of response time for its web API. Which measure should be queried?

    1. ATotal requests per day, by endpoint
    2. BAverage CPU utilization of the web tier
    3. CPercentile aggregation of request duration
    4. DFree disk space percentage on the host
    Show answer and explanation
    Correct answer: C

    A percentile aggregation over request duration gives the value below which 95 percent of requests complete. Averages hide tail latency, and CPU, request counts and disk space do not describe response time.

  6. Question 30

    Which two kinds of telemetry can Application Insights collect? (Choose two.)

    1. APrinted monthly reports
    2. BVideo recordings of users
    3. CSource code diffs
    4. DTraces
    5. EMetrics
    Show answer and explanation
    Correct answer: D, E

    Application Insights collects traces (logs), metrics, requests, exceptions and dependencies as telemetry. Printed reports, video and code diffs are not telemetry types it collects.