How to set the Event Hub partition key per-event using "Send Multiple Events" action?

Veli-Jussi Raitila 446 Reputation points
2024-01-18T11:57:35.2733333+00:00

I am using Logic Apps Standard. Iterating and sending individual events using the Azure Event Hubs "Send Event" action does not give me acceptable performance.

Switching to "Send Multiple Events" (InApp) action in a stateless workflow is better, but for some inexplicable reason I can only specify a single partition key value for the whole batch.

I have prepped the events into an array using the Select action. And I can then provide the entire array to "Send Multiple Events". But how can I specify the partition keys for those events? The objects in the array include the required properties.

EDIT: In fact, the partitionKey property seems to be ignored altogether.

{
  "type": "ServiceProvider",
  "inputs": {
    "parameters": {
      "eventHubName": "logexample",
      "eventDatas": "@body('Select_Events')",
      "partitionKey": "hardcoded"
    },
    "serviceProviderConfiguration": {
      "connectionName": "eventHub",
      "operationId": "sendEvents",
      "serviceProviderId": "/serviceProviders/eventHub"
    }
  }
}

In the example above the Select_Event body holds an array of events mapped to the ContentData property. Also, I've hard-coded the partition key value to make sure that they all end up in the same partition - even on subsequent invocations. However, this does not happen. What am I getting wrong?

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.