繁体   English   中英

功能无法启动。 Microsoft.Azure.DocumentDB.Core:必须为此操作提供 PartitionKey 值。?

[英]Function was unable to start. Microsoft.Azure.DocumentDB.Core: PartitionKey value must be supplied for this operation.?

我有一个简单的 azure 函数 Cosmos 触发器设置,如下所示:

{
  "bindings": [
    {
      "type": "cosmosDBTrigger",
      "name": "documents",
      "direction": "in",
      "leaseCollectionName": "leases",
      "connectionStringSetting": "DbConnectionString",
      "databaseName": "mydb",
      "collectionName": "mycollection",
      "createLeaseCollectionIfNotExists": "true"
    }
  ],
  "scriptFile": "../dist/TestCosmosTrigger/index.js"
}

当我运行该函数时,出现错误:

函数“Functions.FeedNotifier”的侦听器无法启动。 Microsoft.Azure.Documents.ChangeFeedProcessor:主机已初始化。

我确实尝试将 partitionKey 字段添加到 ebindings 无济于事。

似乎与这个 问题有关 尝试使用single-partition lease collection这里也提到

请更新到最新的Microsoft.Azure.WebJobs.Extensions.CosmosDB依赖

此错误要么意味着您有一个未按/id分区的分区租约集合,要么您使用的是旧的扩展版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM