I have an event hub that has a load of events in it. I also have an Azure function written in C#, but it's not receiving any events. This is what the setup looks like:
Function:
private const string EventHubName = "eventhub";
private const string ConnectionStringName = "Settings:EventHubConsumerConnectionstring";
[FunctionName("InformationHandler")]
public async Task RunAsync(
[EventHubTrigger(EventHubName, Connection = ConnectionStringName)] EventData[] eventData,
ILogger log)
Host.json:
{
"version": "2.0",
"aggregator": {
"batchSize": 1000,
"flushTimeout": "00:01:00"
},
"logging": {
"applicationInsights": {
"samplingExcludedTypes": "Request",
"samplingSettings": {
"isEnabled": true
}
}
},
"extensions": {
"eventHubs": {
"batchCheckpointFrequency": 1,
"eventProcessorOptions": {
"maxBatchSize": 64,
"prefetchCount": 128
}
}
}
}
Output when running:
Functions:
InformationHandler: eventHubTrigger
For detailed output, run func with --verbose flag.
[2021-02-25T21:48:01.621Z] Host lock lease acquired by instance ID '000000000000000000000000DC59BDB5'.
I'm using netcoreapp3.1 with Azure Functions 3. I have the following NuGet packages installed:
Does anyone know why I'm not receiving any events? The connection string is correct and it can find the settings in my settings file.

--verbose? Hope event hub is not paused? Though that might give you explicit errors. Last thing I recommend is to deploy to cloud and see logs in Portal A) YourApp->Functions->YourFunction->Monitor if it's invokved B) Goto Logs tab and set level to verbose and wait, I've seen "polling logs" there which I've not seen anywhere else. Finally though you saidThe connection string is correct and it can find the settings in my settings file., would be good if you post the settings. NOTE: SetsamplingSettings.isEnabledto false while you're developing. HTH. - Kashyapevent hub namespace levelconnection string, and you can also create a newconsumer groupand use the newconsumer groupin your azure function. - Ivan Yangfunc start --build) it suddenly works. I expect it's a rider issue. - Leon Cullens