AZ-400 Practice Question: Design and implement build and release pipelines
Your team uses Azure Pipelines to build a .NET Core application. The build runs successfully on Windows agents, but you need to also run the build on Linux agents to validate cross-platform compatibility. The pipeline currently has a single `windows-latest` agent pool. What is the most efficient way to run the build on both platforms without duplicating the entire pipeline?
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
✓
Add a `strategy` with a `matrix` that specifies `vmImage: ['windows-latest', 'ubuntu-latest']` in the job.
Using a `strategy` with a `matrix` allows the same job to run on multiple agent pools in parallel, enabling cross-platform validation without duplicating the pipeline. Option A duplicates the entire pipeline, which is inefficient. Option B would require separate jobs, but not as concise as the matrix strategy. Option C uses stages, which run sequentially, not in parallel for this purpose.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create two separate pipelines, one for each platform.
Why it's wrong here
Creating two entirely separate pipeline definitions duplicates logic, YAML, and maintenance effort; any change to the build steps must be applied twice and can easily drift out of sync. This approach also forgoes the built-in matrix strategy in Azure Pipelines, which is specifically designed to run identical jobs across multiple agent pools in parallel.
- ✗
Use a multi-job pipeline with two jobs, each specifying a different pool.
Why it's wrong here
While a multi-job pipeline with two jobs each targeting a different pool can build both platforms in parallel, it forces you to duplicate the complete build steps in each job, or at best rely on a shared template to avoid repetition, which adds indirection and maintenance overhead. The job definitions must also hardcode each pool name, and adding a third platform means copying the entire job block again. A matrix strategy, in contrast, defines the steps once and expands a single job into multiple instances, so you get parallel cross-platform builds with drastically less YAML and a single source of truth for build logic.
- ✗
Use a multi-stage pipeline with a stage for each platform.
Why it's wrong here
Multi-stage pipelines execute stages sequentially by default, meaning the Windows stage would not start until the Linux stage fully completes, roughly doubling the build duration. Unlike a matrix strategy, stages also introduce extra planning overhead, and they are better suited for deployment progression with approvals rather than parallel cross-platform compilation.
- ✓
Add a `strategy` with a `matrix` that specifies `vmImage: ['windows-latest', 'ubuntu-latest']` in the job.
Why this is correct
Adding a `strategy` with a `matrix` to a job instructs Azure Pipelines to expand that job into multiple job instances at queue time, each with the same steps but with the matrix variables assigned from a specific entry. By mapping a variable like `vmImage` to `['windows-latest', 'ubuntu-latest']` and then referencing it via `$(vmImage)` in the pool specification, the same job runs simultaneously on both Windows and Linux agents, producing a true parallel cross-platform build. This is the idiomatic Azure Pipelines pattern because it keeps the job logic in one place, eliminates duplication, and makes adding or removing a platform as simple as editing a list in the matrix.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Agent
An agent is a software component that runs on a local machine to perform automated tasks, collect data, or execute commands as part of a larger system like CI/CD or monitoring.
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
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 →
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.