You are deploying a web application to an Azure App Service web app that has a production slot and a staging deployment slot. The application requires a database connection string defined in its application settings. You must ensure that the staging slot always connects to the staging database and the production slot always connects to the production database, even after you perform a slot swap. Which configuration should you apply to the connection string setting?
- Mark the setting as a deployment slot setting.Cevap
- BConfigure the setting as a Key Vault reference using a system-assigned managed identity.
- CConfigure the setting in the App Service Plan configuration.
- DConfigure the setting as a User-Assigned Managed Identity reference.
Cevap
Mark the setting as a deployment slot setting.
Marking the configuration as a deployment slot setting ensures that the database connection string is sticky to the slot. When you perform a slot swap, Azure swaps all settings that are not marked as deployment slot settings, but leaves slot-specific settings untouched, keeping the staging slot connected to the staging database and the production slot connected to the production database.
Adım Adım Çözüm
Anahtar Kavram
Deployment Slot Settings (Sticky Settings)