[英]CosmosDBTrigger: Object reference not set to an instance of an object
當我嘗試用CosmosDBTrigger執行新創建的azure函數時,我得到了cosmosdb觸發器函數的上述異常
調查信息
環境: Visual Studio 2017 15.3.5
引用的包:
重現問題的步驟
提供重現問題所需的步驟:
這是代碼示例
public static class AddEventInEventStore
{
[FunctionName("AddEventInEventStore")]
public static void Run([CosmosDBTrigger("db", "Items",
ConnectionStringSetting = "AzureWebJobsDocumentDBConnectionString",
LeaseCollectionName = "leases", LeaseDatabaseName = "db"
)]
IReadOnlyList<Document> changeList, TraceWriter log)
{
if (changeList != null && changeList.Count > 0)
{
log.Verbose("Documents modified " + changeList.Count);
foreach (var change in changeList)
{
log.Verbose("First document Id " + change.Id);
}
}
}
}
更新Azure功能和Web作業工具(工具 - >擴展和更新)。
我可以看到你在1.0.0
版本(控制台標題),而1.0.4
已經可用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.