Microsoft

AZ-400 Free Practice Questions — Page 6

Question 51

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. You need to use an Azure Pipelines pipeline to test an app. The solution meet the following requirements: • The pipeline must fail if any tests fail. • The test results must be published to the pipeline. • The test for every pipeline run must be triggered unless the pipeline is cancelled. Solution: You include the following elements in the YAML definition of the pipeline. Does this meet the goal?

A. Yes
B. No
Show Answer
Correct Answer: B
Explanation:
The solution does not fully meet the requirements. Although publishing test results can be achieved with PublishTestResults and tests can be configured to run with an always()/not(canceled()) condition, the pipeline is not guaranteed to fail when tests fail. PublishTestResults@2 does not fail the pipeline on failed tests unless failTaskOnFailedTests: true is explicitly set; failTaskOnMissingResultsFile only fails when the results file is missing, not when tests fail.

Question 52

You manage projects by using Azure Boards. You have a current work item named itemA that is dependent on a work item named itemB. You need to define the dependency for itemA. What should you do in the web portal for Azure DevOps?

A. Add a Parent link to the user story of item
B. From Backlogs, open the context menu, select Add link, and then select itemA. Set Link type to Successor and add the ID of item
C. From Backlogs, open the context menu, select Add link, and then select itemB. Set Link type to Related and add the ID of itemA.
D. From itemA, open the Links tab, and then select Add link. Set Link type to References and add the ID of itemB.
Show Answer
Correct Answer: B
Explanation:
In Azure Boards, dependencies are defined using Predecessor/Successor links. Since itemA depends on itemB, itemA must be the Successor of itemB. From Backlogs, adding a link with Link type set to Successor correctly establishes that itemA cannot proceed until itemB is completed. Other link types (Parent, Related, References) do not define dependencies.

Question 53

You manage a project by using Azure Boards, and you manage the project code by using Azure Repos. You have a bug work item that has an ID of 123. You need to set the work item state to Resolved. What should you add to the commit message?

A. #123 fixed
B. #123 Resolved-
C. Verifies #123-
D. Resolves #123-
Show Answer
Correct Answer: D
Explanation:
Azure DevOps recognizes specific action keywords in commit messages (such as Resolves, Resolve, Resolved, Fixes, Fix, Fixed, Closes, etc.) when they precede the work item ID. Using a keyword like "Resolves #123" automatically updates the work item state to Resolved. Option D correctly uses a supported keyword in the proper format, whereas "#123 fixed" places the keyword after the ID and is not the correct pattern.

Question 54

You have a project in Azure DevOps that uses an Azure Boards board and stores code in a GitHub repository. The repository contains a file named README.md. You need to ensure that README.md includes the status of the work items on the board. The solution must minimize administrative effort. What should you do first?

A. Create a GitHub personal access token (PAT).
B. Enable GitHub annotations for the board.
C. Install the Azure Boards app for GitHub.
D. Select Allow anonymous users to access the status badge.
Show Answer
Correct Answer: C
Explanation:
To surface Azure Boards work item status in a GitHub README with minimal administrative effort, the Azure Boards–GitHub integration must first be established. Installing the Azure Boards app for GitHub enables the connection between the Azure Boards project and the GitHub repository, which is a prerequisite for features such as status badges or work item linking. Other options (like allowing anonymous access) are configuration steps that only apply after the integration is in place.

Question 55

You use an Azure Pipelines pipeline to build, test, and deploy an app named App1. You need to reduce how long it takes to complete unit and integration tests for App1. The solution must ensure that the code coverage testing ratio is maintained. What should you do?

A. Enable flaky test management.
B. Purchase additional parallel jobs.
C. Enable Test Impact Analysis (TIA).
D. Add an agent pool.
Show Answer
Correct Answer: C
Explanation:
Test Impact Analysis (TIA) runs only the subset of unit and integration tests affected by recent code changes. This significantly reduces test execution time while still maintaining the required code coverage ratio. The other options either do not reduce test scope (flaky test management), add cost without optimizing execution (additional parallel jobs, agent pool), or do not directly preserve coverage efficiency.

Question 56

DRAG DROP - You have an Azure Repos repository named Repo1 that is used for source control. You need to configure code scanning for Repo1. Which three tasks should the pipeline perform in sequence? To answer, move the appropriate tasks from the list of tasks to the answer area and arrange them in the correct order.

Illustration for AZ-400 question 56
Show Answer
Correct Answer: Advanced Security Initialize CodeQL Advanced Security AutoBuild Advanced Security Perform CodeQL Analysis
Explanation:
Code scanning with CodeQL requires initializing the CodeQL tools, building the source so CodeQL can extract data, and then running the analysis. Dependency scanning and Purview are separate features and not part of CodeQL code scanning.

Question 58

You plan to deploy a solution that will include multiple microservices. You need to recommend a deployment strategy for the microservices. The solution must meet the following requirements: • Enable testing and monitoring of changes during a gradual rollout. • Control the number of users that will receive new code releases. Which strategy should you recommend?

A. progressive exposure
B. A/B
C. feature toggle
D. blue/green
Show Answer
Correct Answer: A
Explanation:
Progressive exposure (canary release) rolls out changes gradually to a controlled subset of users, enabling monitoring and testing during rollout while precisely controlling how many users receive the new code.

Question 59

You plan to deploy a solution that will include multiple microservices. You need to recommend a deployment strategy for the microservices. The solution must meet the following requirements: • Enable users to test new features by using a specific URL. • Minimize the effort required to promote a test version to production. • Minimize the effort required to revert production code to the previous version. Which strategy should you recommend?

A. A/B
B. feature toggle
C. progressive exposure
D. blue/green
Show Answer
Correct Answer: D
Explanation:
Blue/green deployment fits all requirements: it allows exposing a new version via a specific URL (green environment) for testing, promotes test to production by simply switching traffic, and enables instant rollback by routing traffic back to the previous (blue) environment. This minimizes effort for promotion and reversion.

Question 60

You have an Azure subscription. You create two Bicep templates named Template1 and Template2 that will be used to create a virtual machine and a website. You need to create a template named Template3 that will reuse logic from Template1 and Template2. What should you define first?

A. outputs
B. resources
C. modules
D. parameters
Show Answer
Correct Answer: C
Explanation:
To reuse logic from existing Bicep templates, you reference them as modules. Template3 would define modules that point to Template1 and Template2, enabling composition and reuse of their resources. Parameters, resources, and outputs are defined within or alongside modules, but modules are the key construct for reuse.

Question 61

HOTSPOT - You have a .NET app named App1. You need to upload App1 to GitHub Packages. How should you complete the command? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-400 question 61
Show Answer
Correct Answer: dotnet nuget push
Explanation:
To upload a .NET NuGet package to GitHub Packages, use the .NET CLI with the NuGet push command: dotnet nuget push <package> --api-key <PAT> --source "github".

$19

Get all 531 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.