当网络PubSub消息发布时,我试图触发Azure函数。
根据这篇文章中的示例,当一条新消息被发送到特定的集线器时,我应该能够使用以下方法触发一个函数.
{
"disabled": false,
"bindings": [
{
"type": "webPubSubTrigger",
"direction": "in",
"name": "data",
"hub": "ABC",
"eventName": "message",
"eventType": "user"
}
],
"scriptFile": "../dist/WebPubSubTrigger/index.js"
}但是,每当我初始化函数应用程序时,我都会收到这个错误.
The 'WebPubSubTrigger' function is in error: The binding type(s) 'webPubSubTrigger' were not found in the configured extension bundle. Please ensure the type is correct and the correct version of extension bundle is configured.这是我的extensionBundle配置在host.json..。
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.3.0, 4.0.0)"
},但是 这篇文章并没有把它作为支持的绑定类型列出,所以我至少有点困惑!
谁能给我指明正确的方向吗?
我正在NodeJS环境中运行我的函数,但我认为这不会有什么区别。
我也尝试过手动安装,如下所示,但告诉我它已经安装了♂️
Me | Tue 28 @ 15:49 ~/Development $ func extensions install --package Microsoft.Azure.WebJobs.Extensions.WebPubSub --version 1.0.0
No action performed. Extension bundle is configured in /Users/me/Development/host.json`发布于 2021-12-28 11:16:55
根据可用的扩展包版本,将版本设置为[3.3.0, 4.0.0)应该可以完成如下操作。确实注意到,这也将更新其他扩展。因此,最好测试其他函数没有中断对此更改的操作。
另一种选择是使用下面的命令显式地安装这个扩展,就像Web文档中提到的那样。
func extensions install --package Microsoft.Azure.WebJobs.Extensions.WebPubSub --version 1.0.0https://stackoverflow.com/questions/70455952
复制相似问题