Azure Function stops triggering when using IoT Hub trigger

Alexandru Gavrila 0 Reputation points
2024-01-11T12:06:20.37+00:00

I have a Typescript function app that takes input from an IoT Hub, it only has one line of code that logs a fixed string. After some time (10-30 minutes) it stops triggering.

I will attach a log file around the time it stoped working. logs.txt EDIT: Adding a 1 minute timer trigger seems to solve everything, but this seems like a hack and should not be needed

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,306 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,127 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde 28,871 Reputation points MVP
    2024-01-11T18:27:34.1266667+00:00

    Hello @Alexandru Gavrila, welcome to this moderated Azure community forum. I tried to figure out what is happening but the logfile is quite large... Which protocol are you using?

    ...that takes input from an IoT Hub

    You mean you are listening to incoming messages from the IoT Hub using the 'eventhub compatible endpoint'? If so, you you use a custom consumergroup, created in the IoT Hub portal: User's image

    Each consumer should use its own consumer group so each cosnumer gets its own copy. Otherwise, the stream becomes unstable. The effect you see looks like this issue... Otherwise, are you using some SDK to connect to the IoT Hub (eventhub compatible endpoint)? Which?

    ---If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.