🔥 40% Off Crucial Exams Memberships — This Week Only

3 days, 14 hours remaining!
00:20:00

Microsoft DevOps Engineer Expert Practice Test (AZ-400)

Use the form below to configure your Microsoft DevOps Engineer Expert Practice Test (AZ-400). The practice test can be configured to only include certain exam objectives and domains. You can choose between 5-100 questions and set a time limit.

Logo for Microsoft DevOps Engineer Expert AZ-400
Questions
Number of questions in the practice test
Free users are limited to 20 questions, upgrade to unlimited
Seconds Per Question
Determines how long you have to finish the practice test
Exam Objectives
Which exam objectives should be included in the practice test

Microsoft DevOps Engineer Expert AZ-400 Information

Microsoft DevOps Engineer Expert (AZ-400) Overview

The Microsoft DevOps Engineer Expert (AZ-400) exam tests your ability to bring development and operations teams together. It focuses on designing and implementing continuous integration, delivery, and feedback within Microsoft Azure. Candidates are expected to know how to plan DevOps strategies, manage source control, build pipelines, and ensure security and compliance in software development. The goal of the certification is to prove that you can help organizations deliver software faster, more reliably, and with better quality.

What You’ll Learn and Be Tested On

This exam covers a wide range of topics that reflect real-world DevOps work. You will learn about configuring pipelines in Azure DevOps, managing infrastructure as code, and using version control systems like Git. You will also explore how to set up testing strategies, monitor system performance, and use automation to improve reliability. Since DevOps is about collaboration, the AZ-400 also tests your ability to communicate effectively across development, operations, and security teams.

Who Should Take the Exam

The AZ-400 certification is meant for professionals who already have experience in both software development and IT operations. You should be comfortable using Azure tools and services before taking the test. Microsoft recommends that you already hold either the Azure Administrator Associate or the Azure Developer Associate certification. This ensures that you have the foundational knowledge needed to succeed in the DevOps Engineer role.

Why Practice Tests Are Important

Taking practice tests is one of the best ways to prepare for the AZ-400 exam. They help you understand the question format and identify areas where you need more study. Practice tests simulate the real exam environment, which can reduce anxiety and boost your confidence on test day. They also help you improve time management and ensure you can apply your knowledge under pressure. Regularly reviewing your results from practice exams makes it easier to track your progress and focus on weak areas.

Microsoft DevOps Engineer Expert AZ-400 Logo
  • Free Microsoft DevOps Engineer Expert AZ-400 Practice Test

  • 20 Questions
  • Unlimited time
  • Design and implement processes and communications
    Design and implement a source control strategy
    Design and implement build and release pipelines
    Develop a security and compliance plan
    Implement an instrumentation strategy
Question 1 of 20

You are designing an Azure Pipelines YAML definition with two stages, Build and Test. The Test stage uses a matrix strategy to run jobs across multiple platforms. You need to ensure the Test stage only begins after the Build stage completes successfully, and that the entire pipeline fails if any job in the Test stage's matrix fails. Which YAML structure correctly implements these requirements?

  • Define the Test stage with dependsOn: Build and condition: always().

  • Define the Test stage with condition: succeeded('Build') but without a dependsOn property.

  • Add continueOnError: true to the job within the Test stage's matrix.

  • Define the Test stage with a dependsOn: Build property and no custom condition.

Question 2 of 20

Your organization keeps a 15-GB monorepo in Azure Repos Git that has grown over eight years. New developers on Windows report that initial clone and subsequent fetch operations take an unacceptably long time. You must recommend a solution that reduces onboarding time, leaves the commit history intact, and automatically performs background maintenance such as repack and garbage collection while remaining fully compatible with standard Git commands. What should you recommend?

  • Move all historical content to Git Large File Storage (LFS) and keep only pointers in the repository.

  • Configure sparse checkout patterns so that each developer pulls only the folders they need.

  • Have developers install and register the repository with Scalar to enable partial cloning and automated maintenance.

  • Migrate the repository to Team Foundation Version Control (TFVC) to avoid Git scalability limits.

Question 3 of 20

Your organization uses Azure Boards for backlog management and GitHub Enterprise Cloud for source control. You need to implement GitHub Flow so that every commit pushed to the main branch is automatically linked to the corresponding Azure Boards work item, providing end-to-end traceability without requiring developers to open Azure Boards. Which action should you take to meet this requirement?

  • Install the Azure Boards app for the GitHub organization and instruct developers to include the pattern AB# in commit messages or pull-request titles.

  • Create a client-side Git hook that calls the Azure DevOps REST API to associate each commit with the selected work item.

  • Add a custom GitHub Action that parses commits after each push and updates Azure Boards work items through the Boards API.

  • Enable repository-level branch protection in Azure Boards and configure it to require an associated work item on every push.

Question 4 of 20

A company uses a single Azure DevOps organization that already contains several projects. External consultants must be able to read code in any existing or future repository, but they must not access Boards, Pipelines, Test Plans, or change repository settings. You need to configure Azure DevOps so that administrators add each consultant only once and no additional maintenance is required when new projects are created. What should you do?

  • Add each consultant as a Stakeholder in every current and future project.

  • Add the consultants to the Project Collection Build Service group at the organization level.

  • Create a custom Contributors group inside each project and grant it read-only permissions on the repositories.

  • Create a custom security group at the organization level, grant it only the Code → Read permission, and add the consultants to that group.

Question 5 of 20

You manage an Azure DevOps Git repository that contains a main branch and dozens of long-lived feature branches. You must redesign the pull-request (PR) workflow for main to meet these requirements:

  • Every PR must build and run unit tests in an Azure Pipelines build before it can be approved.
  • At least two members of the Backend Leads Azure DevOps security group must approve the PR before it can be completed.
  • All active discussion threads must be resolved before merge.
  • After all policies succeed, developers should be able to click Complete once and have the PR merge automatically when the remaining checks finish.

Which single configuration action meets all the requirements?

  • On the main branch, add a Build Validation policy that automatically queues the unit-test pipeline and mark it as Required; add the Backend Leads group as Required reviewers with a minimum of 2; enable Comment resolution required, and leave Auto-complete enabled.

  • Create a status-check policy that listens for succeeded events from the unit-test pipeline; set the minimum reviewer count to 2 but leave the Required reviewers list empty; do not enable Comment resolution required.

  • Require squash merges and enforce linked work items; configure a Build Validation policy set to optional so that developers can manually queue the pipeline; add Backend Leads as optional reviewers.

  • Enable a branch lock on main; require that feature branches be rebased on the latest main before completion; rely on pipeline branch triggers to run unit tests after the merge.

Question 6 of 20

Your company builds multiple JavaScript microservices in Azure DevOps. Security policy requires that any third-party npm package be stored in an internal repository so that future removals from the public registry do not break builds. In addition, only versions explicitly approved by release engineering may be consumed by production pipelines while development teams should be able to test newer versions quickly. Which approach meets these requirements with minimal administrative effort?

  • Add a service connection to npmjs.org and lock all package.json dependencies to specific build numbers to prevent unintended changes.

  • Publish internal packages to a GitHub Packages npm registry for each project and let package.json reference npmjs.org directly for open-source dependencies.

  • Create a single Azure Artifacts npm feed, add npmjs.org as an upstream source, and use feed views to promote packages through Development and Production stages.

  • Mirror the entire npmjs.org registry to an Azure Blob Storage static website and configure it as a private npm registry for all pipelines.

Question 7 of 20

You maintain several Azure Pipelines that run nightly integration tests against six different database versions. The tests are defined in a single YAML job that uses a matrix strategy, so six parallel Microsoft-hosted agents start each time the pipeline runs. Management wants to keep the test coverage unchanged but limit the number of simultaneously billed Microsoft-hosted jobs to two in order to lower costs. Which YAML change should you implement to meet the requirement?

  • Change the pool definition from Microsoft-hosted to self-hosted agents.

  • Configure a condition that runs the job only when the variable Agent.JobServerParallelism equals 2.

  • Add the setting "maxParallel: 2" under the job's matrix strategy.

  • Insert "dependsOn" references so each matrix job waits for the previous job to finish.

Question 8 of 20

Your team's Azure Repos Git repository has a shared branch named feature-alpha. A teammate accidentally executed git reset --hard HEAD~3 followed by git push --force, removing the last three commits from the remote branch. You have an existing local clone of the repository and just ran git fetch. You must now restore feature-alpha on the server. Which Git command should you run first in your local repository to locate the lost commit IDs?

  • git fetch --force origin feature-alpha

  • git revert HEAD~3..HEAD

  • git reflog origin/feature-alpha

  • git cherry-pick origin/feature-alpha@{1}

Question 9 of 20

Your Azure DevOps project contains a single-stage YAML pipeline that is triggered by every push to the main branch. During periods of high activity, developers often push several commits within a few minutes, leading to multiple runs being queued and unnecessary consumption of Microsoft-hosted agents. You must ensure that no more than one run of this pipeline executes at any time and that any in-progress or queued run is automatically cancelled when a newer commit is detected, thereby reducing agent usage charges and queue length.

Which YAML modification should you implement to meet this requirement?

  • Configure the pool section with demands that set minimumParallelJobs to 1.

  • Enable batching by adding batch: true to the continuous-integration trigger.

  • Add a root-level concurrency block that specifies a shared group name and sets cancelInProgress to true.

  • Define a retention policy with minimumRuns: 1 and days: 0 to keep only the latest successful run.

Question 10 of 20

Your organization manages work tracking in Azure DevOps and hosts source code in a GitHub Enterprise Cloud organization.

  • Finance analysts must be able to create and edit work items, run queries, and view dashboards, but they must not read repositories or trigger pipelines.
  • A contracted UX designer needs to clone, create branches, and push changes to a single repository, but must not gain access to any other organization resources.

Which combination of access assignments meets these requirements while following the principle of least privilege?

  • Give the finance analysts Basic access in Azure DevOps and invite the UX designer as an outside collaborator with read-only permission on the required repository.

  • Give the finance analysts Stakeholder access in Azure DevOps and assign the UX designer to a team inside the GitHub organization that grants read access across all repositories.

  • Give the finance analysts Basic access in Azure DevOps and add the UX designer to the GitHub organization as a member with write permission on the repository.

  • Give the finance analysts Stakeholder access in Azure DevOps and invite the UX designer as an outside collaborator with write permission on the required repository.

Question 11 of 20

Your team maintains a YAML multi-stage Azure Pipeline that deploys a Java web app to Azure Kubernetes Service (AKS). The release stage needs a password-protected PFX certificate (app_tls.pfx) that must never be committed to the Git repository. The certificate must be usable only while the job runs and should be wiped from the build agent automatically after completion. Which approach should you implement to meet these requirements with minimal changes to the existing pipeline?

  • Store the certificate as a secret in Azure Key Vault and use the AzureKeyVault@2 task to inject it into environment variables during the job.

  • Upload app_tls.pfx to the pipeline Library as a secure file and add a DownloadSecureFile@1 task that references the file in the release stage.

  • Commit the certificate to a private Git submodule and add an authenticated checkout step to pull the submodule during the release stage.

  • Define a secret variable named APP_CERT that contains a base64-encoded copy of the certificate and decode it with a script step at runtime.

Question 12 of 20

You lead a team that delivers infrastructure-as-code through both GitHub Actions and Azure Pipelines.

Requirements

  1. In GitHub, the AZURE_SP_CLIENT_SECRET must be available only to jobs that target the Prod environment and must be masked if someone tries to echo it.
  2. In Azure DevOps, the same secret must be shared by several YAML pipelines, kept encrypted, and automatically update if the value is rotated in Azure Key Vault.

Which combination of platform features satisfies all the requirements with the least administrative effort?

  • Store AZURE_SP_CLIENT_SECRET as an organization secret in GitHub Actions and in a library variable group that is not linked to Key Vault in Azure Pipelines.

  • Store AZURE_SP_CLIENT_SECRET as a secret in the Prod environment in GitHub Actions and use a variable group linked to Azure Key Vault in Azure Pipelines.

  • Store AZURE_SP_CLIENT_SECRET in an environment file committed to the repo and encrypted with GPG for GitHub, and expose it through a service connection in Azure Pipelines.

  • Store AZURE_SP_CLIENT_SECRET as a repository secret in GitHub Actions and as a secret variable defined in each YAML pipeline in Azure DevOps.

Question 13 of 20

Your team wants Azure Monitor to create an Azure DevOps work item every time a Log Analytics-based alert with severity = Sev0 is triggered. You start creating an action group and choose the Azure DevOps action type, but the portal warns that a required prerequisite is missing. Which prerequisite must be satisfied before you can successfully add the Azure DevOps action to the group?

  • Install the Azure Boards extension for Visual Studio Code on the build server used by the project.

  • Register Azure Monitor as a multi-tenant application in Azure Active Directory and grant it the Work Item API permission.

  • Configure an Azure DevOps service hook that listens for alert events from Azure Monitor.

  • Generate a personal access token in Azure DevOps with Work Items (read and write) scope and supply it to the action group.

Question 14 of 20

A build pipeline that runs on Microsoft-hosted Linux agents restores about 300 MB of Maven dependencies from the public Maven Central repository on every execution. The team complains about long queue-to-publish times and the organization wants to reduce egress traffic charges. You must implement a change that

  • shortens the pipeline run time,
  • minimizes repeated network downloads,
  • automatically refreshes the stored files when the project's pom.xml changes,
  • requires no manual maintenance of the agent machines. Which action should you take?
  • Commit the entire .m2 directory to the Git repository using Git LFS so agents can clone the dependencies.

  • Switch the pipeline to use the ubuntu-latest image, which includes more pre-installed build tools and caches.

  • Publish the .m2 directory as a pipeline artifact in the first stage and download it in later stages of every run.

  • Add a Cache@2 task that stores the local Maven repository using a key based on the SHA-1 hash of pom.xml.

Question 15 of 20

You are designing a branching strategy for an Azure Repos Git project that supports 150 developers. Each developer must integrate code several times per day, and the automated build pipeline should always run from a single branch to maintain a linear history. In addition, production hotfixes must be delivered quickly without blocking ongoing feature development. Which branching model best satisfies these requirements?

  • Trunk-based development with a single main branch and short-lived feature and hotfix branches merged at least daily

  • GitFlow with long-lived develop, feature, release, and hotfix branches

  • Forking workflow where each developer works in a personal fork and merges back to the upstream repository only at milestone completion

  • Feature branching that keeps a dedicated branch per feature until it is completed at the end of each sprint

Question 16 of 20

You are defining a multi-stage Azure Pipelines YAML file. The production stage contains two deployment jobs named Deploy-Database and Deploy-WebApp. The WebApp deployment must not begin until the database deployment completes successfully, but both jobs must remain in the same stage so they share the same environment approval. Which YAML approach will reliably enforce the required execution order?

  • Merge the database and web app tasks into one job, counting on task order within that job to control sequencing.

  • Define Deploy-Database as a deployment job and Deploy-WebApp as a regular job because deployment jobs automatically run first.

  • Configure the Deploy-WebApp job with dependsOn: Deploy-Database and leave the default succeeded() condition in place.

  • Set timeoutInMinutes: 0 on Deploy-WebApp and use a script task to poll the database deployment status before continuing.

Question 17 of 20

You manage an Azure DevOps Git repository that contains a protected main branch. Your organization has these requirements:

  • All changes must reach main through a pull request.
  • A pull request can be completed only after at least two reviewers approve it and the pipeline Build-CI finishes successfully.
  • Members of the Contributors group must never be able to override these rules, but members of the Project Administrators group must be able to bypass the rules during emergency fixes.

Which configuration meets the requirements?

  • Enable Code Owners on the repository, select "Request review from Code Owners", add Build-CI as a status policy, and allow the Contributors group the "Complete pull request" permission while removing "Bypass policies when pushing" from all groups.

  • Create a branch policy on main that sets Minimum number of reviewers to 2 and adds a Build validation using Build-CI; then deny "Bypass policies when pushing" for the Contributors group and allow that permission for the Project Administrators group.

  • Create the branch policy with two reviewers and Build-CI, and grant the Contributors group the "Exempt from policy enforcement" permission while leaving Project Administrators unchanged.

  • Deny the "Push" permission on the repository for Contributors and allow "Force push" for Project Administrators; do not configure any branch policies.

Question 18 of 20

You run load tests against an Azure App Service that is instrumented with Application Insights. During the test, the /api/checkout operation occasionally exceeds its 5-second SLA. You need to determine whether the excessive latency originates inside the app or inside a downstream dependency. Which Kusto Query Language (KQL) statement should you run in Log Analytics to generate a time-series chart that shows the average request duration together with the average duration of related dependency calls for the same operation?

  • dependencies | where target contains '/api/checkout' | summarize avg(duration) by bin(timestamp, 1m)

  • requests | where name == '/api/checkout' | summarize avg(duration) by bin(timestamp, 1m)

  • requests | where name == '/api/checkout' | project operation_Id, requestDuration = duration, timestamp | join kind=inner ( dependencies | project operation_Id, dependencyDuration = duration ) on operation_Id | summarize avg(requestDuration), avg(dependencyDuration) by bin(timestamp, 1m)

  • traces | where message contains '/api/checkout' | summarize avg(duration) by bin(timestamp, 1m)

Question 19 of 20

The main branch of an Azure Repos Git repository must accept changes only through pull requests. Requirements are: at least two human reviewers, the code author may not approve, any new push must invalidate existing approvals, a CI build must succeed before completion, and direct pushes, force pushes, and branch deletion must all be blocked. Which configuration meets every requirement while still allowing pull-request merges into main?

  • Apply a branch policy that automatically adds two reviewers but allows author approval, keeps existing approvals after updates, and adds required build validation. Finally, lock the main branch so no one can push.

  • Configure environment approvers in the release pipeline, trigger it from main, leave Contribute permission set to Allow for developers, and mark build validation as optional in the branch policy.

  • Enable repository-level settings to require signed commits and restrict merges to squash only; do not modify branch security. Rely on developers to open pull requests voluntarily.

  • Create a branch policy on main that requires two reviewers, disallows author approval, resets approvals on new pushes, and adds a required build-validation pipeline. Then use Branch security to deny Force push and Delete permissions for the Contributors group, leaving Contribute unset.

Question 20 of 20

The DevOps team stores project documentation in an Azure DevOps wiki. A wiki page contains the following Markdown:

sequenceDiagram
    participant API
    participant DB
    API->>DB: Query

When the page is viewed in the web portal, the diagram appears as plain text instead of a graphic. You must resolve the issue without installing browser extensions or using external services. What should you do to make the diagram render correctly?

  • Surround the diagram with triple-backtick fences and specify mermaid as the code block language (mermaid ... ).

  • Replace the content with a PlantUML block that starts with @startuml and ends with @enduml.

  • Rename the Markdown page from .md to .mmd so Azure DevOps detects a Mermaid file.

  • Turn on Preview rendering for diagrams in the Wiki settings under Experimental features.