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

问题描述 投票:0回答:4

我在运行 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] 但没有运气。

我如何知道使用哪个协议连接到事件中心以及如何修复它。在家庭网络中运行良好

不是重复在Azure Eventhub接收器中给出“获取EventHub PartitionIds列表时遇到错误”错误

c# azure azure-functions firewall
4个回答
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、 系统.Nullable`1, Microsoft.Azure.EventHubs.TransportType)'

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


0
投票

确保

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


0
投票

删除对包 Microsoft.Azure.Eventhubs 的引用解决了该问题。


0
投票

就我而言,事件中心的名称不正确。插入正确的名称后,我就解决了这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.