Courseiva

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

You are designing a build pipeline that produces an artifact. You need to ensure that the artifact is only published if the build succeeds. The pipeline includes multiple jobs: Build, Test, and Publish. Which condition should you use on the Publish job to achieve this?

⚠ Common exam trap

The trap here is using a variable like Build.Status, which does not exist for job status; the correct approach is to use the succeeded() function.

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

✓

condition: succeeded()

The succeeded() condition ensures that the Publish job runs only if all previous jobs in the dependency chain have succeeded. This is the standard way to gate a job on the success of prior jobs. Other conditions either run unconditionally, on failure, or use invalid variables.

Answer analysis

Option-by-option breakdown

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

  • ✗

    condition: always()

    Why it's wrong here

    The always() condition causes the job to run regardless of the status of previous jobs. This would publish the artifact even if the build or tests failed, which is not desired. It is used for cleanup or logging tasks, not for gating artifact publication.

  • ✗

    condition: failed()

    Why it's wrong here

    The failed() condition runs the job only if a previous job failed. This would publish the artifact only when the build fails, which is the opposite of the requirement. It is typically used for error handling or notification tasks.

  • ✓

    condition: succeeded()

    Why this is correct

    The succeeded() condition returns true only if all previous jobs in the dependency chain have succeeded. By setting this condition on the Publish job, it will only run if the Build and Test jobs succeed. This ensures the artifact is published only on successful builds.

  • ✗

    condition: eq(variables['Build.Status'], 'Succeeded')

    Why it's wrong here

    There is no built-in variable 'Build.Status' that reflects the status of previous jobs. Using such a condition would likely result in an error or always evaluate to false. The correct way to check job status is with succeeded() or similar functions.

About these practice questions

This AZ-400 question is part of Courseiva's 696-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

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.