AZ-104 Question 194
Single answerYou manage an Azure App Service named contoso-webapp. The application has a single deployment slot called 'Production'. To test changes before they impact end users, you create a new deployment slot named 'Staging'. After you deploy code changes to Staging and validate them, how can you ensure all traffic uses the updated code while preserving environment-specific settings?
- A
Perform a swap operation between the Production and Staging slots
- B
Clone the Production slot into a new slot named 'Updated-Staging', then deploy your changes there
- C
Redirect inbound traffic to the Staging slot by changing DNS records to the Staging URL
- D
Deploy staging updates directly into the Production slot to overwrite the existing app
Show answer and explanation
Correct answer: A
Explanation
Using the swap feature moves the tested version in the Staging slot to Production while maintaining the slot-specific settings of each environment. This method allows you to validate changes safely and enables quick rollback if needed.
- A. Correct.
Swapping slots ensures that any settings configured as 'slot settings' remain in their respective slot, and only the site content and non-slot-specific settings move.
- B. Incorrect.
Cloning the Production slot creates a new slot, but it does not automatically preserve environment settings and traffic from the existing Production slot.
- C. Incorrect.
Changing DNS records forces all traffic to the Staging slot directly, but it does not leverage the built-in environment setting preservation provided by slot swaps.
- D. Incorrect.
Deploying changes directly to the Production slot overwrites the existing code, which defeats the purpose of having a staging environment for testing and validation.