Skip to content

Commit 97ce776

Browse files
committed
Add managed identity to Kafka quickstart
1 parent 74acb1f commit 97ce776

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

articles/event-hubs/event-hubs-quickstart-kafka-enabled-event-hubs.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ To complete this quickstart, make sure you have the following prerequisites:
2222
* [Java Development Kit (JDK) 1.7+](/azure/developer/java/fundamentals/java-support-on-azure).
2323
* [Download](https://maven.apache.org/download.cgi) and [install](https://maven.apache.org/install.html) a Maven binary archive.
2424
* [Git](https://www.git-scm.com/)
25+
* To run this quickstart using managed identity, you need to run it on an Azure virtual machine.
2526

2627

2728
## Create an Event Hubs namespace
@@ -34,31 +35,33 @@ When you create an Event Hubs namespace, the Kafka endpoint for the namespace is
3435

3536
#### [Passwordless (Recommended)](#tab/passwordless)
3637

37-
1. Clone the [Azure Event Hubs for Kafka repository](https://github.com/Azure/azure-event-hubs-for-kafka).
38-
2. Navigate to `azure-event-hubs-for-kafka/quickstart/java/producer`.
39-
3. Update the configuration details for the producer in `src/main/resources/producer.config` as follows:
40-
41-
Managed identities for Azure resources provide Azure services with an automatically managed identity in Azure Active Directory. You can use this identity to authenticate to any service that supports Azure AD authentication, without having credentials in your code.
38+
1. Managed identities for Azure resources provide Azure services with an automatically managed identity in Azure Active Directory. You can use this identity to authenticate to any service that supports Azure AD authentication, without having credentials in your code.
4239

4340
Azure Event Hubs supports using Azure Active Directory (Azure AD) to authorize requests to Event Hubs resources. With Azure AD, you can use Azure role-based access control (Azure RBAC) to grant permissions to a security principal, which may be a user, or an application service principal.
4441

45-
To use Managed Identity, you can create a (or configure an existing) virtual machine using a system-assigned managed identity. See [Configure managed identities for Azure resources on a VM using the Azure portal](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#system-assigned-managed-identity) for more details.
42+
To use Managed Identity, you can create a (or configure an existing) virtual machine using a system-assigned managed identity. For more information about configuring managed identity on a VM, see [Configure managed identities for Azure resources on a VM using the Azure portal](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#system-assigned-managed-identity).
43+
44+
1. In the virtual machine that you configure managed identity, clone the [Azure Event Hubs for Kafka repository](https://github.com/Azure/azure-event-hubs-for-kafka).
45+
1. Navigate to `azure-event-hubs-for-kafka/quickstart/java/producer`.
46+
1. Update the configuration details for the producer in `src/main/resources/producer.config` as follows:
47+
48+
4649

47-
Once you configure the virtual machine with managed identity, you need to add managed idendity to Event Hubs namespace. For that you need to follow these steps.
50+
Once you configure the virtual machine with managed identity, you need to add managed identity to Event Hubs namespace. For that you need to follow these steps.
4851

49-
- In the Azure Portal, navigate to your Event Hubs namespace. Go to "Access Control (IAM)" in the left navigation.
52+
- In the Azure portal, navigate to your Event Hubs namespace. Go to "Access Control (IAM)" in the left navigation.
5053

51-
- Click + Add and select `Add role assignment`.
54+
- Select + Add and select `Add role assignment`.
5255

53-
- In the Role tab, select `Azure Event Hubs Data Owner` and click the Next button.
56+
- In the Role tab, select `Azure Event Hubs Data Owner` and select the Next button.
5457

5558
- In the `Members` tab, select the `Managed Identity` radio button for type to assign access to.
5659

57-
- Click the `+Select members` link. In the Managed Identity dropdown, select Virtual Machine and select your virtual machine's managed identity.
60+
- Select the `+Select members` link. In the Managed Identity dropdown, select Virtual Machine and select your virtual machine's managed identity.
5861

59-
- Click `Review + Assign`.
62+
- Select `Review + Assign`.
6063

61-
1. Once you configure managed identity you can update `src/main/resources/producer.config` as shown below.
64+
1. Once you configure managed identity, you can update `src/main/resources/producer.config` as shown below.
6265

6366
```xml
6467
bootstrap.servers=NAMESPACENAME.servicebus.windows.net:9093

0 commit comments

Comments
 (0)