Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon What are the best practices for using system-assigned managed identities in Azure


What are the best practices for using system-assigned managed identities in Azure


When using system-assigned managed identities in Azure, several best practices can help optimize their use:

1. Use for Single Resource Workloads: System-assigned identities are ideal for workloads contained within a single Azure resource. They are automatically created and deleted with the resource, simplifying management for resources that do not need to share identities[5][6].

2. Audit Logging and Permissions Management: System-assigned identities are beneficial when you need to log actions by specific resources or manage permissions that should be removed when the resource is deleted. This ensures that each resource has its own identity for auditing purposes and that permissions are automatically revoked when the resource is deleted[1][5].

3. Least Privilege Principle: Always grant the least permissions necessary to the managed identity. This minimizes the security risk if the identity is compromised. Ensure that the identity only has access to the resources and actions required for its operation[1][7].

4. Role Assignment Management: Role assignments are not automatically deleted when a system-assigned identity is deleted. Ensure that these assignments are manually removed to avoid exceeding role assignment limits and to maintain a clean environment[1].

5. Avoid Rapid Resource Creation: Be cautious when rapidly creating resources with system-assigned identities, as this can lead to rate limits on Microsoft Entra object creations and may exceed Azure subscription limits[1].

6. Security Considerations: When assigning system-assigned identities to resources that execute code (like Azure Functions or Logic Apps), ensure that users with access to these resources do not have unnecessary permissions that could be exploited through the managed identity[1].

Citations:
[1] https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/managed-identity-best-practice-recommendations
[2] https://stackoverflow.com/questions/67578296/what-are-the-best-practices-to-create-a-user-assigned-managed-identity-for-an-az
[3] https://www.varonis.com/blog/azure-managed-identities
[4] https://docs.azure.cn/en-us/automation/enable-managed-identity-for-automation
[5] https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview
[6] https://cloudtips.nl/the-magic-of-azure-managed-identities-%EF%B8%8F-19747c37e652
[7] https://docs.azure.cn/en-us/entra/identity/managed-identities-azure-resources/overview-for-developers
[8] https://www.red-gate.com/simple-talk/cloud/azure/azure-function-and-user-assigned-managed-identities/