Question

Difficulty: MediumConfigure Azure App Service Web Apps

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?

  1. A
    The production slot begins using the system-assigned managed identity of the staging slot, causing it to access the test database.
  2. B
    The system-assigned managed identities are deleted during the swap, and you must recreate them for both slots.
  3. The production slot continues to use its original system-assigned managed identity and retains access to the production database.Answer
  4. D
    The 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

1
Determine how system-assigned managed identities are bound to Azure resources.
System-assigned managed identities are bound to the lifecycle of the specific Azure resource (the slot resource itself).
This establishes that the identity is not configuration-based and cannot be detached from the resource.
2
Analyze the impact of a slot swap operation on resource identities.
A slot swap swaps the application code and slot configurations (like app settings) but does not change the physical App Service slot resources or their system-assigned identities.
This confirms that the production slot resource keeps its original identity.
3
Determine the database access state of the production slot post-swap.
Because the production slot retains its original identity, it continues to have the permissions granted to that identity to access the production database.
This identifies the correct outcome of the swap.

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.
Rate this question