Courseiva
hardMultiple SelectObjective-mapped

Two Practices for Building and Deploying Microservices Independently

A company is designing an Azure DevOps strategy for a microservices application. They need to ensure that each microservice can be built, tested, and deployed independently. They also want to reuse pipeline components across services. Which TWO practices should they implement?

Quick Answer

Pipeline templates let you define shared build and test logic once and reuse it across every microservice's pipeline without copy-pasting, and multi-stage YAML pipelines with a separate definition per microservice keep each service's build-test-deploy cycle fully independent — together satisfying both the reuse and the independent-deployment requirements.

⚠ Common exam trap

Many candidates confuse reusing pipeline components (templates) with centralizing everything (single pipeline or single variable group), missing that independent deployment requires separate pipeline definitions per microservice.

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 pipeline templates to define common build and test steps.

Pipeline templates in Azure DevOps allow you to define reusable YAML snippets for common build and test steps, enabling consistency across microservices without duplicating code. Option E is correct because multi-stage YAML pipelines with separate definitions per microservice ensure each service can be built, tested, and deployed independently, aligning with microservices architecture principles.

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 all microservice artifacts to the same Azure Artifacts feed.

    Why it's wrong here

    Artifact feed is unrelated to pipeline reuse.

  • Store all pipeline variables in a single variable group.

    Why it's wrong here

    Better to use per-service variable groups.

  • Create a single pipeline that handles all microservices.

    Why it's wrong here

    Single pipeline reduces independence.

  • Use pipeline templates to define common build and test steps.

    Why this is correct

    Templates promote reuse and consistency.

  • Use multi-stage YAML pipelines with separate pipeline definitions per microservice.

    Why this is correct

    Enables independent building and deployment.

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

Same concept, more angles

1 more way this is tested on AZ-400

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. You are designing a release pipeline for a microservices application deployed to Azure Kubernetes Service (AKS). Each microservice has its own build pipeline that produces a container image. You need a single release pipeline that can deploy multiple microservices in a coordinated manner, but you want to avoid rebuilding the deployment pipeline for each microservice. The deployment should use Helm charts. What should you do?

medium
  • A.Create a separate release pipeline for each microservice and trigger them in sequence using pipeline completion triggers.
  • B.Create a single build pipeline that produces all container images, then a release pipeline that deploys the single artifact.
  • C.Create a single release pipeline that consumes multiple build artifacts (one per microservice) and uses a Helm chart per microservice, deploying them in stages.
  • D.Create a single multi-stage YAML pipeline that builds and deploys all microservices together.

Why C: A single release pipeline can consume multiple build artifacts (one per microservice) and use Helm charts to deploy each microservice in stages. This allows coordinated deployment without duplicating the pipeline logic. Option A is incorrect because creating separate release pipelines for each microservice and triggering them sequentially lacks a single orchestration point and can lead to coordination failures. Option B is incorrect because creating a single build pipeline that produces all container images couples the builds and prevents independent microservice development. Option D is incorrect because a single multi-stage YAML pipeline that builds and deploys all microservices together also couples the build and deploy stages, and does not allow each microservice to have its own independent build pipeline.

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.