我在不同的线程上发现了这个错误,但我还没有看到解决方案。我在 Windows 11 上使用 Azure Cosmos DB 模拟器。并且我使用 Azure 函数作为触发器。碰巧当我更改了数据库名称参数时,我在启动函数时收到此错误:
2023-12-26T17:16:04.200Z] Starting the listener for prefix='', monitoredContainer='business_docs_02', monitoredDatabase='cosmicworks_02', leaseContainer='leases_docs', leaseDatabase='cosmicworks_02', functionId='Host.Functions.MyCoFunc2' failed. Exception: System.InvalidOperationException: This builder instance has already been used to build a processor. Create a new instance to build another.
[2023-12-26T17:16:04.205Z] at Microsoft.Azure.Cosmos.ChangeFeedProcessorBuilder.Build()
[2023-12-26T17:16:04.211Z] at Microsoft.Azure.WebJobs.Extensions.CosmosDB.CosmosDBTriggerListener`1.StartProcessorAsync() in D:\a\_work\1\s\src\WebJobs.Extensions.CosmosDB\Trigger\CosmosDBTriggerListener.cs:line 140
[2023-12-26T17:16:04.214Z] at Microsoft.Azure.WebJobs.Extensions.CosmosDB.CosmosDBTriggerListener`1.StartAsync(CancellationToken cancellationToken) in D:\a\_work\1\s\src\WebJobs.Extensions.CosmosDB\Trigger\CosmosDBTriggerListener.cs:line 96.
[2023-12-26T17:16:04.216Z] The listener for function 'Functions.MyCoFunc2' was unable to start.
[2023-12-26T17:16:04.217Z] The listener for function 'Functions.MyCoFunc2' was unable to start. Microsoft.Azure.Cosmos.Client: This builder instance has already been used to build a processor. Create a new instance to build another.