Courseiva
Design and implement build and release pipelineseasyMultiple SelectObjective-mapped

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

Your team wants to implement automated testing in the build pipeline. You need to ensure that tests run and results are published. Which TWO tasks should you include?

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

Visual Studio Test task

The correct tasks are Visual Studio Test task (option C) which runs the tests, and Publish Test Results task (option D) which publishes the test results to Azure Pipelines. Option A (Publish Build Artifacts) publishes build outputs but not test results. Option B (Copy Files) copies files between locations and does not run tests. Option E (Azure PowerShell) runs PowerShell scripts and is not for testing.

Answer analysis

Option-by-option breakdown

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

  • Publish Build Artifacts task

    Why it's wrong here

    The Publish Build Artifacts task uploads build outputs (e.g., binaries, packages) to Azure Pipelines for downstream consumption or deployment, but it neither executes tests nor reads test result files. It is purely a file-staging mechanism, not a test runner.

  • Copy Files task

    Why it's wrong here

    The Copy Files task copies files from a source directory to a destination on the build agent, commonly used to prepare deployment artifacts or organize outputs. However, it has no ability to invoke test frameworks, collect test outcomes, or generate test result reports, making it irrelevant for automated testing.

  • Visual Studio Test task

    Why this is correct

    The Visual Studio Test task is the correct choice because it uses vstest.console.exe to run unit tests from test assemblies (MSTest, xUnit, NUnit) and produces test result data (e.g., TRX). It is the built-in Azure Pipelines task that actually executes tests during the build.

  • Publish Test Results task

    Why this is correct

    The Publish Test Results task consumes test result files (TRX, JUnit, etc.) and uploads them to Azure Pipelines, making test summary, pass/fail rates, and coverage visible on the Tests tab. It typically runs after a test execution task like Visual Studio Test to report the outcome.

  • Azure PowerShell task

    Why it's wrong here

    The Azure PowerShell task runs PowerShell scripts in an Azure authentication context for managing Azure resources or automating cloud operations. It lacks any integration with test frameworks and cannot emit standardized test result payloads for Azure Pipelines, so it is not intended for test automation.

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.