Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon How do I set up access for a managed identity at the resource group level


How do I set up access for a managed identity at the resource group level


To set up access for a managed identity at the resource group level, you need to assign the appropriate Azure role-based access control (Azure RBAC) roles to the managed identity. Here’s how you can do it:

1. Create a Managed Identity: First, ensure you have a managed identity created. You can create a user-assigned managed identity using the Azure portal or Azure CLI. For Azure CLI, use the command:

bash
   az identity create -g  -n 
   

2. Assign Role to the Managed Identity: Navigate to the resource group where you want to grant access. In the Azure portal, go to the resource group's page and select Access control (IAM) from the left menu.

3. Add Role Assignment: Click on Role assignments and then + Add > Add role assignment. Select the appropriate role for your needs (e.g., Reader, Contributor, etc.) and enter the name of your managed identity in the Select members field. Choose the managed identity from the search results and click Review + assign.

4. Confirm the Assignment: Review the role assignment details and click Assign to confirm. This grants the managed identity the specified permissions at the resource group level.

By following these steps, you ensure that your managed identity has the necessary permissions to access resources within the specified resource group.

Citations:
[1] https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities
[2] https://docs.azure.cn/en-us/logic-apps/authenticate-with-managed-identity
[3] https://www.anoopcnair.com/use-managed-identities-for-azure-resources/
[4] https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/managed-identities-faq
[5] https://www.youtube.com/watch?v=rUpI4X3ADeg
[6] https://stackoverflow.com/questions/76995900/how-to-grant-a-managed-identity-permissions-to-an-azure-sql-database-using-iac
[7] https://www.varonis.com/blog/azure-managed-identities
[8] https://docs.azure.cn/en-us/automation/enable-managed-identity-for-automation