Your Routes setup is correct. I am guessing the problem is on the consumer side of the Azure IoT Hub events (default endpoint). You can use for test purpose a Device Explorer tool. The following screen snippet shows my example:
other quick option to consume these events is creating a azure function
using System;
public static void Run(string myIoTHubMessage, TraceWriter log)
{
log.Info($"C# IoT Hub trigger function processed a message: {myIoTHubMessage}");
}
function.json file:
{
"bindings": [
{
"type": "eventHubTrigger",
"name": "myIoTHubMessage",
"direction": "in",
"path": "myPath",
"connection": "myevents_IOTHUB",
"consumerGroup": "$Default",
"cardinality": "many"
}
],
"disabled": true
}
- One more thing, you can press the button Run for testing a match. It should be shown Result:Match
module.exports = function (context, IoTHubMessages) { context.log(
JavaScript eventhub trigger function called for message array ${IoTHubMessages}); IoTHubMessages.forEach(message => { context.log(
Processed message ${JSON.stringify(message)}); }); context.done(); };
– Akshat Desai