AZ-400 Practice Question: Design and implement build and release pipelines
You are implementing a CI pipeline for a Node.js application. The pipeline must run unit tests and generate code coverage reports. You want to publish the coverage results to Azure DevOps and enforce a minimum coverage threshold of 80%. Which tasks should you use?
⚠ Common exam trap
It's easy for candidates to confuse 'publishing test results' with 'publishing code coverage results,' assuming the Publish Test Results task can handle coverage data, when in fact coverage requires a dedicated task with threshold enforcement.
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 Code Coverage Results task and configure the threshold in the task settings.
The Publish Code Coverage Results task is specifically designed to publish code coverage data (e.g., Cobertura or JaCoCo XML reports) to Azure DevOps and supports configuring a minimum coverage threshold directly in its settings. This meets both requirements: publishing results and enforcing the 80% threshold. Other tasks like Publish Test Results or Publish Build Artifacts do not natively handle coverage threshold enforcement.
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 Publish Test Results task to publish coverage data.
Why it's wrong here
The Publish Test Results task is designed to upload test result files (e.g., TRX, JUnit) to show pass/fail outcomes and attach them to the pipeline run. It cannot parse code coverage formats like Cobertura, JaCoCo, or Istanbul, so coverage data would not be reported or used for threshold enforcement.
- ✗
Use the Publish Build Artifacts task with coverage files.
Why it's wrong here
Publishing coverage files as build artifacts simply makes them available for download or later stages; it does not interpret the coverage data, generate a coverage report, or enforce quality gates. The pipeline would not have a coverage summary or threshold checks, so this approach fails to meet the requirement.
- ✗
Use the Copy Files task to copy coverage files and then the Publish Build Artifacts task.
Why it's wrong here
The Copy Files task only copies files from one location to another within the agent; it does not analyze coverage content. Even when followed by Publish Build Artifacts, the pipeline still lacks a coverage-aware task to parse the coverage report and validate threshold policies, so it is insufficient.
- ✓
Use the Publish Code Coverage Results task and configure the threshold in the task settings.
Why this is correct
The Publish Code Coverage Results task is the correct solution because it natively consumes coverage files (e.g., Cobertura, JaCoCo) and publishes them to the pipeline summary. It also has threshold settings to enforce minimum coverage percentages, which can fail the build if the thresholds are not met, satisfying both reporting and quality gate requirements.
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
DevOps
DevOps is a set of practices that combines software development (Dev) and IT operations (Ops) to shorten the development lifecycle and deliver high-quality software continuously.
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.