AZ-400 Question 163
Single answerYour organization hosts a mission-critical e-commerce platform on Azure App Service. You need to deploy a new release with minimal downtime. The solution must also allow for a quick rollback if critical issues arise in production. Which approach should you recommend to achieve these requirements?
- A
Deploy the new version directly to the production slot and restart the app to apply changes.
- B
Deploy the new version to the staging slot, run tests, then swap the staging slot with production.
- C
Implement an offline production update by disabling the site, pushing changes, and re-enabling once complete.
- D
Use Traffic Manager to incrementally direct traffic to the new version until all users are migrated.
Show answer and explanation
Correct answer: B
Explanation
Using Azure App Service deployment slots (staging and production) and swapping them is a recommended strategy to achieve near-zero downtime and allow quick rollback if needed. By deploying first to the staging slot, you can validate the new version in a production-like environment. Once validated, performing a slot swap lets traffic seamlessly transition to the updated app without causing a noticeable outage. Detailed guidance is available in Azure App Service documentation at https://learn.microsoft.com/azure/app-service/deploy-staging-slots.
- A. Incorrect.
Option 1 is incorrect. Deploying directly to production offers no opportunity for a warm-up or thorough validation prior to going live, and it provides limited rollback protection.
- B. Correct.
Option 2 is correct. By deploying to a staging slot and then swapping with production, you minimize downtime and can quickly swap back if issues arise. This is a common best practice in Azure App Service to reduce disruptions and enable fast rollback.
- C. Incorrect.
Option 3 is incorrect. An offline update would cause downtime for users since the site is deliberately taken offline during deployment.
- D. Incorrect.
Option 4 is incorrect. While using Azure Traffic Manager can help with regional rollouts, it does not specifically address the quick-swap or rollback scenario within a single App Service environment and can introduce more complexity than necessary if all applications are in one region.