AZ-400 Practice Question: Design and implement build and release pipelines
Your release pipeline deploys a .NET Core web app to Azure App Service using a deployment slot for staging. The pipeline runs integration tests against the staging slot. After tests pass, you want to swap the staging slot with production. However, the swap fails sometimes because the staging slot has different configuration settings. What is the best practice to ensure swapping succeeds?
⚠ Common exam trap
Candidates often confuse 'swap with preview' (which is about validation and rollback) with the root cause of swap failures, not realizing that slot-sticky settings are the proper mechanism to prevent configuration conflicts during a swap.
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 slot-specific configuration settings (deployment slot settings) for connection strings and app settings that differ between slots.
Azure App Service allows you to mark specific configuration settings (like connection strings and app settings) as 'deployment slot settings.' When a setting is marked as slot-specific, it stays with the slot during a swap, preventing failures caused by mismatched configurations. This ensures that the staging slot retains its test-specific settings (e.g., a test database connection string) while the production slot keeps its own settings, making the swap predictable and reliable.
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 slot-specific configuration settings (deployment slot settings) for connection strings and app settings that differ between slots.
Why this is correct
In Azure App Service, deployment slot settings are marked as 'sticky' so they remain with the slot during swap, ensuring correct connection strings and app settings are applied regardless of swap. This prevents configuration mismatches and eliminates the need for manual updates or scripts. By defining slot-specific settings, production continues to use its intended values while staging uses its own, making swap safe.
- ✗
Manually update the production slot settings to match staging before each swap.
Why it's wrong here
This approach is error-prone because it relies on human memory and manual steps, and any missed setting can cause runtime failures after swap. It also introduces downtime and delays in the release process, and does not scale for frequent deployments or multiple environments. Azure's slot settings or configuration transformations are the recommended automation.
- ✗
Perform a swap with preview and then complete the swap after verifying the staging slot.
Why it's wrong here
Swap with preview is a valid feature for validation, but it does not change the underlying configuration problem. The staging slot will still have its own settings, and if staging settings are not sticky, they will move to production during swap. This approach only adds a validation step, not a configuration fix.
- ✗
Write a custom PowerShell script to copy configuration from staging to production before swapping.
Why it's wrong here
Custom scripts introduce maintenance overhead, require handling of authentication and retries, and can lead to inconsistencies if the script fails or is partially executed. Azure already provides slot settings as a built-in, declarative mechanism, so scripting is redundant and increases complexity. Additionally, copying settings before swap may overwrite production-specific values unintentionally.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
Key term
Deployment slot
A deployment slot is a live staging environment in Azure App Service that allows you to swap app versions with zero downtime for testing before going to production.
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.