You manage an Azure App Service web app named app-orders that includes a production slot and a deployment slot named staging. You configure a system-assigned managed identity for the production slot and grant it access to a production database. You also configure a system-assigned managed identity for the staging slot and grant it access to a test database. You swap the staging slot with the production slot. Which statement describes the managed identity behavior after the swap is completed?
- AThe production slot begins using the system-assigned managed identity of the staging slot, causing it to access the test database.
- BThe system-assigned managed identities are deleted during the swap, and you must recreate them for both slots.
- The production slot continues to use its original system-assigned managed identity and retains access to the production database.Answer
- DThe production slot uses the staging slot's identity, but Azure automatically updates the database access permissions to map to the production database.
Answer
The production slot continues to use its original system-assigned managed identity and retains access to the production database.
During an App Service slot swap, the system-assigned managed identity remains with its original slot resource. Since the production slot maintains its identity, it retains its authorized access to the production database.
Step-by-Step Solution
Key Concept
System-assigned managed identities are tied to the specific slot resource and do not change or swap during a deployment slot swap operation.