nerdexam
Microsoft

AZ-400 · Question #570

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 h

The correct answer is B. No. Option B (No) is correct because the question references a YAML snippet that we must assume is incomplete or incorrectly configured - most likely it uses a condition that prevents tests from running when the pipeline is cancelled, but does not guarantee tests run on every pipelin

Submitted by katya_ua· 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?

Exhibits

AZ-400 question #570 exhibit 1
AZ-400 question #570 exhibit 2

Options

  • AYes
  • BNo

How the community answered

(61 responses)
  • A
    33% (20)
  • B
    67% (41)

Explanation

Option B (No) is correct because the question references a YAML snippet that we must assume is incomplete or incorrectly configured - most likely it uses a condition that prevents tests from running when the pipeline is cancelled, but does not guarantee tests run on every pipeline execution unless cancelled. A common mistake is using condition: always() without also ensuring the pipeline fails when tests fail (e.g., missing failTaskOnFailedTests: true in the PublishTestResults task, or not properly configuring the test task to propagate failures).

Why the distractor (A - Yes) is wrong: The proposed YAML solution likely omits a critical element - such as failTaskOnFailedTests: true on the PublishTestResults task, or uses an incorrect condition like succeededOrFailed() instead of a combination that both publishes results and ensures pipeline failure on test failures. Without all three requirements being met simultaneously, the solution is incomplete.

Memory Tip: Remember the three-part checklist for pipeline test requirements: (1) Fail on test failure (failTaskOnFailedTests: true), (2) Publish results (PublishTestResults task), and (3) Always run unless cancelled (condition: succeededOrFailed() - NOT always(), since always() runs even when cancelled). If any one of these is missing or misconfigured, the answer is No.

Topics

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

Community Discussion

No community discussion yet for this question.

Full AZ-400 Practice