A DevOps team is designing a release strategy for an application that requires zero downtime during deployments. The application runs on Azure App Service. The team wants to use deployment slots to achieve this. After deploying a new version to a staging slot and performing validation, they need to swap the staging slot with the production slot. However, the application has specific configurations (e.g., connection strings, application settings) that are unique to the production environment and should NOT be swapped with the staging slot's configurations. How should the team configure the deployment slots to prevent these production-specific settings from being swapped?
- AEnable 'Swap with preview' on the staging slot during the swap operation.
- BConfigure separate application settings for each slot without any special marking.
- CMark the production-specific settings as 'sticky' to the production slot.
- DUse Azure Key Vault to store all production settings and retrieve them post-swap.
Show answer & explanationAnswer & explanation
Correct answer: C. Mark the production-specific settings as 'sticky' to the production slot.
In Azure App Service deployment slots, settings marked as 'slot setting' (often referred to as 'sticky' settings) will remain with the slot they are configured for, even after a swap operation. This ensures that production-specific configurations stay with the production slot, and staging-specific configurations stay with the staging slot, preventing unintended overwrites during a swap.
Why the other options are wrong
- A. 'Swap with preview' is a validation step during the swap process, but it doesn't prevent specific settings from being swapped unless they are marked as slot settings.
- B. Configuring separate settings without marking them as 'slot settings' means they will be swapped along with the application code, leading to the exact problem the team wants to avoid.
- D. While Key Vault is good for secret management, using it to store all production settings and retrieving them post-swap is an overly complex solution for slot-specific settings, as App Service provides a native mechanism.
Azure App Service Slot Settings
Slot settings (or 'sticky settings') in Azure App Service deployment slots are application settings or connection strings that are specifically tied to a slot and do not swap with the application content when a slot swap occurs. This ensures environment-specific configurations remain in their correct slots.
- Ensures environment-specific configurations persist across swaps.
- Prevents unintended configuration changes in production during deployment.
- Configured in the 'Configuration' section of an App Service slot.
Memory trick: Sticky settings stay put, even when slots swap.