0
votes

I am sending 2000 ingress events as a batch to an event hub. And I am looking to consume egress by azure functions[evnt hub triggered functions].

Is there any possibility to send event hub events as a batch in azure event hub triggered functions?

Or it will run every event for the event hub?

The no. of executions get cost, so only am looking fewer executions.

Thanks in advance!

1

1 Answers

0
votes

Yes, Azure Functions support batches with Event Hub trigger. Docs have this example:

[FunctionName("EventHubTriggerCSharp")]
public static void Run(
    [EventHubTrigger("samples-workitems", Connection = "EventHubConnectionAppSetting")] 
    string[] eventHubMessages, 
    TraceWriter log)
{
    foreach (var message in eventHubMessages)
    {
        log.Info($"C# Event Hub trigger function processed a message: {message}");
    }
}

You could use EventData[] instead of string[] too.