Please help!!!
I have created a function to save the messages from the IoT Hub in a cosmosDB but I run in that error:
2020-08-04T02:15:41.884 [Error] The listener for function 'Functions.IoTHub_EventHub1' was unable to start.Microsoft.Azure.WebJobs.Host.Listeners.FunctionListenerException : The listener for function 'Functions.IoTHub_EventHub1' was unable to start. ---> Microsoft.Azure.EventHubs.Processor.EventProcessorConfigurationException : Encountered error while fetching the list of EventHub PartitionIds ---> Microsoft.Azure.EventHubs.EventHubsException : InvalidSignature: The token has an invalid signature.at async Microsoft.Azure.EventHubs.Amqp.Management.AmqpServiceClient.GetRuntimeInformationAsync()at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.EventHubs.Amqp.AmqpEventHubClient.OnGetRuntimeInformationAsync()at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.EventHubs.EventHubClient.GetRuntimeInformationAsync()at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.EventHubs.Processor.PartitionManager.GetPartitionIdsAsync()End of inner exceptionat async Microsoft.Azure.EventHubs.Processor.PartitionManager.GetPartitionIdsAsync()at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.EventHubs.Processor.PartitionManager.GetPartitionIdsAsync()at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.EventHubs.Processor.PartitionManager.InitializeStoresAsync()at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.EventHubs.Processor.PartitionManager.StartAsync()at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.EventHubs.Processor.EventProcessorHost.RegisterEventProcessorFactoryAsync(??)at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.WebJobs.EventHubs.EventHubListener.StartAsync(CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.EventHubs\Listeners\EventHubListener.cs : 46at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.WebJobs.Host.Listeners.FunctionListener.StartAsync(??) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\FunctionListener.cs : 68End of inner exception
This is the function.json:
{
"bindings": [
{
"name": "IoTHubMessages",
"connection": "airguard-iothub_events_IOTHUB2",
"eventHubName": "airguard-iothub",
"consumerGroup": "$Default",
"cardinality": "many",
"direction": "in",
"type": "eventHubTrigger"
},
{
"name": "outputDocument",
"direction": "out",
"type": "cosmosDB",
"databaseName": "outDatabase",
"collectionName": "MyCollection",
"createIfNotExists": true,
"connectionStringSetting": "enosecosmos_DOCUMENTDB"
}
]
}
and the host.json:
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
}
}