You are a developer managing an Azure App Service web app named app-prod-westus. The web app currently has a deployment slot named staging that contains a pre-production release. You need to perform a deployment slot swap with preview from staging to the production slot to verify that the staging application works correctly with production configurations before the swap completes. Which sequence of actions should you perform to execute and complete the swap with preview?
- 1Run the command: az webapp deployment slot swap -g myResourceGroup -n app-prod-westus --slot staging --target-slot production --action preview
- 2Access the application using the staging slot's endpoint to verify that it functions correctly under production configuration settings.
- 3Run the command: az webapp deployment slot swap -g myResourceGroup -n app-prod-westus --slot staging --target-slot production --action swap
Answer
To perform a swap with preview, first run the swap command with the preview action to apply target configuration settings to the source slot. Next, verify the app's behavior at the staging slot's endpoint. Finally, complete the swap using the swap action.
The correct sequence ensures that the swap is first initialized in preview mode, which applies target configurations to the source slot. Once configurations are verified at the staging endpoint, the swap is completed by running the command with the swap action.
Step-by-Step Solution
Key Concept
Deployment slot swap with preview