I am already using an IoT Hub and have configured message routing to route TwinChangeEvents
to an Event Hub. An Azure function with an EventHubTrigger
processes the messages. This works perfectly fine.
Now, I wanted to configure message routing to route DeviceLifecycleEvents
to another Event Hub. Again, another Azure function with an EventHubTrigger
should process the messages.
However, the function is not triggered when I connect or disconnect devices.
When I change the data source of the message routing to TwinChangeEvents
, the function is triggered as expected (with the wrong messages of course). That said, I am pretty confident that my configuration of the Event Hub and the Function is correct.
Also, I have tried to configure an Event Subscription in the IoT Hub with for the lifecycle events to the Event Hub. I think this option uses an Event Grid. Anyways, the function gets triggered as expected with this configuration. The problem only occurs when using message routing for the lifecycle events.
Can anyone point me towards a solution why the message routing does not work? Am I missing a configuration in the IoT Hub?