Skip to content

Commit 7947929

Browse files
authored
Merge pull request #256451 from enkrumah/patch-53
Update kafka-output.md
2 parents b8153f3 + eb3bc21 commit 7947929

File tree

1 file changed

+74
-15
lines changed

1 file changed

+74
-15
lines changed

articles/stream-analytics/kafka-output.md

Lines changed: 74 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ author: enkrumah
55
ms.author: ebnkruma
66
ms.service: stream-analytics
77
ms.topic: conceptual
8-
ms.date: 10/23/2023
8+
ms.date: 10/27/2023
99
---
1010

1111
# Kafka output from Azure Stream Analytics (Preview)
1212

13-
Azure Stream Analytics allows you to connect directly to Kafka clusters as a producer to output data. The solution is low code and entirely managed by the Azure Stream Analytics team at Microsoft, allowing it to meet business compliance standards. The Kafka Adapters are backward compatible and support all versions with the latest client release starting from version 0.10. Users can connect to Kafka clusters inside a VNET and Kafka clusters with a public endpoint, depending on the configurations. The configuration relies on existing Kafka configuration conventions.
13+
Azure Stream Analytics allows you to connect directly to Kafka clusters as a producer to output data. The solution is low code and entirely managed by the Azure Stream Analytics team at Microsoft, allowing it to meet business compliance standards. The ASA Kafka output is backward compatible and supports all versions with the latest client release starting from version 0.10. Users can connect to Kafka clusters inside a VNET and Kafka clusters with a public endpoint, depending on the configurations. The configuration relies on existing Kafka configuration conventions.
1414
Supported compression types are None, Gzip, Snappy, LZ4, and Zstd.
1515

1616
## Configuration
1717
The following table lists the property names and their description for creating a Kafka output:
1818

1919
| Property name | Description |
2020
|------------------------------|-------------------------------------------------------------------------------------------------------------------------|
21-
| Input/Output Alias | A friendly name used in queries to reference your input or output |
21+
| Output Alias | A friendly name used in queries to reference your output |
2222
| Bootstrap server addresses | A list of host/port pairs to establish the connection to the Kafka cluster. |
2323
| Kafka topic | A unit of your Kafka cluster you want to write events to. |
2424
| Security Protocol | How you want to connect to your Kafka cluster. Azure Stream Analytics supports mTLS, SASL_SSL, SASL_PLAINTEXT or None. |
@@ -44,8 +44,8 @@ You can use four types of security protocols to connect to your Kafka clusters:
4444
4545
### Connect to Confluent Cloud using API key
4646

47-
The ASA Kafka adapter is a librdkafka-based client, and to connect to confluent cloud, you will need TLS certificates that confluent cloud uses for server auth.
48-
Confluent uses TLS certificates from Let’s Encrypt, an open certificate authority (CA)
47+
The ASA Kafka output is a librdkafka-based client, and to connect to confluent cloud, you need TLS certificates that confluent cloud uses for server auth.
48+
Confluent uses TLS certificates from Let’s Encrypt, an open certificate authority (CA) You can download the ISRG Root X1 certificate in PEM format on the site of [LetsEncrypt](https://letsencrypt.org/certificates/).
4949

5050
To authenticate using the API Key confluent offers, you must use the SASL_SSL protocol and complete the configuration as follows:
5151

@@ -54,7 +54,7 @@ To authenticate using the API Key confluent offers, you must use the SASL_SSL pr
5454
| Username | Key/ Username from API Key |
5555
| Password | Secret/ Password from API key |
5656
| KeyVault | Name of Azure Key vault with Uploaded certificate from Let’s Encrypt |
57-
| Certificate | Certificate uploaded to KeyVault downloaded from Let’s Encrypt (You can download the ISRG Root X1 Self-sign cert in PEM format) |
57+
| Certificate | Certificate uploaded to KeyVault downloaded from Let’s Encrypt (Download the ISRG Root X1 certificate in PEM format) |
5858

5959

6060
## Key vault integration
@@ -64,16 +64,73 @@ To authenticate using the API Key confluent offers, you must use the SASL_SSL pr
6464
>
6565
6666
Azure Stream Analytics integrates seamlessly with Azure Key vault to access stored secrets needed for authentication and encryption when using mTLS or SASL_SSL security protocols. Your Azure Stream Analytics job connects to your Azure Key vault using managed identity to ensure a secure connection and avoid the exfiltration of secrets.
67-
6867
Certificates are stored as secrets in the key vault and must be in PEM format.
6968

70-
The following command can upload the certificate as a secret to your key vault. You need "Administrator" access to your Key vault for this command to work properly.
69+
### Configure Key vault with permissions
70+
71+
You can create a key vault resource by following the documentation [Quickstart: Create a key vault using the Azure portal](../key-vault/general/quick-create-portal.md)
72+
To be able to upload certificates, you must have "**Key Vault Administrator**" access to your Key vault. Follow the following to grant admin access.
73+
74+
> [!NOTE]
75+
> You must have "**Owner**" permissions to grant other key vault permissions.
76+
77+
1. Select **Access control (IAM)**.
78+
79+
1. Select **Add** > **Add role assignment** to open the **Add role assignment** page.
80+
81+
1. Assign the role using the following configuration:
82+
83+
| Setting | Value |
84+
| --- | --- |
85+
| Role | Key Vault Administrator |
86+
| Assign access to | User, group, or service principal |
87+
| Members | \<Your account information or email> |
88+
89+
90+
### Upload Certificate to Key vault
91+
92+
You can use Azure CLI to upload certificates as secrets to your key vault or use the Azure portal to upload the certificate as a secret.
93+
> [!IMPORTANT]
94+
> You must have "**Key Vault Administrator**" permissions access to your Key vault for this command to work properly
95+
> You must upload the certificate as a secret.
96+
> Your Azure Stream Analytics job will fail when the certificate used for authentication expires. To resolve this, you must update/replace the certificate in your key vault and restart your Azure Stream Analytics job.
97+
98+
#### Option One - Upload certificate via Azure CLI
99+
100+
The following command can upload the certificate as a secret to your key vault.
71101

72102
```azurecli-interactive
73103
az keyvault secret set --vault-name <your key vault> --name <name of the secret> --file <file path to secret>
74104
75105
```
76106

107+
#### Option Two - Upload certificate via the Azure portal
108+
Use the following steps to upload a certificate as a secret using the Azure portal in your key vault:
109+
1. Select **Secrets**.
110+
111+
1. Select **Generate/Import** > **Add role assignment** to open the **Add role assignment** page.
112+
113+
1. Complete the following configuration for creating a secret:
114+
115+
| Setting | Value |
116+
| --- | --- |
117+
| Upload Options | Certificate |
118+
| Upload certificate | \<select the certificate to upload> |
119+
| Name | \<Name you want to give your secret> |
120+
| activation date | (optional) |
121+
| expiration date | (optional) |
122+
123+
### Configure Managed identity
124+
Azure Stream Analytics requires you to configure managed identity to access key vault.
125+
You can configure your ASA job to use managed identity by navigating to the **Managed Identity** tab on the left side under **Configure**.
126+
127+
![Configure Stream Analytics managed identity](./media/common/stream-analytics-enable-managed-identity-new.png)
128+
129+
1. Click on the **managed identity tab** under **configure**.
130+
2. Select **Switch Identity** and select the identity to use with the job: system-assigned identity or user-assigned identity.
131+
3. For user-assigned identity, select the subscription where your user-assigned identity is located and select the name of your identity.
132+
4. Review and **save**.
133+
77134
### Grant the Stream Analytics job permissions to access the certificate in the key vault
78135
For your Azure Stream Analytics job to access the certificate in your key vault and read the secret for authentication using managed identity, the service principal you created when you configured managed identity for your Azure Stream Analytics job must have special permissions to the key vault.
79136

@@ -85,22 +142,24 @@ For your Azure Stream Analytics job to access the certificate in your key vault
85142

86143
| Setting | Value |
87144
| --- | --- |
88-
| Role | Key vault secret reader |
89-
| Assign access to | User, group, or service principal |
90-
| Members | \<Name of your Stream Analytics job> |
91-
145+
| Role | Key vault secrets user |
146+
| Managed identity | Stream Analytics job for System-assigned managed identity or User-assigned managed identity |
147+
| Members | \<Name of your Stream Analytics job> or \<name of user-assigned identity> |
92148

149+
93150
### VNET integration
94-
When configuring your Azure Stream Analytics job to connect to your Kafka clusters, depending on your configuration, you might have to configure your job to access your Kafka clusters, which are behind a firewall or inside a virtual network. You can visit the Azure Stream Analytics VNET documentation to learn more about configuring private endpoints to access resources inside a virtual network or behind a firewall.
151+
152+
If your Kafka is inside a virtual network (VNET) or behind a firewall, you must configure your Azure Stream Analytics job to access your Kafka topic.
153+
Visit the [Run your Azure Stream Analytics job in an Azure Virtual Network documentation](../stream-analytics/run-job-in-virtual-network.md) for more information.
95154

96155

97156
### Limitations
98-
* When configuring your Azure Stream Analytics jobs to use VNET/SWIFT, your job must be configured with at least six (6) streaming units.
157+
* When configuring your Azure Stream Analytics jobs to use VNET/SWIFT, your job must be configured with at least six (6) streaming units or one (1) V2 streaming unit.
99158
* When using mTLS or SASL_SSL with Azure Key vault, you must convert your Java Key Store to PEM format.
100159
* The minimum version of Kafka you can configure Azure Stream Analytics to connect to is version 0.10.
101160

102161
> [!NOTE]
103-
> For direct help with using the Azure Stream Analytics Kafka adapter, please reach out to [[email protected]](mailto:[email protected]).
162+
> For direct help with using the Azure Stream Analytics Kafka output, please reach out to [[email protected]](mailto:[email protected]).
104163
>
105164
106165

0 commit comments

Comments
 (0)