Visual Studio 2017 中的 Azure 函数 CosmosDB 属性

Azure functions CosmosDB attribute in Visual Studio 2017

我正在尝试使用 Azure Functions 和 CosmosDB 输入绑定进行工作试点项目。 我已将我的 Visual Studio 2017 更新到最新包 (15.5.5)。我还安装了最新的 Azure Functions SDK。

在我将新的 CosmosDB 触发函数添加到 Azure Functions 项目后,我在构建后看到了下图:

Error after build in VS
Nuget packages

没有任何关于 CosmosDBTrigger 的文档。也许你以前遇到过这个 class 并且可以告诉我在 nuget 中哪里可以找到这个神奇的库,它对我有用(其中定义了这个 CosmosDB 属性)?

PS:azure web jobs SDK 中的 DocumentDB 属性根本不起作用,只要函数具有此属性,azure 就根本看不到此函数。 队列绑定函数对我有用。

谢谢。

CosmosDBTrigger 属性仅在 Microsoft.Azure.WebJobs.Extensions.DocumentDB NuGet 包的 1.1.* 版本中引入。

遗憾的是,此版本仍处于测试阶段(1.1.0-beta4 截至今天),因此您需要勾选 Visual Studio 中的 Include prerelease 复选框才能使用它。