CLOUD
Note
If you are installing the connector locally for Confluent Platform, see Azure Functions Sink Connector for Confluent Platform.
The Kafka Connect Azure Functions Sink Connector for Confluent Cloud integrates Apache Kafka® with Azure Functions. For more information about creating an Azure function, see Create your first function.
The connector consumes records from Kafka topic(s) and executes an Azure Function. Each request sent to Azure Functions can contain up to the max.batch.size number of records.
max.batch.size
Important
If you are still on Confluent Cloud Enterprise, please contact your Confluent Account Executive for more information about using this connector.
The Azure Functions sink connector provides the following features:
success-<connector-id>
error-<connector-id>
"name": "Kimberley Human"
name=Kimberley Human
You can manage your full-service connector using the Confluent Cloud API. For details, see the Confluent Cloud API documentation.
Refer to Cloud connector limitations for additional information.
Use this quick start to get up and running with the Confluent Cloud Azure Functions sink connector. The quick start provides the basics of selecting the connector and configuring it to stream events to a target Azure Function.
See the Quick Start for Apache Kafka using Confluent Cloud for installation instructions.
Click Connectors. If you already have connectors in your cluster, click Add connector.
Click the Azure Functions Sink connector icon.
Complete the following and click Continue.
Select one or more topics.
Enter a connector Name or choose the default name.
Select an Input message format (data coming from the Kafka topic): AVRO, JSON_SR (JSON Schema), PROTOBUF, or JSON (schemaless). A valid schema must be available in Schema Registry to use a schema-based message format.
If no schema is defined, values are encoded as plain strings. For example, "name": "Kimberley Human" is encoded as name=Kimberley Human.
Enter your Kafka Cluster credentials. The credentials are either the API key and secret or the service account API key and secret.
Enter your Function URL. For example: https://myfunctionapp-devtest.azurewebsites.net/api/HttpTrigger1?code=zbdeiflowie.
https://myfunctionapp-devtest.azurewebsites.net/api/HttpTrigger1?code=zbdeiflowie
Enter the Function Details.
Max Batch Size: The maximum number of records to combine when invoking a single Azure function. Defaults to 1 (batching disabled). Accepts values from 1 to 1000.
1
1000
Max Pending Requests: The maximum number of pending requests that can be made to Azure functions concurrently.
Request Timeout:
Retry Timeout: The total amount of time, in milliseconds (ms), that the connector will exponentially backoff and retry failed requests (i.e., throttling). Response codes that are retried are HTTP 429 Too Busy and HTTP 502 Bad Gateway. Enter -1 to configure this property for indefinite retries. Defaults to 300000 ms (5 minutes).
HTTP 429 Too Busy
HTTP 502 Bad Gateway
-1
300000
Enter the number of tasks to use with the connector.
Configuration properties that use default values do not display in the Confluent Cloud UI. For configuration properties and their default values, see Azure Functions Sink Connector Configuration Properties. definitions.
Verify the connection details and click Launch.
The status for the connector should go from Provisioning to Running.
Verify that records are being produced.
Tip
When you launch a connector, a Dead Letter Queue topic is automatically created. See Dead Letter Queue for details.
For additional information about this connector see Azure Functions Sink Connector for Confluent Platform. Note that not all Confluent Platform connector features are provided in the Confluent Cloud connector.
See also
For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud ksqlDB, see the Cloud ETL Demo. This example also shows how to use Confluent Cloud CLI to manage your resources in Confluent Cloud.
Complete the following steps to set up and run the connector using the Confluent Cloud CLI.
Make sure you have all your prerequisites completed.
Enter the following command to list available connectors:
ccloud connector-catalog list
Enter the following command to show the required connector properties:
ccloud connector-catalog describe <connector-catalog-name>
For example:
ccloud connector-catalog describe AzureFunctionSink
Example output:
Following are the required configs: connector.class name kafka.api.key kafka.api.secret function.url topics tasks.max
Configuration properties that are not listed use the default values. See Azure Functions Sink Connector Configuration Properties for default values and property definitions.
Create a JSON file that contains the connector configuration properties. The following example shows the required connector properties.
{ "topics":"pageviews", "input.data.format": "AVRO", "connector.class": "AzureFunctionsSink", "name": "AzureFunctionsSinkConnector_0", "kafka.api.key": "****************", "kafka.api.secret": "****************************************************************", "function.url": "https://myfunctionapp-dev.azurewebsites.net/api/HttpTrigger1?code=zjiekiuqowie", "tasks.max": "1" }
Note the following property definitions:
"topics"
"input.data.format"
"connector.class"
"name"
"function.url"
Optional:
"max.batch.size"
"max.pending.requests"
"request.timeout"
"retry.timeout"
Enter the following command to load the configuration and start the connector:
ccloud connector create --config <file-name>.json
ccloud connector create --config azure-functions-sink-config.json
Created connector AzureFunctionsSinkConnector_0 lcc-ix4dl
Enter the following command to check the connector status:
ccloud connector list
ID | Name | Status | Type +-----------+-------------------------------+---------+------+ lcc-ix4dl | AzureFunctionsSinkConnector_0 | RUNNING | sink