Courseiva
Design and implement build and release pipelineshardMultiple ChoiceObjective-mapped

AZ-400 Practice Question: Design and implement build and release pipelines

Your team uses Azure Pipelines with a YAML-based build pipeline. The pipeline builds a .NET application and runs unit tests. Recently, the unit tests are failing intermittently due to flaky tests. You need to ensure that the pipeline fails only if the same test fails in two consecutive runs. Which feature should you configure?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Configure the 'retry failed tests' setting in the pipeline's test tab.

The correct feature is the 'Retry failed tests' setting in the pipeline's test tab. This allows you to configure the number of times a failed test is automatically retried. If the test passes on retry, the pipeline is marked as succeeded with warnings, effectively requiring two consecutive failures for the pipeline to fail. Option A is incorrect because GitHub Actions workflows are not relevant to Azure Pipelines. Option B is for rerunning failed stages, not individual tests. Option C reruns failed jobs, not tests.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Implement a GitHub Actions workflow with 're-run' trigger.

    Why it's wrong here

    A GitHub Actions workflow is an entirely different CI/CD system and cannot be used to configure behavior for an Azure Pipelines YAML build pipeline. Moreover, GitHub Actions' 're-run failed jobs' or 're-run' triggers are manual, job-level retries that do not map to Azure Pipelines' native test-level retry functionality, so this option is both off-platform and off-target.

  • Use the 'Re-run failed stages' option in the pipeline run.

    Why it's wrong here

    In Azure Pipelines, the 'Re-run failed stages' option on a completed run manually re-executes every job that failed within that stage, which means the entire build and all test suites in those jobs are run again from scratch. It does not selectively retry only the specific flaky test cases, and it requires you to manually monitor and trigger the rerun rather than automatically stabilizing the pipeline.

  • Enable 'Automatically rerun failed jobs' in the pipeline settings.

    Why it's wrong here

    Enabling 'Automatically rerun failed jobs' in the pipeline settings retries the entire agent job, which includes not just all tests but also earlier build, packaging, and deployment steps. This is a coarse-grained, resource-intensive retry that can mask infrastructure or environment issues, and it does not isolate and retry only the specific test cases that failed, making it unsuitable for addressing flaky test behavior.

  • Configure the 'retry failed tests' setting in the pipeline's test tab.

    Why this is correct

    The 'retry failed tests' setting in the pipeline's Test tab is the correct way to handle flaky tests: it automatically re-executes only the failed test cases (not entire jobs or stages) a configurable number of times during the same run. If a retried test passes, it is reported as 'Passed on retry' in the Test tab, giving you visibility into which tests are flaky while keeping the overall run green.

About these practice questions

One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.