簡體   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