AZ-400 Practice Question: Design and implement build and release pipelines
You have a classic release pipeline that deploys to Azure App Service. You need to implement a canary deployment strategy where 10% of traffic is routed to the new version for 30 minutes before full rollout. What should you use?
⚠ Common exam trap
Candidates confuse Traffic Manager (DNS-level) and slot-based routing, but also mistakenly assume 'Swap with preview' supports traffic percentage. The correct tool is slot routing rules, not swap-based traffic shifting.
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
✓
Deploy to a staging slot and then use Azure CLI to update routing rules after deployment.
Canary deployment on Azure App Service is achieved by deploying to a deployment slot and then configuring routing rules to send a percentage of traffic to that slot. In a classic release pipeline, you can use the Azure App Service deploy task to deploy to a slot, followed by an Azure CLI task to set the traffic percentage (e.g., az webapp traffic-routing set). The 'Swap with preview' feature is for multi-phase swap validation, not for setting traffic percentages.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Configure multiple deployment slots and use Traffic Manager to distribute traffic.
Why it's wrong here
Traffic Manager operates at the DNS level to distribute traffic across globally deployed App Service instances in different regions, not between slots within a single app. Slot-level traffic routing is a built-in feature of Azure App Service that uses routing rules to send a percentage of requests to a staging slot, so Traffic Manager cannot perform canary deployment for one app.
- ✗
Use the 'Azure App Service deploy' task with the 'Deploy to Slot' option, then manually adjust routing rules.
Why it's wrong here
While the Azure App Service deploy task can deploy to a deployment slot, the subsequent routing rule adjustment is a manual process that does not automatically orchestrate a canary release. In contrast, slot swap with preview automates the traffic shifting and provides integration with pipeline approvals and validation, making it the recommended approach for gradual rollouts.
- ✓
Deploy to a staging slot and then use Azure CLI to update routing rules after deployment.
Why this is correct
Using Azure CLI to update routing rules after deploying to a staging slot is a manual, scripted step that lacks the automatic warm-up, validation, and controlled traffic shifting provided by swap with preview. This approach also doesn't integrate with release pipeline gates or provide a clear path to roll back if issues are detected during the canary phase.
- ✗
Use slot swap with 'Swap with preview' and set traffic percentage in the swap settings.
Why it's wrong here
Slot swap with preview is the correct mechanism for canary release because it deploys to a staging slot, lets you validate the build, and then gradually increases the traffic percentage to the staged version while keeping the original slot active. You can monitor health checks and decide when to complete the full swap, making this the only option that provides automated, controlled gradual deployment within Azure App Service.
Visual reference
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Task
A Task in Azure DevOps is a predefined, reusable step that performs a specific action during a build or release pipeline, like compiling code or running tests.
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.