You manage an Azure App Service web app named `app-catalog` that contains a production slot and a deployment slot named `staging`. The application uses an application setting named `DatabaseConnectionString` to connect to a database.
You must configure the web app to meet the following requirements:
- The staging slot must always connect to the staging database, and the production slot must always connect to the production database, even after a swap operation.
- The web app must perform a custom warm-up request to the path `/api/warmup` before the slot swap completes.
Which two configuration steps should you perform? (Select two.)
- Configure DatabaseConnectionString as a deployment slot setting.Cevap
- Add an application setting named WEBSITE_SWAP_WARMUP_PING_PATH and set its value to /api/warmup.Cevap
- CAdd a Key Vault reference named DatabaseConnectionString with the syntax @Microsoft.AppConfiguration(Endpoint=https://kv-catalog.vault.azure.net/secrets/dbconn).
- DConfigure the autoscale rules to trigger a scale-out event using a Memory Percentage metric whenever a swap is initiated.
Cevap
To configure the database connection strings to remain slot-specific and to specify a custom warm-up path, you must configure the DatabaseConnectionString setting as a deployment slot setting and add an application setting named WEBSITE_SWAP_WARMUP_PING_PATH with the value /api/warmup.
Marking the connection string as a deployment slot setting ensures it stays with the respective slot (staging connects to staging DB, production connects to production DB) after a swap. Setting the WEBSITE_SWAP_WARMUP_PING_PATH environment variable ensures that App Service performs the warm-up request to the custom path before routing production traffic to the new instance.
Adım Adım Çözüm
Anahtar Kavram
Configuring deployment slots and slot swap behaviors in Azure App Service.