Courseiva
Design and implement build and release pipelineseasyMultiple ChoiceObjective-mapped

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

You are designing a build pipeline for a Java application that uses Maven. You want to publish the compiled JAR file as a build artifact. Which task should you use?

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

PublishBuildArtifacts@1

The Publish Build Artifacts task publishes files as pipeline artifacts. Option B (Maven@3) is wrong because it builds the project but does not publish artifacts. Option C (ArchiveFiles@2) is wrong because it creates a zip but does not publish. Option D (CopyFiles@2) is wrong because it only copies files within the agent.

Answer analysis

Option-by-option breakdown

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

  • PublishBuildArtifacts@1

    Why this is correct

    PublishBuildArtifacts@1 uploads a specified directory or file to the Azure Pipelines artifact store, assigning it a name so it can be downloaded from the build summary or consumed by subsequent jobs, stages, and release pipelines. This task is the definitive way to make build outputs available as build artifacts.

  • Maven@3

    Why it's wrong here

    Maven@3 invokes the Maven build tool to compile, test, and optionally package a Java application, but it only writes outputs like JAR files to the agent's working directory. Although it may produce build deliverables, it does not upload them to the Azure Pipelines artifact service, so a separate publish task is required.

  • ArchiveFiles@2

    Why it's wrong here

    ArchiveFiles@2 compresses source or build files into a .zip, .7z, or .tar.gz archive on the local file system, but creating an archive is not the same as registering it as a pipeline artifact. Without an explicit PublishBuildArtifacts step, the archive remains on the agent and is not downloadable from the build.

  • CopyFiles@2

    Why it's wrong here

    CopyFiles@2 copies files from a source folder to a target folder within the agent machine, typically used to stage content before publishing or testing. It performs no upload to Azure DevOps, so copied files are not exposed as build artifacts and will not be available to other pipelines or releases.

About these practice questions

Courseiva writes every AZ-400 question from scratch — 823 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.