|
| 1 | +--- |
| 2 | +title: Enable managed identity for a namespace |
| 3 | +description: Learn how to enable a system-assigned or user-assigned managed identity for an Azure Event Hubs namespace. |
| 4 | +ms.topic: how-to |
| 5 | +ms.date: 01/29/2025 |
| 6 | +# Customer intent: As a developer or administrator, I want to learn how to enable managed identity for an Azure Event Hubs namespace. |
| 7 | +--- |
| 8 | + |
| 9 | +# Enable managed identity for an Azure Event Hubs namespace |
| 10 | +This article shows you how to enable a managed identity for an Azure Event Hubs namespace. The identity can be either a system-assigned managed identity or a user-assigned managed identity. |
| 11 | + |
| 12 | +## Enable system-assigned managed identity for a namespace |
| 13 | +Here are the steps to enable a system-assigned managed identity for an Event Hubs namespace by using the Azure portal. |
| 14 | + |
| 15 | +1. Sign-in to the [Azure portal](https://portal.azure.com). |
| 16 | +1. Navigate to your Event Hubs namespace. |
| 17 | +1. On the **Event Hubs namespace** page, select **Identity** on the left menu. |
| 18 | +1. On the **Identity** page, confirm that you are on the **System assigned** tab. |
| 19 | +1. For the **Status** field, select **On**. |
| 20 | +1. Select **Save** the command bar. |
| 21 | + |
| 22 | + :::image type="content" source="./media/enable-managed-identity/system-assigned-identity.png" alt-text="Screenshot that shows the Identity page for an Event Hubs namespace with system-assigned managed identity enabled." lightbox="./media/enable-managed-identity/system-assigned-identity.png"::: |
| 23 | +1. In the Pop-up window, select **Yes**. |
| 24 | + |
| 25 | + :::image type="content" source="./media/enable-managed-identity/system-assigned-identity-enable.png" alt-text="Screenshot that shows the popup window to enable the system-assigned identity."::: |
| 26 | + |
| 27 | + |
| 28 | +## Enable user-assigned managed identity for a namespace |
| 29 | +Here are the steps to enable a user-assigned managed identity for an Event Hubs namespace by using the Azure portal. |
| 30 | + |
| 31 | +1. Sign-in to the [Azure portal](https://portal.azure.com). |
| 32 | +1. If you didn't create a user-assigned identity already, create one by following instructions from: [Manage user-assigned managed identities](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities). |
| 33 | +1. In the Azure portal, navigate to your Event Hubs namespace. |
| 34 | +1. On the **Event Hubs namespace** page, select **Identity** on the left menu. |
| 35 | +1. Switch to the **User assigned** tab, and select **+ Add** on the command bar. |
| 36 | + |
| 37 | + :::image type="content" source="./media/enable-managed-identity/user-assigned-add-button.png" alt-text="Screenshot that shows the User assigned tab." lightbox="./media/enable-managed-identity/user-assigned-add-button.png"::: |
| 38 | +1. In the **Add user assigned identity** pane, search for and select a user-assigned identity, and then select **Add**. |
| 39 | + |
| 40 | + :::image type="content" source="./media/enable-managed-identity/select-user-assigned-identity.png" alt-text="Screenshot that shows the selection of a user assigned identity." ::: |
| 41 | + |
| 42 | +## Related content |
| 43 | +After you enable managed identity for your Event Hubs namespace, grant the identity appropriate role on a target resource. For example, if you want to enable capturing of event data on an event hub using a managed identity, the managed identity should be added to the **Storage Blob Data Contributor** role on the Azure storage or Data Lake Store account. For more information on using identities for capturing event data, see [Authenticate modes for capturing events to destinations in Azure Event Hubs](event-hubs-capture-managed-identity.md). |
0 commit comments