问题 运行 事件中心在本地触发 azure 函数,启动时出现 "Out of retries creating lease for partition" 错误

Issues running event hub triggered azure function locally, getting "Out of retries creating lease for partition" error on startup

目前我已经设置了以下简单的 azure azure 函数,几天前我测试过它并且工作正常但由于某些未知原因它 returns 一个错误

函数设置为:

    [FunctionName("EventUpdatedHubFunction")]
    public async Task Run([EventHubTrigger(
            "%EventConsumer:Name%",
            ConsumerGroup = "%EventConsumer:ConsumerGroup%",
            Connection = "EventConsumer:ConnectionString")]
        EventData[] events)
    {
        // logic
    }

我在 运行 调用该函数时遇到的错误是:

[2022-03-04T12:25:32.671Z] The listener for function 'EventUpdatedHubFunction' was unable to start.
[2022-03-04T12:27:09.897Z] The listener for function 'EventUpdatedHubFunction' was unable to start. Microsoft.Azure.EventHubs.Processor: Out of retries creating lease for partition 0. Microsoft.WindowsAzure.Storage: The response ended prematurely, with at least 157 additional bytes expected. System.Net.Http: The response ended prematurely, with at least 157 additional bytes expected.

这是我的配置文件(我没有理由相信它是不正确的,因为它在过去有效):

{
    "IsEncrypted": false,
        "Values": {
        "AzureWebJobsStorage": "UseDevelopmentStorage=true",
        "AzureWebJobsDashboard": "UseDevelopmentStorage=true",
        "FUNCTIONS_WORKER_RUNTIME": "dotnet",
        "EventConsumer:Name": "event_consumer_name_test",
        "EventConsumer:ConsumerGroup": "consumer_group_test",
        "EventConsumer:ConnectionString": "Endpoint=.........",
        "Database:ConnectionString": "Server=.;Database=TestDatabase;Trusted_Connection=True;"
    }
}

到目前为止我已经尝试过:

所以在这一点上我不知道是什么导致了这个问题。

解决方案是:通过Azure Storage Explorer,在Local & Attached下找到(Emulator - Default Ports)/Blob Containers/azure-webjobs-eventhub容器并删除其中的所有内容以释放space。