Chris
Chris

Reputation: 13

The listener for Azure function was unable to start - Microsoft.Azure.EventHubs.Processor Encountered error

I am getting the below error whilst running my Python Azure Function on the local machine in VSCode.

enter image description here For clarification the message is:

The listener for function 'Functions.IoT_Data-Handler' was unable to start. Microsoft.Azure.EventHubs.Processor: Encountered error while fetching the list of EventHub PartitionIds. System.Private.CoreLib: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

This error has never occurred before in the time I have started using VSCode for Azure functions (since last September). The only thing that has changed recently is that I now deploy this function within an Azure Function premium resource, but really that should not matter in the dev environment.

For information, this function is hooked up to an Azure IoT-Hub endpoint and is simply reading and processing the uplink data before saving it to an Azure SQL database.

Can anyone offer any advice?

Upvotes: 0

Views: 511

Answers (1)

Pravallika KV
Pravallika KV

Reputation: 8694

Check if my below findings help to fix your issue:

  1. As @PeterBons said, check the connection string given correctly in the local.settings.json:

Whatever the Event Hub Endpoint/IoT Hub Endpoint Connection String given in the file local.settings.json, that property name should be mapped in the function.json file.

enter image description here

  1. Try replacing the IoT Hub Connection String without the consumer group name as mentioned in this GitHub Issue #5512

I found similar issues in the SO 1 & 2 which will be helpful to fix your issue.

Upvotes: 0

Related Questions