I am getting below error while running Function app.
- Version: V2 Function App
- Running from Visual Studio 2017
[1/17/2019 3:29:11 AM] The listener for function 'device-message-funcapp' was unable to start. [1/17/2019 3:29:11 AM] The listener for function 'device-message-funcapp' was unable to start. Microsoft.Azure.EventHubs.Processor: Encountered error while fetching the list of EventHub PartitionIds. Microsoft.Azure.Amqp: An existing connection was forcibly closed by the remote host. [1/17/2019 3:29:14 AM] Host lock lease acquired by i
This is my method
public static class DeviceMessageFunction
{
[FunctionName("device-message-funcapp")]
public static void Run([IoTHubTrigger("messages/events", Connection = "EventHub")]EventData message, ILogger log)
{
log.LogInformation($"C# IoT Hub trigger function processed a message: {Encoding.UTF8.GetString(message.Body.Array)}");
}
}
Here is my connection string
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=lctestfunctionsa;AccountKey=********;BlobEndpoint=https://**********.blob.core.windows.net/;TableEndpoint=https://********.table.core.windows.net/;QueueEndpoint=https://***.queue.core.windows.net/;FileEndpoint=https://***.file.core.windows.net/",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"EventHub": "Endpoint=sb://iothub-******.servicebus.windows.net/;SharedAccessKeyName=iothubowner;SharedAccessKey=***;"}}
I have even tried enable the ports [5672, 9350, 9354, 5671] But no luck.
How do I know which protocol used to connect to event hub and how do I fix it. It works fine in home network
It is not duplicate of In Azure Eventhub reciever giving "Encountered error while fetching the list of EventHub PartitionIds" error