Hello @Samy ,
You try to ingest telemetry from an IoT Hub into an Azure Function using the Azure IoT Hub trigger.
There are a number of things that could be in your way.
First, it is recommended to use a separate consumer group for each (single) Azure resource that is consuming messages from the IoT Hub event-hub-compatible endpoint.
Here, I created one function using the newly created 'fa' consumer group:
[FunctionName("SendIngestedIoTHubMessagesToAdtEnvironment")]
public static async Task Run(
[IoTHubTrigger("messages/events", ConsumerGroup = "fa", Connection = "IoTHubEventHubString")] EventData message,
ILogger log)
Note: I personally try to avoid using the $default consumer group. standard tooling like VS Code, the IoT explorer, Azure Stream Analytics, and Azure Data Explorer all start with that $default so if not changed, a 'collision' can occur:
Next to that, create a separate route for the default eventhub-compatible-endpoint once you start adding other routes:
Why?
That endpoint will change its purpose once you add one other endpoint. It will turn into an fallback solution:
Create an endpoint, and then add a route (you can add up to 100 routes from each IoT hub). Since routing is based on a matching query, a message can be sent to multiple endpoints. Messages that don’t match a query are automatically sent to messages/events if you’ve enabled the fallback route. When you create new endpoints and routes, messages stop flowing to the built-in endpoint unless you create a separate route and direct them there. If no routes to the built-in endpoint exist, enabling a fallback route will direct any messages that don't match a route query to that endpoint. Learn more
----------
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.