Understanding these authentication methods is essential for maintaining a secure and efficient cloud infrastructure, whether configuring a VM that needs access to a storage account or automating deployments with Azure DevOps.
A managed identity in Microsoft Entra ID enables Azure services to authenticate to other Azure resources without securely managing credentials. It automatically provides an identity that can obtain Entra ID tokens. This process eliminates the need for hardcoded credentials, which enhances security and simplifies authentication and authorization.
Two options are available for managed identities:
A system-assigned managed identity is created automatically with an Azure service instance, such as a VM or web app. The identity is tied to that resource, making it easy to manage but not shareable. For example, because the identity shares the same lifecycle as the service, deleting the service also deletes the identity.
This type of identity works best when a single resource needs access to other Azure resources and requires minimal management.
A system-assigned managed identity has the following attributes:
An Azure resource with a user-assigned managed identity operates independently, and users can assign the identity to one or more service instances. A user creates the identity manually as a standalone resource and manages it separately from any service instance. The identity persists until it's explicitly deleted.
This resource proves helpful when multiple resources share the same identity. It's also beneficial when users require more flexibility and control over the identity's lifecycle management.
In summary, a user-assigned managed identity has the following characteristics:
Managed identities in Azure eliminate the need for manual credential management, limit the risk of human error and reduce credential leaks. They enhance security by automatically handling the identity lifecycle and simplifying authentication for Azure services. For example, a managed identity can securely authenticate a VM to access Azure Key Vault without storing or embedding credentials in the application.
Users can create role assignments via Azure role-based access control (RBAC) to define an identity's permission for accessing resources. Azure Monitor and Azure Activity Logs help track identity usage and access patterns, as well as implement policies for compliance and governance.