Node.js 函数无法启动。Microsoft.Azure.DocumentDB.Core:必须为此操作提供PartitionKey值。?
我有一个简单的azure函数cosmos触发器设置,如下所示:Node.js 函数无法启动。Microsoft.Azure.DocumentDB.Core:必须为此操作提供PartitionKey值。?,node.js,typescript,azure,azure-functions,azure-cosmosdb,Node.js,Typescript,Azure,Azure Functions,Azure Cosmosdb,我有一个简单的azure函数cosmos触发器设置,如下所示: { "bindings": [ { "type": "cosmosDBTrigger", "name": "documents", "direction": "in", "leaseCollectionName": "leases", "connectionStringSetting": "DbConnectionString", "database
{
"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:主机已安装
初始化
我确实尝试过在ebindings中添加一个partitionKey字段,但没有效果。似乎与此相关。尝试使用
单分区租约集合
,也提到了请更新到最新的Microsoft.Azure.WebJobs.Extensions.CosmosDB
依赖项
此错误表示您有一个未按
/id
分区的已分区租约集合,或者您正在使用旧的扩展版本。我查看了这些链接,仍然不确定该怎么办?如何尝试使用单分区租约集合?