node.js - Cosmos DB 触发器绑定未注册?
问题描述
我设置了一个简单的天蓝色函数 cosmos 触发器,如下所示:
{
"bindings": [
{
"type": "cosmosDBTrigger",
"name": "documents",
"direction": "in",
"leaseCollectionName": "leases",
"connectionStringSetting": "DbConnectionString",
"databaseName": "mydb",
"collectionName": "mycollection",
"createLeaseCollectionIfNotExists": "true"
}
],
"scriptFile": "../dist/TestCosmosTrigger/index.js"
}
当我运行该函数时,出现错误:
“TestNotifier”函数出错:绑定类型“cosmosDBTrigger”未注册。请确保类型正确并安装了绑定扩展。
不知道我做错了什么,也许是 nodejs azure 函数中的错误?
编辑:在我的计算机上更新 azure 功能工具后,现在一大堆其他绑定已经开始失败,并出现相同的错误,例如 signalr:
{“类型”:“signalRConnectionInfo”,“名称”:“connectionInfo”,“hubName”:“聊天”,“userId”:“{headers.authorization}”,“方向”:“in”}
未安装 signalRConnectionInfo 绑定扩展。
解决方案
使用以下命令更新 azure 功能核心工具后:
npm i -g azure-functions-core-tools@core --unsafe-perm true
然后运行:
func extensions install -p Microsoft.Azure.WebJobs.Extensions.SignalRService -v 1.0.0
看起来上述问题已解决,出现了一个新问题,但这是一个单独的问题。
推荐阅读
- file-upload - 使用 MSXML 在 VB6 中上传文件时内存不足 (7)
- angularjs - 是否有一种“AngularJs”方式在 dom 周围移动元素?
- odoo-11 - 如何在 Qweb 销售报告的描述记录行设置字体大小或粗体?
- c# - admob 广告未以 xamarin 形式出现在模拟器中
- java - 检查对象的列表数组中是否存在值
- c# - 如何使用 Unity 3D 在运行时读取和写入 TextAsset?
- java - 单击按钮时如何发布值?
- angular - Newbee Angular 开箱即用
- android - Pass data from one page to another in Flutter
- c# - 返回第一个连续日期块