AZ-400 Job dependency and artifacts Practice Question
You have a YAML pipeline with multiple jobs that need to run in parallel. However, one job depends on artifacts produced by a previous job. How should you configure the dependency?
⚠ Common exam trap
Watch out — candidates often assume `dependsOn` alone handles artifact sharing, but Azure DevOps requires explicit publish/download tasks because jobs may run on different agents with no shared file system.
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
✓
Set dependsOn on the dependent job and use PublishBuildArtifacts and DownloadBuildArtifacts tasks.
In Azure DevOps YAML pipelines, job dependencies are explicitly declared using the `dependsOn` keyword, and artifacts must be published and downloaded using `PublishBuildArtifacts` and `DownloadBuildArtifacts` tasks (or the `publish` and `download` pipeline decorators). Without explicit artifact sharing, outputs from one job are not automatically available to another job, even if `dependsOn` is set.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Set dependsOn on the dependent job and use PublishBuildArtifacts and DownloadBuildArtifacts tasks.
Why this is correct
To share artifacts between jobs in Azure Pipelines, you need both an execution dependency and an explicit artifact transfer. The `dependsOn` keyword on the dependent job ensures it runs only after the dependency job completes, but files are not automatically shared; instead, you must use the `PublishBuildArtifacts` task in the source job to publish the files and the `DownloadBuildArtifacts` task in the dependent job to retrieve them.
- ✗
Use the 'dependsOn' keyword only, artifacts are automatically shared.
Why it's wrong here
Using only `dependsOn` does not share artifacts between jobs. While `dependsOn` correctly establishes job execution order, artifact publishing and downloading require explicit tasks like `PublishBuildArtifacts` and `DownloadBuildArtifacts`. Without these tasks, the dependent job will not have access to files from the upstream job, even though it runs after it.
- ✗
Set the 'condition' to 'eq(variables['Agent.JobStatus'], 'Succeeded')' on the dependent job.
Why it's wrong here
Setting a `condition` like `eq(variables['Agent.JobStatus'], 'Succeeded')` on the dependent job only controls whether the job runs based on the status of a previous job. It does not transfer artifacts between jobs; artifact sharing still requires explicit `PublishBuildArtifacts` and `DownloadBuildArtifacts` tasks. This condition is often used in combination with those tasks, but it is not a substitute for them.
- ✗
Use the 'pool' keyword to ensure both jobs run on the same agent.
Why it's wrong here
Using the `pool` keyword to place both jobs in the same agent pool does not guarantee they run on the same physical or virtual machine, and even if they did, each job has a separate working directory and artifacts are not automatically persisted between jobs. The `pool` keyword only selects the pool of agents available; it does not create an artifact-sharing mechanism. You still need to explicitly publish and download artifacts using the appropriate tasks.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-400 exam frequently reuses these exact scenarios with slightly different constraints.
✓Set dependsOn on the dependent job and use PublishBuildArtifacts and DownloadBuildArtifacts tasks.Correct answer▾
Why this is correct
To share artifacts between jobs in Azure Pipelines, you need both an execution dependency and an explicit artifact transfer. The `dependsOn` keyword on the dependent job ensures it runs only after the dependency job completes, but files are not automatically shared; instead, you must use the `PublishBuildArtifacts` task in the source job to publish the files and the `DownloadBuildArtifacts` task in the dependent job to retrieve them.
✗Use the 'dependsOn' keyword only, artifacts are automatically shared.Wrong answer — click to see why▾
Why this is wrong here
Artifacts must be explicitly published and downloaded.
✗Set the 'condition' to 'eq(variables['Agent.JobStatus'], 'Succeeded')' on the dependent job.Wrong answer — click to see why▾
Why this is wrong here
Condition controls execution but does not handle artifact sharing.
✗Use the 'pool' keyword to ensure both jobs run on the same agent.Wrong answer — click to see why▾
Why this is wrong here
Same agent is not guaranteed and doesn't handle dependencies.
Analysis generated from the official AZ-400blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Azure DevOps
Azure DevOps is a Microsoft service that provides development tools for planning, building, testing, and deploying software applications using automated pipelines and collaboration features.
Key term
YAML pipeline
A YAML pipeline is a text-based file written in YAML format that defines an automated series of steps for building, testing, and deploying software in a continuous integration and continuous delivery (CI/CD) system.
About these practice questions
This AZ-400 question is part of Courseiva's 823-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 →
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.