AZ-400 Question 154
Select 2You manage an e-commerce .NET application hosted on Azure App Service. The business demands minimal downtime during updates, the ability to quickly roll back if issues are discovered, and a safe way to validate new features in a near-production environment. Which two of the following strategies should you implement to meet these requirements?
- A
- Configure a staging deployment slot, validate the app in staging, and then perform a swap to production once testing is complete.
- B
- Use a rolling deployment that updates the production slot in-place, pushing changes directly to live instances in small batches without using additional slots.
- C
- Overwrite the production environment directly with no slot usage, ensuring a simplified, one-step deployment.
- D
- Implement a blue-green deployment with two identical environments and switch traffic only after successful validation in the new environment.
- E
- Stop the production App Service, manually copy new application files into the environment, and restart the service.
Show answer and explanation
Correct answers: A, D
Explanation
Deployment slots and blue-green deployments are recommended approaches in Azure for reducing downtime and providing efficient rollback options. By using a staging slot, you can validate new code in an environment that closely mirrors production before swapping. Similarly, blue-green deployments allocate separate environments to thoroughly test the new version before directing live traffic to it. Both methods align with Microsoft best practices for continuous delivery and high availability. For more details, refer to the official Azure App Service documentation on deployment slots and DevOps best practices.
- A. Correct.
Option 1 is correct. Using a staging slot allows you to deploy and test your application in a nearly identical environment without affecting production users. Once you are confident that the update works as expected, you can swap the slots. This approach minimizes downtime and provides a straightforward rollback mechanism by swapping back if issues appear.
- B. Incorrect.
Option 2 is incorrect. While rolling deployments can reduce downtime, Azure App Service typically uses deployment slots for zero-downtime updates or advanced deployment methods. Rolling updates in this context may still cause partial downtime or interrupt connections if not carefully managed, and it does not provide as seamless a rollback strategy as slots or a fully separate environment.
- C. Incorrect.
Option 3 is incorrect. Directly overwriting the production environment without additional staging or slots poses a high risk. If a problem arises, you must redeploy or revert manually, which can lead to extended downtime and potential service disruptions.
- D. Correct.
Option 4 is correct. Blue-green deployment is a proven strategy to minimize downtime and risk. You maintain two identical environments (blue and green). Traffic is routed to one environment while you deploy and test in the other. If validation passes, you switch traffic to the new environment, and if any issue arises, rolling back is quick by switching traffic back.
- E. Incorrect.
Option 5 is incorrect. Stopping the production service and manually copying files is disruptive and inefficient. This approach inevitably causes significant downtime and limits your ability to perform quick rollbacks.