An organization deploys an Azure App Service web app named `app-retail` with a production slot and a deployment slot named `staging`. Each slot is configured with a system-assigned managed identity. You have two Azure Key Vaults:
* `kv-retail-prod` containing a secret named `DbConn`. The Key Vault access policy grants GET permissions to the production slot's system-assigned managed identity.
* `kv-retail-stage` containing a secret named `DbConn`. The Key Vault access policy grants GET permissions to the staging slot's system-assigned managed identity.
You configure the following application setting in both slots (without marking it as a deployment slot setting):
* Production slot: `DbConnectionString = @Microsoft.KeyVault(SecretUri=https://kv-retail-prod.vault.azure.net/secrets/DbConn/)`
* Staging slot: `DbConnectionString = @Microsoft.KeyVault(SecretUri=https://kv-retail-stage.vault.azure.net/secrets/DbConn/)`
You perform a standard deployment slot swap between the `staging` slot and the production slot. Immediately after the swap completes, you observe that the web app fails to connect to the database in both slots because the Key Vault references cannot be resolved.
Which of the following actions will resolve the Key Vault reference resolution failures while adhering to the principle of least privilege?
- Configure the DbConnectionString application setting as a deployment slot setting (sticky to slot) in both slots.Cevap
- BGrant the system-assigned managed identity of the production slot GET permissions on kv-retail-stage, and grant the system-assigned managed identity of the staging slot GET permissions on kv-retail-prod.
- CModify the Key Vault reference in the production slot to use the staging identity by adding the parameter ;UserAssignedIdentity=staging to the SecretUri query string.
- DConfigure a shared User-Assigned Managed Identity, assign it to both slots, grant it GET permissions on both Key Vaults, and update the setting to @Microsoft.AppConfiguration(SecretUri=https://kv-retail-prod.vault.azure.net/secrets/DbConn/;UserAssignedIdentity=shared-identity).