Skip to content

Commit fd63196

Browse files
committed
updated instructions for Azure AD
1 parent 6bbf9a0 commit fd63196

File tree

7 files changed

+27
-9
lines changed

7 files changed

+27
-9
lines changed

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

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,33 @@ When you create an Event Hubs namespace, the Kafka endpoint for the namespace is
3535

3636
### [Passwordless (Recommended)](#tab/passwordless)
3737
1. Enable a system-assigned managed identity for the virtual machine. For more information about configuring managed identity on a VM, see [Configure managed identities for Azure resources on a VM using the Azure portal](../active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm.md#system-assigned-managed-identity). 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-
2. Using the **Access control** page of the Event Hubs namespace you created, assign **Azure Event Hubs Data Owner** role to the VM's managed identity.
38+
39+
:::image type="content" source="./media/event-hubs-quickstart-kafka-enabled-event-hubs/enable-identity-vm.png" alt-text="Screenshot of the Identity tab of a virtual machine page in the Azure portal.":::
40+
1. Using the **Access control** page of the Event Hubs namespace you created, assign **Azure Event Hubs Data Owner** role to the VM's managed identity.
3941
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.
4042
1. In the Azure portal, navigate to your Event Hubs namespace. Go to "Access Control (IAM)" in the left navigation.
4143
2. Select + Add and select `Add role assignment`.
42-
3. In the Role tab, select `Azure Event Hubs Data Owner` and select the Next button.
43-
4. In the `Members` tab, select the `Managed Identity` radio button for type to assign access to.
44-
5. Select the `+Select members` link. In the Managed Identity dropdown, select Virtual Machine and select your virtual machine's managed identity.
45-
6. Select `Review + Assign`.
46-
1. Log in to the VM for which you configured the managed identity, and clone the [Azure Event Hubs for Kafka repository](https://github.com/Azure/azure-event-hubs-for-kafka).
44+
45+
:::image type="content" source="./media/event-hubs-quickstart-kafka-enabled-event-hubs/add-role-assignment-menu.png" alt-text="Screenshot of the Access Control page of an Event Hubs namespace.":::
46+
1. In the Role tab, select **Azure Event Hubs Data Owner**, and select the **Next** button.
47+
48+
:::image type="content" source="./media/event-hubs-quickstart-kafka-enabled-event-hubs/select-event-hubs-owner-role.png" alt-text="Screenshot showing the selection of the Azure Event Hubs Data Owner role.":::
49+
1. In the **Members** tab, select the **Managed Identity** in the **Assign access to** section.
50+
1. Select the **+Select members** link.
51+
1. On the **Select managed identities** page, follow these steps:
52+
1. Select the **Azure subscription** that has the VM.
53+
1. For **Managed identity**, select **Virtual machine**
54+
1. Select your virtual machine's managed identity.
55+
1. Click **Select** at the bottom of the page.
56+
57+
:::image type="content" source="./media/event-hubs-quickstart-kafka-enabled-event-hubs/add-vm-identity.png" alt-text="Screenshot showing the Add role assignment -> Select managed identities page.":::
58+
1. Select **Review + Assign**.
59+
60+
:::image type="content" source="./media/event-hubs-quickstart-kafka-enabled-event-hubs/add-vm-identity.png" alt-text="Screenshot showing the Add role assignment -> Select managed identities page.":::
61+
1. Restart the VM and log in back to the VM for which you configured the managed identity.
62+
1. Clone the [Azure Event Hubs for Kafka repository](https://github.com/Azure/azure-event-hubs-for-kafka).
4763
1. Navigate to `azure-event-hubs-for-kafka/tutorials/oauth/java/managedidentity/consumer`.
48-
6. Switch to the `src/main/resources/` folder, and open `consumer.config`. Replace `namespacename` with the name of your Event Hubs namespace.
64+
1. Switch to the `src/main/resources/` folder, and open `consumer.config`. Replace `namespacename` with the name of your Event Hubs namespace.
4965

5066
```xml
5167
bootstrap.servers=NAMESPACENAME.servicebus.windows.net:9093
@@ -57,13 +73,13 @@ Azure Event Hubs supports using Azure Active Directory (Azure AD) to authorize r
5773

5874
> [!NOTE]
5975
> You can find all the OAuth samples for Event Hubs for Kafka [here](https://github.com/Azure/azure-event-hubs-for-kafka/tree/master/tutorials/oauth).
60-
7. Run the consumer code and process events from event hub using your Kafka clients:
76+
7. Switch back to the **Consumer** folder where the pom.xml file is and, and run the consumer code and process events from event hub using your Kafka clients:
6177

6278
```java
6379
mvn clean package
6480
mvn exec:java -Dexec.mainClass="TestConsumer"
6581
```
66-
1. Navigate to `azure-event-hubs-for-kafka/tutorials/oauth/java/managedidentity/producer`.
82+
1. Launch another command prompt window, and navigate to `azure-event-hubs-for-kafka/tutorials/oauth/java/managedidentity/producer`.
6783
1. Switch to the `src/main/resources/` folder, and open `producer.config`. Replace `mynamespace` with the name of your Event Hubs namespace.
6884
4. Switch back to the **Producer** folder where the `pom.xml` file is and, run the producer code and stream events into Event Hubs:
6985

@@ -74,6 +90,8 @@ Azure Event Hubs supports using Azure Active Directory (Azure AD) to authorize r
7490

7591
You should see messages about events sent in the producer window. Now, check the consumer app window to see the messages that it receives from the event hub.
7692

93+
:::image type="content" source="./media/event-hubs-quickstart-kafka-enabled-event-hubs/producer-consumer-output.png" alt-text="Screenshot showing the Producer and Consumer app windows showing the events.":::
94+
7795
### [Connection string](#tab/connection-string)
7896

7997
1. Clone the [Azure Event Hubs for Kafka repository](https://github.com/Azure/azure-event-hubs-for-kafka).
87 KB
Loading
49.4 KB
Loading
77.8 KB
Loading
282 KB
Loading
32.6 KB
Loading
79.6 KB
Loading

0 commit comments

Comments
 (0)