0

I am asking myself whether it is a good idea to have an Azure Function consuming events directly from the EventHub compatible IoT Hub endpoint.

According to this answer Azure Functions use EventHubProcessorHost to consume the events. It also indicates that if a Function seems sluggish the scaling logic kicks in and creates more instances of a Function (e.g. per IoT Hub partition).

What is the trigger for the scaling logic? Number of unprocessed messages? Processing duration of a single message (would not be a good metric)?

Thanks

Helikaon
  • 1,490
  • 13
  • 30

1 Answers1

3

The scaling logic looks at the total number of unprocessed messages remaining in all the partitions of the EventHub.

Ling Toh
  • 2,404
  • 1
  • 16
  • 24
  • 2
    Please note that this is only the case if using the Consumption Plan, if using the App Service Plan, you are responsible for scaling: You select the metric to scale on and you determine the threshold that triggers scaling. – Andy T Jul 12 '17 at 22:25
  • Thanks for your answers guys. So this means that Azure Functions with a consumption plan behind an IoT Hub is a valid approach, isn't it? – Helikaon Jul 13 '17 at 05:14
  • Yes, for IoTHub scenarios, configuring your Function to use a compatible EventHub endpoint is a valid approach. – Ling Toh Jul 13 '17 at 05:43
  • Yes, using an AF within the real-time stream pipeline (hot path) is a valid approach, but it is necessary to consider and handle the cold-start time latency of the AF. – Roman Kiss Jul 13 '17 at 07:34