I have iot hub in azure and azure function, which is triggered when a message from a device is sent. The function looks like this:
[FunctionName("Ingest")]
public async Task Run(
[IoTHubTrigger("IoTHubName", Connection = "IoTHubConnectionString"
#if DEBUG
, ConsumerGroup = "localdev"
#else
, ConsumerGroup = "release"
#endif
)] EventData[] messages)
{
...
}
IoTHubName
and IoTHubConnectionString
I'm getting from local.settings.json
when developing locally and from env variables in azure (Configuration tab in the portal) in the release. Almost all the time it's working fine.
But sometimes function is not triggered. I eliminated, that it's somehow connected with the consumer group. Because when I change "release" to something new, the function starts to get triggered again. So, my main question: what can be an issue? How can I find if some other function listens to the same consumer group(which is likely not possible, but who knows...)? Or maybe how can I remove all consumers? In fact how to understand why my function sometimes is not triggered?