提取EventHub PartitionIds列表时遇到错误。 Microsoft.Azure.Amqp

时间:2019-01-17 03:55:06

标签: c# azure azure-functions firewall

运行Function应用程序时出现错误消息。

  • 版本:V2功能应用程序
  • 从Visual Studio 2017运行
  

[1/17/2019 3:29:11 AM]函数'device-message-funcapp'的侦听器无法启动。   [1/17/2019 3:29:11 AM]函数“ device-message-funcapp”的侦听器无法启动。 Microsoft.Azure.EventHubs.Processor:提取EventHub PartitionId列表时遇到错误。 Microsoft.Azure.Amqp:远程主机强行关闭了现有连接。   [1/17/2019 3:29:14 AM] i

获得的主机锁租赁

这是我的方法

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)}");
    }
}

这是我的连接字符串

{
"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=***;"}}

我什至尝试启用端口[5672、9350、9354、5671],但是没有运气。

我如何知道用于连接到事件中心的协议以及如何解决它。在家庭网络中效果很好

In Azure Eventhub reciever giving "Encountered error while fetching the list of EventHub PartitionIds" error重复

3 个答案:

答案 0 :(得分:3)

如果有人登陆并出现以下错误:

Microsoft.Azure.EventHubs.Processor:访存时遇到错误 EventHub PartitionIds列表。 Microsoft.Azure.EventHubs.Processor:找不到方法: 'Microsoft.Azure.EventHubs.EventHubClient Microsoft.Azure.EventHubs.EventHubClient.Create(System.Uri, System.String,Microsoft.Azure.EventHubs.ITokenProvider, System.Nullable`1 , Microsoft.Azure.EventHubs.TransportType)'

确保已安装最新版本的 Microsoft.Azure.EventHubs.Processor

答案 1 :(得分:0)

确保messages/events实际上是事件中心队列实例的名称。

答案 2 :(得分:0)

删除对Package Microsoft.Azure.Eventhubs的引用即可解决此问题。