You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/stream-analytics/kafka-output.md
+74-15Lines changed: 74 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,20 @@ author: enkrumah
5
5
ms.author: ebnkruma
6
6
ms.service: stream-analytics
7
7
ms.topic: conceptual
8
-
ms.date: 10/23/2023
8
+
ms.date: 10/27/2023
9
9
---
10
10
11
11
# Kafka output from Azure Stream Analytics (Preview)
12
12
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.
14
14
Supported compression types are None, Gzip, Snappy, LZ4, and Zstd.
15
15
16
16
## Configuration
17
17
The following table lists the property names and their description for creating a Kafka output:
|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 |
22
22
| Bootstrap server addresses | A list of host/port pairs to establish the connection to the Kafka cluster. |
23
23
| Kafka topic | A unit of your Kafka cluster you want to write events to. |
24
24
| 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:
44
44
45
45
### Connect to Confluent Cloud using API key
46
46
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/).
49
49
50
50
To authenticate using the API Key confluent offers, you must use the SASL_SSL protocol and complete the configuration as follows:
51
51
@@ -54,7 +54,7 @@ To authenticate using the API Key confluent offers, you must use the SASL_SSL pr
54
54
| Username | Key/ Username from API Key |
55
55
| Password | Secret/ Password from API key |
56
56
| 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) |
58
58
59
59
60
60
## Key vault integration
@@ -64,16 +64,73 @@ To authenticate using the API Key confluent offers, you must use the SASL_SSL pr
64
64
>
65
65
66
66
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
-
68
67
Certificates are stored as secrets in the key vault and must be in PEM format.
69
68
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.
71
101
72
102
```azurecli-interactive
73
103
az keyvault secret set --vault-name <your key vault> --name <name of the secret> --file <file path to secret>
74
104
75
105
```
76
106
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**.
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
+
77
134
### Grant the Stream Analytics job permissions to access the certificate in the key vault
78
135
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.
79
136
@@ -85,22 +142,24 @@ For your Azure Stream Analytics job to access the certificate in your key vault
85
142
86
143
| Setting | Value |
87
144
| --- | --- |
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> |
92
148
149
+
93
150
### 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.
95
154
96
155
97
156
### 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.
99
158
* When using mTLS or SASL_SSL with Azure Key vault, you must convert your Java Key Store to PEM format.
100
159
* The minimum version of Kafka you can configure Azure Stream Analytics to connect to is version 0.10.
101
160
102
161
> [!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]).
0 commit comments