nerdexam
MicrosoftMicrosoft

AZ-400 · Question #569

AZ-400 Question #569: Real Exam Question with Answer & Explanation

The correct answer is A: Yes. Option A (Yes) is correct because the YAML definition includes the necessary elements to satisfy all three requirements: a test task configured to fail the pipeline on test failures, a PublishTestResults task to publish results to the pipeline, and a condition such as always() or

Submitted by dimitri_ru· Mar 6, 2026Design and implement build and release pipelines

Question

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?

Options

  • AYes
  • BNo

Explanation

Option A (Yes) is correct because the YAML definition includes the necessary elements to satisfy all three requirements: a test task configured to fail the pipeline on test failures, a PublishTestResults task to publish results to the pipeline, and a condition such as always() or similar that ensures tests run on every pipeline execution unless cancelled.

The question presents a "Yes/No" format, so Option B would only be correct if the YAML solution failed to address one or more requirements - for example, if it was missing the PublishTestResults task, lacked a failure condition, or used a condition that prevented tests from running in certain non-cancelled scenarios.

Although the actual YAML isn't displayed here, the correct answer confirms that the provided solution properly uses continueOnError: false (or equivalent) to fail the pipeline, PublishTestResults@2 to surface results, and a run condition like succeededOrFailed() to ensure tests always execute unless cancelled.

Memory tip: For Azure Pipelines test questions, remember the three pillars - Fail (pipeline fails on test failure), Publish (PublishTestResults task), and Always Run (succeededOrFailed() condition). If all three are present in the YAML, the answer is "Yes." The key differentiator is the succeededOrFailed() condition, which ensures tests run even if a prior step fails, but stops if the pipeline is cancelled.

Topics

#Azure Pipelines#YAML Pipelines#Test Automation#Pipeline Configuration

Community Discussion

No community discussion yet for this question.

Full AZ-400 PracticeBrowse All AZ-400 Questions