docs/daprdocs/content/en/operations/components/setup-bindings/supported-bindings/eventhubs.md

2.5 KiB

type title linkTitle description
docs Azure Event Hubs binding spec Azure Event Hubs Detailed documentation on the Azure Event Hubs binding component

See this for instructions on how to set up an Event Hub.

Setup Dapr component

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: <NAME>
  namespace: <NAMESPACE>
spec:
  type: bindings.azure.eventhubs
  version: v1
  metadata:
  - name: connectionString      # Azure EventHubs connection string
    value: "Endpoint=sb://****"
  - name: consumerGroup         # EventHubs consumer group
    value: "group1"
  - name: storageAccountName    # Azure Storage Account Name
    value: "accountName"   
  - name: storageAccountKey     # Azure Storage Account Key
    value: "accountKey"                
  - name: storageContainerName  # Azure Storage Container Name
    value: "containerName"    
  - name: partitionID           # (Optional) PartitionID to send and receive events
    value: 0
  • connectionString is the EventHubs connection string. Note that this is the EventHub itself and not the EventHubs namespace. Make sure to use the child EventHub shared access policy connection string.
  • consumerGroup is the name of an EventHubs Consumer Group to listen on.
  • storageAccountName Is the name of the account of the Azure Storage account to persist checkpoints data on.
  • storageAccountKey Is the account key for the Azure Storage account to persist checkpoints data on.
  • storageContainerName Is the name of the container in the Azure Storage account to persist checkpoints data on.
  • partitionID (Optional) ID of the partition to send and receive events.

{{% alert title="Warning" color="warning" %}} The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here]({{< ref component-secrets.md >}}). {{% /alert %}}

Output Binding Supported Operations

  • create
  • [Bindings building block]({{< ref bindings >}})
  • [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
  • [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
  • [Bindings API reference]({{< ref bindings_api.md >}})