获取 EventHub PartitionId 列表时遇到错误。微软.Azure.Amqp

kud*_*ger 6 c# firewall azure azure-functions

运行函数应用程序时出现以下错误。

  • 版本: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)}");
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的连接字符串

{
"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=***;"}}
Run Code Online (Sandbox Code Playgroud)

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

我如何知道用于连接到事件中心的协议以及如何修复它。它在家庭网络中工作正常

这是重复的“而取EventHub PartitionIds名单遇到错误” reciever给在Azure中Eventhub错误

Moh*_*diq 6

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

Microsoft.Azure.EventHubs.Processor:获取 EventHub PartitionId 列表时遇到错误。Microsoft.Azure.EventHubs.Processor:找不到方法:'Microsoft.Azure.EventHubs.EventHubClient Microsoft.Azure.EventHubs.EventHubClient.Create(System.Uri,System.String,Microsoft.Azure.EventHubs.ITokenProvider,System.Nullable` 1<System.TimeSpan>,Microsoft.Azure.EventHubs.TransportType)'

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


小智 0

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