What Is an Azure Managed Identity? Choose System- or User-Assigned
An Azure managed identity is an identity whose credentials Azure manages so an Azure resource can access other Microsoft Entra-enabled services. Workloads can request tokens without putting a password or client secret in application code, but they still need permissions on the target service. Consider a system-assigned identity when one resource needs its own identity that should be removed with it; consider a user-assigned identity when several resources share one identity or permissions must be prepared before deployment.
This article describes managed identities for Azure resources based on official documentation checked on November 19, 2026. It is scoped to supported Azure source resources and target services that accept Microsoft Entra authentication. It does not directly apply to workloads outside Azure or cross-directory (cross-tenant) access.
What role does managed identity play in authentication and authorization?
Suppose a web app needs to read files from Azure Storage. The app requests a token from Microsoft Entra ID by using the managed identity attached to its Azure-hosted resource. Azure manages the underlying credentials, so the app does not store or rotate a secret itself. The app presents the token to Storage, which validates it and then checks the permissions granted to that identity.
These are two distinct steps. The token authenticates “who is making the request”; the target service’s permission settings authorize “what that identity can do.” Enabling a managed identity therefore does not automatically give it Storage access. If the app only reads data, grant only the required read permission on the target data plane; also distinguish control-plane permissions for managing a resource from data-plane permissions for reading or writing its contents. Azure RBAC covers many Azure control operations and some data services, but target services can have their own data authorization mechanisms.
A managed identity does not make an app automatically secure. People who can run code on the resource to which the identity is attached, or vulnerable application code, may be able to request tokens as that identity. The security boundary includes the source resource and the actors who can execute code there, not only the identity object. Unnecessary permissions increase the damage possible if that resource is compromised.
How do system-assigned and user-assigned identities differ?
Azure has two types. A system-assigned identity is created when enabled on an Azure resource and shares that resource’s lifecycle. Deleting the parent resource deletes the identity, so this type fits a dedicated identity per resource when access should be cleaned up with the resource. The trade-off is that the identity and role assignments cannot be prepared before the resource exists.
A user-assigned identity is created first as a separate Azure resource and can be attached to one or more supported resources. It can centralize role assignments when several apps share the same target and permissions, and it is useful when approval must happen before deployment. Its lifecycle is independent of the application resource, however, so it can remain after an app is deleted. When no longer needed, detach it and remove the identity and role assignments deliberately.
| Consideration | System-assigned | User-assigned |
|---|---|---|
| Creation | Enabled on a supported resource | Created as a separate identity resource, then attached |
| Lifecycle | Deleted with the parent resource | Independent; must be deleted separately |
| Sharing | Attached to one Azure resource | Can be shared by multiple resources |
| Good fit | Dedicated identity for one resource; permissions should retire with it | Same workload on multiple resources, advance authorization, frequently replaced resources |
| Watch for | Identity creation and permission assignment order can block deployment | Every attached resource can use the identity’s shared permissions |
This table gives general selection criteria. Reusing one identity across resources can reduce the number of role assignments and operational work, but its full permission set becomes available to every attached resource. A system-assigned identity may be better when you need resource-specific audit trails or permission separation. Microsoft recommends user-assigned identities for some scenarios, so check support for the actual resource type and the organization’s separation requirements.
Which type should you choose?
Consider system-assigned first when one source resource, such as an app or VM, needs access to a target service and you want its permission lifecycle tied to that resource. It can also make activity easier to distinguish by resource.
Consider user-assigned first when several resources with the same function should share the same access, when identity approval must precede infrastructure deployment, or when resources are replaced frequently but the identity and permissions should remain stable. If one identity is attached to multiple workloads, check that every workload should be able to use the same permissions and that the shared scope is not too broad.
Some Azure resources support attaching both types. For example, a user-assigned identity could handle common Storage access while a system-assigned identity holds a separate permission needed by just one resource. This can help when the workload explicitly selects which identity to use and each permission boundary is reviewed. Do not assume every resource type and SDK supports the same configuration.
A safe setup and verification sequence
**Check support and define the goal.** Confirm that the source Azure resource supports managed identities and the target service accepts Microsoft Entra authentication. Write down the exact actions and data the app needs.
**Choose the identity type.** Decide whether the identity should share the source resource’s lifecycle or be reusable across resources. With a user-assigned identity, account for every resource that could use its permissions.
**Attach the identity to the source resource.** Enable the system-assigned identity on the resource, or create a user-assigned identity first and then attach it to a supported resource. Depending on your permissions and resource type, configuration may use the Azure portal, CLI, PowerShell, or ARM-based tools; exact steps vary by resource.
**Grant least privilege at the target.** Find the identity’s security principal in the target, such as a Storage account or Key Vault, and allow only required actions. For example, reading files does not require write or delete access. Separate control-plane management from data-plane permissions.
**Request a token with a supported SDK or connector.** Service code can use Azure Identity or Microsoft Authentication Library (MSAL), or a managed-identity connector provided by the source service. If multiple user-assigned identities are attached, explicitly specify which one the request should use.
**Verify both allowed and denied behavior.** In a non-production environment, confirm the app can perform its intended task and that an ungranted task is rejected. Check Entra sign-in logs, Azure Activity logs, and target-service logs to identify which identity made which request.
Permission changes might not take effect immediately. Azure-managed identity tokens are cached by the infrastructure per resource URI; Microsoft documentation says permission updates can take several hours and that a token cannot currently be forced to refresh before expiration. If access continues briefly after removing a role, check token caching and expiration as well as the target service’s authorization state before concluding that the change failed. For emergency revocation, do not assume role removal immediately blocks access; plan around the target’s behavior and the validity period of existing tokens.
What limitations and operational risks matter?
Managed identities are not universal credentials for every Azure service or external API. The source resource must support identity attachment, and the target must support Microsoft Entra authentication. The official FAQ states that cross-directory managed identity scenarios are currently unsupported. If a target cannot accept a managed identity or a workload runs outside Azure, evaluate workload identity federation or another credential approach.
Deleting an identity may not invalidate tokens already issued; those tokens can remain valid until their original expiration. A user-assigned identity that is no longer needed can also leave behind an orphaned identity and role assignments if it is not cleaned up. Re-enabling a system-assigned identity after deletion may create a new principal that needs role assignments again. Permissions to attach an identity to a resource matter too: someone who can deploy code to that resource or attach an identity may be able to use its permissions.
Managed identities reduce the work of storing and rotating application secrets, but they do not remove the need for permission design, resource security, logging, or lifecycle management. Confirm target support, control the sharing scope and deletion responsibility of user-assigned identities, and account for least privilege and token-cache delays in operations.
References
[Managed identities for Azure resources: overview and types](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview)
[Managed identity security and best-practice recommendations](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/managed-identity-best-practice-recommendations)
[Securing managed identities in Microsoft Entra](https://learn.microsoft.com/en-us/entra/architecture/service-accounts-managed-identities)
[Managed identities FAQ: permissions, limits, token caching, and deletion](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/managed-identities-faq)
[Manage user-assigned managed identities in the Azure portal](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/manage-user-assigned-managed-identities-azure-portal)