IoT Hub trigger Azure Function is not getting triggered

Debashis Jena 71 Reputation points
2024-05-06T16:05:19.8166667+00:00

Hi,

We've an IoT hub & IoT hub trigger Azure function, which should be triggered whenever any data is received in IoT hub. We've used IoT hub Shared Access policy for Connecting to IoT hub from Azure Function.
We're receiving data in IoT hub from IoT edge modules, but Azure Function is not getting triggered while data is received in IoT hub.
We've checked application insights logs, but there is no exception occurred in Function app.
Please let us know how we can resolve this issue.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,137 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,205 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 33,146 Reputation points MVP
    2024-05-06T19:09:36.8+00:00

    Hello @Debashis Jena

    welcome to this moderated Azure community forum.

    Azure Functions supports ingesting Azure IoT Hub telemetry via a specific trigger.

    It uses the 'eventhub compatible endpoint' of the IoT Hub to receive messages.

    There are basically three challenges to overcome:

    1. Your azure function is corrupt or you use an old example. Check the documentation. I think you fixed this already.
    2. You reuse the '$default' consumer group too many times. Consumer groups are used to 'duplicate' incoming messages to every consumer of the endpoint (eg. Azure Stream Analytics, Azure Data Explorer, Azure Functions). It's better to give every consumer its own consumer group
    3. The 'eventhub compatible endpoint' is not sending message anymore because extra custom routes were added to the iot hub so it was transformed into a fallback route

    The third challenge is most likely:

    User's image

    The resolution is simple for this one challenge.

    Add an extra 'events' endpoint and every message flow through the endpoint again.


    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.


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.