Microsoft certification · Exam AZ-400

AZ-400 Mock Exam Page 3

Microsoft Azure DevOps Solutions (beta)

Free AZ-400 mock exam questions 21–30, each with the answer and an explanation.

20 questions · 33 minutes · free, no sign-up

Free AZ-400 questions

21–30 of 145 free
Question 21 Choose 1
You have an Azure web app named webapp1 that uses the .NET Core runtime stack. You have an Azure Application Insights resource named Applnsight1. Webapp1 sends telemetry data to Applnsights1. You need to ensure that webapp1 sends the telemetry data at a fixed sampling rate. What should you do?
Show answerHide answer

Correct answer: B From the code repository of webapp1, modify the Startup.cs file.

Explanation

Explanation:
This question involves configuring Application Insights telemetry sampling for a .NET Core web application. Sampling controls the volume of telemetry data sent to Application Insights to reduce costs and network traffic while preserving statistical accuracy. The requirement is to set a fixed sampling rate, which must be configured at the application code level in .NET Core applications, not through the portal settings.

Correct Option:

B. From the code repository of webapp1, modify the Startup.cs file.
In .NET Core applications, Application Insights configuration is done programmatically in code, not via XML configuration files.

The Startup.cs file's ConfigureServices method is where you configure services, including Application Insights telemetry with custom sampling settings.

You would add code to configure the TelemetryConfiguration with a FixedRateSampler to implement fixed sampling, typically by modifying the dependency injection setup for ApplicationInsightsServiceOptions.

Incorrect Option:

A. From the code repository of webapp1, modify the ApplicationInsights.config file:
This XML configuration file is used for ASP.NET (Full Framework) applications, not for .NET Core applications. .NET Core uses appsettings.json and code-based configuration in Startup.cs.

C. From AppInsights1, modify the Usage and estimated costs settings:
While you can enable or disable sampling from the portal's "Usage and estimated costs" blade, this configures adaptive sampling (which adjusts rate dynamically based on traffic), not fixed sampling. Also, portal settings affect data ingestion, not how the app sends data.

D. From AppInsights1, configure the Continuous export settings:
Continuous export is used to export telemetry data from Application Insights to Azure Storage for long-term retention or external processing. It has no relationship to controlling the sampling rate of data being sent from the application.

Reference:
Microsoft Learn - "Application Insights sampling for ASP.NET Core applications". The documentation specifies that for .NET Core apps, sampling must be configured in code during service configuration, typically in Startup.cs or Program.cs, using methods like AddApplicationInsightsTelemetry with customized options.
Question 22 Choose 1
You have an Azure virtual machine that is monitored by using Azure Monitor. The virtual machine has the Azure Log Analytics agent installed. You plan to deploy the Service Map solution from Azure Marketplace. What should you deploy to the virtual machine to support the Service Map solution?
Show answerHide answer

Correct answer: C the Dependency agent

Explanation

Explanation:
This question is about enabling the Service Map feature in Azure Monitor. Service Map automatically discovers application components on Windows and Linux systems and maps communication between them. While the Log Analytics agent (now being replaced by Azure Monitor agent) collects performance and log data, Service Map requires an additional agent to collect dependency data about network connections and processes.

Correct Option:

C. the Dependency agent
The Dependency agent is specifically required for the Service Map solution.

It collects discovered data about processes running on the machine and inbound/outbound network connections, which Service Map uses to build its visual maps and dependency diagrams.

The Dependency agent must be installed alongside the Log Analytics agent (or Azure Monitor agent) on each virtual machine you want to include in Service Map.

Incorrect Option:

A. the Telegraf agent:
Telegraf is an agent for collecting and reporting metrics, primarily used with InfluxDB in time-series database scenarios. It is not used by Azure Monitor's Service Map solution.

B. the Azure Monitor agent:
While this is the newer unified agent for collecting monitoring data in Azure, the Service Map solution still requires the separate Dependency agent to be installed alongside it. The Azure Monitor agent alone does not provide the dependency mapping data.

D. the Windows Azure diagnostics extension (WAD):
This extension is used to collect diagnostic data from Azure VMs and send it to Azure Storage, Event Hubs, or Azure Monitor metrics. It does not provide the process and network dependency data required for Service Map functionality.

Reference:
Microsoft Learn - "Service Map documentation" - "Enable Service Map" section explicitly states: "Service Map requires two agents on each machine: the Log Analytics agent (formerly called MMA) and the Dependency agent." The Dependency agent is mandatory for Service Map functionality.
Question 23 Choose 1
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
Your company uses Azure DevOps to manage the build and release processes for applications.
You use a Git repository for applications source control.
You need to implement a pull request strategy that reduces the history volume in the master branch.
Solution: You implement a pull request strategy that uses a three-way merge.
Does this meet the goal?
Show answerHide answer

Correct answer: B No

Explanation

Explanation:
This question tests understanding of Git pull request merge strategies and their impact on repository history. The goal is to reduce history volume in the master branch. Different merge strategies create different types of commit history, with some creating more "merge commit noise" than others. The proposed solution suggests using a three-way merge, which is actually a standard merge operation that preserves full history.

Correct Option:

B. No
A three-way merge (typically just called a "merge" in Git) creates a new merge commit that ties together the histories of both branches.

This preserves the complete history of both the feature branch and the master branch, which actually increases the history volume rather than reducing it.

Each merge adds another commit to the history, maintaining all intermediate commits from the feature branch.

Alternative that would meet the goal:
To reduce history volume, you would need to use squash merging (which combines all feature branch commits into a single commit before merging) or rebase and merge (which replays feature branch commits onto the tip of master, creating a linear history). These strategies create cleaner, more compact histories in the master branch.

Reference:
Microsoft Learn - "Configure branch policies" and Azure DevOps documentation on pull request merge options. The documentation explains that three-way merge preserves branch topology and complete history, while squash merge creates a single commit from the pull request to keep a cleaner history.
Question 24 Choose 1
Note: This question n part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it. As a result these questions will not appear in the review screen. You have an approval process that contains a condition. The condition requires that releases be approved by a team leader before they are deployed. You have a policy stating that approvals must occur within eight hours. You discover that deployments fail if the approvals lake longer than two hours. You need to ensure that the deployments only fail if the approvals take longer than eight hours.
Solution: From Pre-deployment conditions, you modify the Timeout setting for pre-deployment approvals.
Does this meet the goal?
Show answerHide answer

Correct answer: B No

Explanation

Explanation:
This question addresses configuring approval timeouts in Azure DevOps release pipelines. The problem is that deployments are currently failing after 2 hours, but the policy requires them to fail only after 8 hours. The solution proposes modifying the Timeout setting for pre-deployment approvals, which seems like the correct approach. However, there's a critical nuance about where this setting is configured that determines if the solution works.

Correct Option:

B. No
While the Timeout setting for approvals controls how long an approval can be pending, the specific issue described might be related to agent job timeout rather than approval timeout.

In Azure DevOps, if the agent job itself has a timeout shorter than the approval wait time, the entire release job (including the approval wait period) will fail when the agent job times out, regardless of the approval timeout setting.

To properly meet the goal, you may need to:
Increase the approval timeout in the pre-deployment conditions (as suggested).

Also ensure the agent job timeout in the release pipeline's environment settings is longer than 8 hours, or that the agent doesn't timeout while waiting for approval.

Reference:
Microsoft Learn - "Configure approvals and gates" documentation explains that while approval timeouts can be set, the release job timeout can also affect deployment success. If an agent job times out while waiting for approval, the deployment fails regardless of approval timeout settings.
Question 25 Choose 1
You have an Azure DevOps organization that contains a project named Project1. You need to create a published wiki in Project1. What should you do first?
Show answerHide answer

Correct answer: C In Project1, create an Azure DevOps repository.

Explanation

Explanation:
This question is about setting up a wiki in Azure DevOps. Azure DevOps offers two types of wikis: code wiki (which lives in a Git repository) and project wiki (a published wiki). Both types require a Git repository as their foundation. The project wiki is essentially a special, published view of a wiki repository that is automatically created or selected.

Correct Option:

C. In Project1, create an Azure DevOps repository.
A published wiki in Azure DevOps is built from content stored in a Git repository.

When you create a project wiki, you either select an existing repository or a new, dedicated repository is automatically created to store the wiki pages (named ProjectName.wiki by default).

Therefore, the first step is ensuring a repository exists to host the wiki content. Creating or having an Azure DevOps repository is the prerequisite for creating a published wiki.

Incorrect Option:

A. Modify the Storage settings of Project1:
Azure DevOps projects do not have user-configurable "Storage settings" for wikis. Storage is managed automatically by the platform when you create a repository.

B. In Project1, create an Azure DevOps pipeline:
Build pipelines are used for CI/CD processes, not for creating or publishing wikis. While you could potentially automate wiki content generation via a pipeline, it is not the first or required step to create a published wiki.

D. Modify the Team configuration settings of Project1:
Team settings control areas, iterations, and permissions for a specific team, not the creation of project-wide artifacts like wikis. Wiki creation is a project-level feature, not a team configuration.

Reference:
Microsoft Learn - "Create a wiki for your project". The documentation states: "Each team project can have a wiki... When you create a wiki, you create a Git repository to store your wiki Markdown files." This confirms that creating a wiki first requires (or automatically creates) a repository.
Question 26 Choose 1
Your company has a project in Azure DevOps for a new application. The application will be deployed to several Azure virtual machines that run Windows Server 2022. You need to recommend a deployment strategy for the virtual machines. The strategy must meet the following requirements:
  • Ensure that the virtual machines maintain a consistent configuration.
  • Minimize administrative effort to configure the virtual machines.
What should you include in the recommendation?
Show answerHide answer

Correct answer: C Azure Resource Manager templates and the Custom Script Extension for Windows

Explanation

Explanation:
This question requires selecting a deployment strategy for Windows Server VMs that ensures consistent configuration while minimizing administrative effort. The solution needs to address both infrastructure provisioning (the VMs themselves) and post-provisioning configuration (software, settings). Azure Resource Manager (ARM) templates handle the infrastructure, while extensions handle the configuration.

Correct Option:

A. Azure Resource Manager templates and the PowerShell Desired State Configuration (DSC) extension for Windows
ARM templates ensure consistent infrastructure provisioning (networks, VMs, disks).

The PowerShell DSC extension is designed for ongoing configuration consistency. It applies and maintains a declared configuration state (like installed features, registry settings, files) across all VMs, automatically correcting drift.

This combination meets both requirements: ARM for initial consistency and DSC for enforced, automated ongoing compliance with minimal ongoing admin effort.

Incorrect Option:

B. Deployment YAML and Azure pipeline deployment groups:
While YAML pipelines and deployment groups can orchestrate application deployments to existing VMs, they do not provision or guarantee the configuration state of the VMs themselves. This approach requires manual VM setup first and doesn't enforce configuration drift correction.

C. Azure Resource Manager templates and the Custom Script Extension for Windows:
ARM templates are correct for provisioning. However, the Custom Script Extension runs scripts once at deployment time. It does not ensure ongoing consistency or correct configuration drift over time, which the DSC extension is specifically designed to do.

D. Deployment YAML and Azure pipeline stage templates:
Pipeline YAML and templates automate CI/CD workflow stages but are not tools for configuring or maintaining the desired state of Azure virtual machine operating systems and software.

Reference:
Microsoft Learn - "Desired State Configuration extension with Azure Resource Manager templates". The documentation explains that the DSC extension is used to configure VMs as they are provisioned and to maintain their configuration over time, providing the consistency and reduced administrative effort required in the scenario.
Question 27 Choose 1
You have an Azure pipeline that is used to deploy an app named App1. You need to ensure that new versions of App1 are released only if they exceed performance baselines. The solution must minimize administrative effort. What should you configure?
Show answerHide answer

Correct answer: C an Azure Pipelines deployment gate

Explanation

Explanation:
This question addresses implementing quality gates in a release pipeline. The requirement is to prevent deployment of new app versions unless they meet defined performance criteria (exceed baselines). This is a classic use case for a gate in a release pipeline, which acts as an automated checkpoint before proceeding to deployment. Gates evaluate external services and conditions without manual intervention, minimizing administrative effort once configured.

Correct Option:

C. an Azure Pipelines deployment gate
Deployment gates are automated checks that evaluate external health signals (like performance test results, monitoring alerts, or approval status) before a deployment proceeds to the next stage.

You can configure an Azure Monitor gate that queries Application Insights performance baselines. The release will only proceed if the performance metrics from testing exceed the defined thresholds.

Gates run automatically at specified intervals, requiring minimal administrative effort after the initial setup.

Incorrect Option:

A. an Azure Repos branch policy:
Branch policies control code merging behavior (like requiring PRs or builds) but cannot enforce performance baselines for a released application. They operate at the source code integration phase, not the release deployment phase.

B. an Azure Pipelines release artifact:
Artifacts are the outputs (packages, files) of a build that are consumed by a release pipeline. Configuring an artifact does not control whether a release proceeds based on performance criteria.

D. an Azure Monitor alert:
An alert can notify you when performance thresholds are breached, but it does not automatically block a deployment. You would need manual intervention to stop a release based on an alert, which does not minimize administrative effort.

Reference:
Microsoft Learn - "Deployment gates". Documentation explains that gates are used to automatically ensure that releases meet required criteria (like performance, security, or compliance) before deployment, enabling safe continuous deployment with quality checks.
Question 28 Choose 1
You use Azure Pipelines to build and deploy an app named Appl. You plan to monitor App1 by using Application Insights. You create an Application Insights instance named All. You need to configure App1 to use All. Which file should you modify?
Show answerHide answer

Correct answer: A appsettings.son

Explanation

Explanation:
This question involves configuring an application to use a specific Application Insights resource. The connection between an application and its Application Insights instance is typically managed through an instrumentation key or connection string. This configuration is stored in application settings files to allow environment-specific configuration without code changes.

Correct Option:

A. appsettings.json
appsettings.json is the standard configuration file for ASP.NET Core applications where external dependencies like Application Insights are configured.

You would add the Application Insights InstrumentationKey or ConnectionString setting to this file (or its environment-specific variants like appsettings.Production.json).

This allows the application to be dynamically configured for different environments (development, staging, production) by changing settings in the configuration file rather than modifying code.

Incorrect Option:

B. launchSettings.json:
This file contains Visual Studio launch profiles and settings for the development environment only (like ports, environment variables). It's not used for production configuration and doesn't affect the application when deployed.

C. startup.cs:
While you can configure Application Insights programmatically in Startup.cs (via services.AddApplicationInsightsTelemetry()), the specific Application Insights instance (All) would typically be configured via configuration (appsettings.json) rather than hardcoded in the C# code. Modifying code for configuration is less flexible than using config files.

D. project.json:
This file was used in early .NET Core versions for project configuration but has been replaced by .csproj files. It is not used in modern .NET Core/.NET 5+ applications for application settings.

Reference:
Microsoft Learn - "Application Insights for ASP.NET Core applications" documentation shows that the instrumentation key is typically set in appsettings.json or via environment variables, allowing the same code to connect to different Application Insights resources in different environments.
Question 29 Choose 1
Your company plans to use an agile approach to software development. You need to recommend an application to provide communication between members of the development team who work in locations around the world. The applications must meet the following requirements:
  • Provide the ability to isolate the members of different project teams into separate communication channels and to keep a history of the chats within those channels.
  • Be available on Windows 10, Mac OS, iOS, and Android operating systems.
  • Provide the ability to add external contractors and suppliers to projects.
  • Integrate directly with Azure DevOps.
What should you recommend?
Show answerHide answer

Correct answer: D Microsoft Teams

Explanation

Explanation:
Within each team, users can create different channels to organize their communications by topic. Each channel can include a couple of users or scale to thousands of users.
Microsoft Teams works on Android, iOS, Mac and Windows systems and devices. It also works in Chrome, Firefox, Internet Explorer 11 and Microsoft Edge web browsers.
The guest-access feature in Microsoft Teams allows users to invite people outside their organizations to join internal channels for messaging, meetings and file sharing. This capability helps to facilitate business-to-business project management.
Teams integrates with Azure DevOps.
Question 30 Choose 2
Your company uses Azure DevOps for the build pipelines and deployment pipelines of Java based projects. You need to recommend a strategy for managing technical debt. Which two actions should you include in the recommendation? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
Show answerHide answer

Correct answer: A, C Integrate Azure DevOps and SonarQube. Configure post-deployment approvals in the deployment pipeline.

Full mock exam

Sit the AZ-400 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real AZ-400 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full AZ-400 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 488questions in the bank
  • Newmock on every attempt