【问题标题】:Azure Function Binding Types - The binding type(s) 'webPubSubTrigger' were not found in the configured extension bundleAzure 函数绑定类型 - 在配置的扩展包中找不到绑定类型“webPubSubTrigger”
【发布时间】:2021-12-22 22:52:08
【问题描述】:

我正在尝试在发布 Web PubSub 消息时触发 Azure 函数。

根据this article 中的示例,当新消息发送到特定集线器时,我应该能够使用以下内容来触发函数...

{
  "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.

这是我在 host.json 中的 extensionBundle 配置...

"extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[3.3.0, 4.0.0)"
  }

但是 this article 没有将其列为受支持的绑定类型,所以至少可以说我有点困惑!

谁能指点我正确的方向?

我在 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`

【问题讨论】:

    标签: node.js azure azure-functions azure-node-sdk azure-web-pubsub


    【解决方案1】:

    根据extension bundles versions available,将版本设置为[3.3.0, 4.0.0) 应该可以做到这一点。 请注意,这也会更新其他扩展程序。因此,最好测试一下其他功能是否不会影响此更改

    另一种选择是使用 Web PubSub 文档中提到的此命令显式安装此扩展程序。

    func extensions install --package Microsoft.Azure.WebJobs.Extensions.WebPubSub --version 1.0.0
    

    【讨论】:

    • 谢谢,但我已经尝试过了,它只是告诉我它已经安装了。也更新了我的问题以说明这一点。还有其他想法吗?
    • 知道了。把它给忘了。由于您有扩展包,因此它不起作用。您可以确认扩展包或手动安装扩展。如果您没有使用任何其他扩展,您可以简单地更新扩展包版本。如果您正在使用其他扩展并且无法升级,最好删除扩展包并为每个扩展手动安装。
    猜你喜欢
    • 2018-11-20
    • 1970-01-01
    • 2011-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多