IoT Hub trigger Azure Function is not getting triggered

Debashis Jena 71 Reputation points


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.
4,375 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,136 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde 29,691 Reputation points MVP

    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.