Skip to content

Commit a47c6ba

Browse files
Merge pull request #227736 from sreekzz/patch-140
Added the below codes
2 parents 9727ba2 + ce436d7 commit a47c6ba

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

articles/hdinsight/kafka/rest-proxy.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ description: Learn how to do Apache Kafka operations using a Kafka REST proxy on
44
ms.service: hdinsight
55
ms.topic: how-to
66
ms.custom: devx-track-python
7-
ms.date: 04/01/2022
7+
ms.date: 02/17/2023
88
---
99

1010
# Interact with Apache Kafka clusters in Azure HDInsight using a REST proxy
1111

12-
Kafka REST Proxy enables you to interact with your Kafka cluster via a REST API over HTTPS. This action means that your Kafka clients can be outside of your virtual network. Clients can make simple, secure HTTPS calls to the Kafka cluster, instead of relying on Kafka libraries. This article will show you how to create a REST proxy enabled Kafka cluster. Also provides a sample code that shows how to make calls to REST proxy.
12+
Kafka REST Proxy enables you to interact with your Kafka cluster via a REST API over HTTPS. This action means that your Kafka clients can be outside of your virtual network. Clients can make simple, secure HTTPS calls to the Kafka cluster, instead of relying on Kafka libraries. This article shows you how to create a REST proxy enabled Kafka cluster. Also provides a sample code that shows how to make calls to REST proxy.
1313

1414
## REST API reference
1515

@@ -27,21 +27,21 @@ Creating an HDInsight Kafka cluster with REST proxy creates a new public endpoin
2727

2828
### Security
2929

30-
Access to the Kafka REST proxy is managed with Azure Active Directory security groups. When creating the Kafka cluster, provide the Azure AD security group with REST endpoint access. Kafka clients that need access to the REST proxy should be registered to this group by the group owner. The group owner can register via the Portal or via PowerShell.
30+
Access to the Kafka REST proxy managed with Azure Active Directory security groups. When creating the Kafka cluster, provide the Azure AD security group with REST endpoint access. Kafka clients that need access to the REST proxy should be registered to this group by the group owner. The group owner can register via the Portal or via PowerShell.
3131

32-
For REST proxy endpoint requests, client applications should get an OAuth token. The token is used to verify security group membership. Find a [Client application sample](#client-application-sample) below that shows how to get an OAuth token. The client application passes the OAuth token in the HTTPS request to the REST proxy.
32+
For REST proxy endpoint requests, client applications should get an OAuth token. The token uses to verify security group membership. Find a [Client application sample](#client-application-sample) shows how to get an OAuth token. The client application passes the OAuth token in the HTTPS request to the REST proxy.
3333

3434
> [!NOTE]
3535
> See [Manage app and resource access using Azure Active Directory groups](../../active-directory/fundamentals/active-directory-manage-groups.md), to learn more about AAD security groups. For more information on how OAuth tokens work, see [Authorize access to Azure Active Directory web applications using the OAuth 2.0 code grant flow](../../active-directory/develop/v2-oauth2-auth-code-flow.md).
3636
3737
## Kafka REST proxy with Network Security Groups
38-
If you bring your own VNet and control network traffic with network security groups, allow **inbound** traffic on port **9400** in addition to port 443. This will ensure that Kafka REST proxy server is reachable.
38+
If you bring your own VNet and control network traffic with network security groups, allow **inbound** traffic on port **9400** in addition to port 443. This ensures that Kafka REST proxy server is reachable.
3939

4040
## Prerequisites
4141

42-
1. Register an application with Azure AD. The client applications that you write to interact with the Kafka REST proxy will use this application's ID and secret to authenticate to Azure.
42+
1. Register an application with Azure AD. The client applications that you write to interact with the Kafka REST proxy uses this application's ID and secret to authenticate to Azure.
4343

44-
1. Create an Azure AD security group. Add the application that you've registered with Azure AD to the security group as a **member** of the group. This security group will be used to control which applications are allowed to interact with the REST proxy. For more information on creating Azure AD groups, see [Create a basic group and add members using Azure Active Directory](../../active-directory/fundamentals/active-directory-groups-create-azure-portal.md).
44+
1. Create an Azure AD security group. Add the application that you've registered with Azure AD to the security group as a **member** of the group. This security group will be used to control which applications allow to interact with the REST proxy. For more information on creating Azure AD groups, see [Create a basic group and add members using Azure Active Directory](../../active-directory/fundamentals/active-directory-groups-create-azure-portal.md).
4545

4646
Validate the group is of type **Security**.
4747
:::image type="content" source="./media/rest-proxy/rest-proxy-group.png" alt-text="Security Group" border="true":::
@@ -51,7 +51,7 @@ If you bring your own VNet and control network traffic with network security gro
5151

5252
## Create a Kafka cluster with REST proxy enabled
5353

54-
The steps below use the Azure portal. For an example using Azure CLI, see [Create Apache Kafka REST proxy cluster using Azure CLI](tutorial-cli-rest-proxy.md).
54+
The steps use the Azure portal. For an example using Azure CLI, see [Create Apache Kafka REST proxy cluster using Azure CLI](tutorial-cli-rest-proxy.md).
5555

5656
1. During the Kafka cluster creation workflow, in the **Security + networking** tab, check the **Enable Kafka REST proxy** option.
5757

@@ -69,7 +69,7 @@ The steps below use the Azure portal. For an example using Azure CLI, see [Creat
6969

7070
## Client application sample
7171

72-
You can use the Python code below to interact with the REST proxy on your Kafka cluster. To use the code sample, follow these steps:
72+
You can use the Python code to interact with the REST proxy on your Kafka cluster. To use the code sample, follow these steps:
7373

7474
1. Save the sample code on a machine with Python installed.
7575
1. Install required Python dependencies by executing `pip3 install msal`.
@@ -89,7 +89,7 @@ This code does the following action:
8989
1. Fetches an OAuth token from Azure AD.
9090
1. Shows how to make a request to Kafka REST proxy.
9191

92-
For more information about getting OAuth tokens in Python, see [Python AuthenticationContext class](/python/api/adal/adal.authentication_context.authenticationcontext). You might see a delay while `topics` that aren't created or deleted through the Kafka REST proxy are reflected there. This delay is because of cache refresh. The **value** field of the Producer API has been enhanced. Now, it accepts JSON objects and any serialized form.
92+
For more information about getting OAuth tokens in Python, see [Python AuthenticationContext class](/python/api/adal/adal.authentication_context.authenticationcontext). You might see a delay while `topics` that isn't created or deleted through the Kafka REST proxy are reflected there. This delay is because of cache refresh. The **value** field of the Producer API has been enhanced. Now, it accepts JSON objects and any serialized form.
9393

9494
```python
9595
#Required Python packages
@@ -149,8 +149,8 @@ get_topic_api = 'metadata/topics'
149149
topic_api_format = 'topics/{topic_name}'
150150
producer_api_format = 'producer/topics/{topic_name}'
151151
consumer_api_format = 'consumer/topics/{topic_name}/partitions/{partition_id}/offsets/{offset}?count={count}' # by default count = 1
152-
partitions_api_format = 'topics/{topic_name}/partitions'
153-
partition_api_format = 'topics/{topic_name}/partitions/{partition_id}'
152+
partitions_api_format = 'metadata/topics/{topic_name}/partitions'
153+
partition_api_format = 'metadata/topics/{topic_name}/partitions/{partition_id}'
154154

155155
# Request header
156156
headers = {

0 commit comments

Comments
 (0)