Soru

Zorluk: OrtaConfigure Azure App Service Web Apps

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?

  1. 1Run the command: az webapp deployment slot swap -g myResourceGroup -n app-prod-westus --slot staging --target-slot production --action preview
  2. 2Access the application using the staging slot's endpoint to verify that it functions correctly under production configuration settings.
  3. 3Run the command: az webapp deployment slot swap -g myResourceGroup -n app-prod-westus --slot staging --target-slot production --action swap

Cevap

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.

Adım Adım Çözüm

1
Initiate the preview swap using the Azure CLI.
The configuration settings of the production slot are applied to the staging slot, and the swap process pauses.
This allows the staging slot to run the new code with production settings without routing live production traffic to it yet.
2
Test the staging application at its URL.
Confirm that the application behaves correctly with the production database connection strings and configuration settings.
This ensures that configuration mismatches or application startup issues are identified before traffic is redirected.
3
Complete the slot swap using the Azure CLI.
The staging slot code is moved to the production slot, and client traffic is directed to the new version.
This finalizes the deployment process after validation is successful.

Anahtar Kavram

Deployment slot swap with preview
Bu soruyu puanla