Courseiva
Design and implement build and release pipelinesmediumMultiple SelectObjective-mapped

Publishing and Downloading Pipeline Artifacts Across Multi-Stage YAML

Which TWO are valid ways to pass build artifacts from one stage to another in a multi-stage YAML pipeline in Azure Pipelines?

Quick Answer

Passing artifacts between stages in a multi-stage YAML pipeline needs an explicit publish-then-download pair: the Publish Pipeline Artifact task in the first stage, and Download Pipeline Artifact task in the next. A shared network drive via Copy Files also works as an alternative, but the legacy Publish/Download Build Artifacts tasks aren't the supported path for multi-stage YAML.

⚠ Common exam trap

A common mix-up: candidates confuse the legacy Build Artifacts tasks (Publish/Download Build Artifacts) with the modern Pipeline Artifact tasks, or assume that variables can pass complex build outputs between stages, when in fact only artifacts provide a reliable, cross-stage file transfer mechanism.

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

Use the Publish Pipeline Artifact task in the first stage and Download Pipeline Artifact task in the second stage.

The Publish Pipeline Artifact task in the first stage makes the artifact available to the pipeline, and the Download Pipeline Artifact task in the second stage explicitly retrieves it. This is the standard, supported method for passing artifacts between stages in a multi-stage YAML pipeline. Option D is also correct because the Copy Files task can copy artifacts to a shared network drive accessible by subsequent stages, which is a valid alternative method. Options A and C are incorrect: A is wrong because published pipeline artifacts are not automatically available without a download task; C is wrong because the Publish/Download Build Artifacts tasks are legacy and not the recommended way for multi-stage YAML pipelines, and they do not work seamlessly across stages without additional configuration.

Answer analysis

Option-by-option breakdown

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

  • Use the Pipeline Artifact task to publish artifacts, which are automatically available to subsequent stages without download.

    Why it's wrong here

    Incorrect. The Pipeline Artifact task publishes artifacts, but they are not automatically available to subsequent stages without explicitly using the Download Pipeline Artifact task.

  • Use the Publish Pipeline Artifact task in the first stage and Download Pipeline Artifact task in the second stage.

    Why this is correct

    Correct. The Publish Pipeline Artifact task in the first stage publishes artifacts, and the Download Pipeline Artifact task in the second stage retrieves them. This is the standard and recommended method.

  • Use the Publish Build Artifacts task and then the Download Build Artifacts task.

    Why it's wrong here

    Incorrect. The Publish/Download Build Artifacts tasks are legacy and not designed for multi-stage YAML pipelines. They may not reliably pass artifacts between stages.

  • Use the Copy Files task to copy artifacts to a shared network drive.

    Why this is correct

    Correct. The Copy Files task can copy files to a shared network drive that is accessible by agents in subsequent stages, making it a valid way to pass artifacts between stages.

  • Define variables in the first stage and reference them in the second stage.

    Why it's wrong here

    Variables are not artifacts; they are for pipeline parameters.

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

Same concept, more angles

1 more way this is tested on AZ-400

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which TWO features of Azure Pipelines help you manage build artifacts across stages? (Choose two.)

easy
  • A.Pipeline variables
  • B.Release gates
  • C.Build tags
  • D.Download Pipeline Artifact task
  • E.Publish Pipeline Artifact task

Why D: The Publish Pipeline Artifact task (option E) makes files available to subsequent stages by uploading them to Azure Pipelines, while the Download Pipeline Artifact task (option D) retrieves those artifacts in later stages. Together, they form the primary mechanism for passing build outputs across stages in a pipeline.

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.