Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 函数无法启动。Microsoft.Azure.DocumentDB.Core:必须为此操作提供PartitionKey值。?_Node.js_Typescript_Azure_Azure Functions_Azure Cosmosdb - Fatal编程技术网

Node.js 函数无法启动。Microsoft.Azure.DocumentDB.Core:必须为此操作提供PartitionKey值。?

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

我有一个简单的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:主机已安装 初始化


我确实尝试过在ebindings中添加一个partitionKey字段,但没有效果。

似乎与此相关。尝试使用
单分区租约集合
,也提到了

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


此错误表示您有一个未按
/id
分区的已分区租约集合,或者您正在使用旧的扩展版本。

我查看了这些链接,仍然不确定该怎么办?如何尝试使用单分区租约集合?