AZ-400 Practice Question: Design and implement build and release pipelines
Which TWO actions should you take to implement a CI/CD pipeline for a microservices application using Azure Pipelines? (Choose two.)
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
✓
Publish build artifacts and use them in the release stages.
Options B and D are correct. B: Publishing build artifacts and using them in release stages ensures consistency between build and deploy. D: Using a multi-stage YAML pipeline allows you to define build, test, and deploy stages in a single file. Option A is wrong because classic release pipelines are not recommended; YAML is preferred for CI/CD. Option C is wrong because credentials should not be stored in YAML; use variable groups or Azure Key Vault. Option E is wrong because a single multi-stage pipeline can handle multiple microservices using matrix strategies; separate pipelines increase complexity.
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 a classic release pipeline instead of YAML for the deployment stages.
Why it's wrong here
Using a classic release pipeline for deployment stages is an anti-pattern because it splits your pipeline definition between YAML (build) and a UI-driven editor (release), resulting in two places to configure and enforce policies, and preventing you from capturing the entire delivery process as code. Classic release pipelines store configuration in the Azure DevOps UI, not in the repository, which breaks infrastructure-as-code principles, makes pull-request validation for release logic impossible, and hampers reproducibility across environments. Azure Pipelines now treats YAML as the first-class option for multi-stage CI/CD, and classic releases are only recommended for legacy scenarios where you cannot migrate to YAML.
- ✓
Publish build artifacts and use them in the release stages.
Why this is correct
Publishing build artifacts is essential because it decouples the build phase from the release phase, producing an immutable, versioned binary that can be downloaded by any downstream stage or release pipeline. The Publish Pipeline Artifact task stores files in Azure Pipelines and associates them with the run, so the exact bits that passed tests are the ones deployed, eliminating drift between environments and supporting reliable rollback because each deployment can reference a known artifact version. Without this, release stages would have to rebuild or restore packages, breaking reproducibility and atomic deployment.
- ✗
Store deployment credentials directly in the YAML file.
Why it's wrong here
Storing deployment credentials directly in the YAML file exposes secrets in source control and pipeline logs, violating security best practices. Instead, use Azure Key Vault-backed variable groups or secret variables to securely inject credentials at runtime without hardcoding them.
- ✓
Use a multi-stage YAML pipeline that includes build, test, and deploy stages.
Why this is correct
Implementing a multi-stage YAML pipeline is the recommended approach because it defines build, test, and deploy stages in a single source-controlled file that can be versioned, reviewed, and branched alongside your application code. It supports environment targets, approvals, checks, and stage dependencies natively, allowing you to gate promotions and use conditionals like `condition: succeeded()` to run deployments only after tests pass. YAML also enables you to reuse templates for stage logic, making the pipeline portable across projects and fully auditable as part of the codebase, unlike UI-only classic definitions.
- ✗
Create a separate pipeline for each microservice.
Why it's wrong here
Creating a dedicated pipeline per microservice fragments CI/CD logic, forcing duplicated YAML or classic definitions across repositories and making it exponentially harder to introduce global changes such as updating a build agent image or adding a security scan step. It also prevents you from using a single pipeline with a matrix strategy to iterate over multiple services in parallel, which reduces maintenance and ensures the same build, test, and deployment logic is applied consistently to every microservice. Consolidating into one pipeline with parametrized stage templates keeps the codebase DRY and centralizes approval gates and release orchestration.
Visual reference
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Azure Key Vault
Azure Key Vault is a cloud service for securely storing and managing sensitive information like passwords, encryption keys, and certificates.
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
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 →
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.