0

I'm trying to trigger an Azure Function when a Web PubSub message is published.

According to the example in this article, I should be able to use the following to trigger a function when a new message is sent to a specific hub...

{
  "disabled": false,
  "bindings": [
    {
      "type": "webPubSubTrigger",
      "direction": "in",
      "name": "data",
      "hub": "ABC",
      "eventName": "message",
      "eventType": "user"
    }
  ],
  "scriptFile": "../dist/WebPubSubTrigger/index.js"
}

However, I keep getting this error whenever I initialise the function app...

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.

Here's my extensionBundle config in host.json...

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

But this article does not have it listed as a supported binding type so I'm a little puzzled to say the least!

Can anyone point me in the right direction please?

I'm running my Functions in a NodeJS environment but that shouldn't make a difference I don think.

I have also already tried installing manually, as per below, but tells me it's already installed ‍♂️

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`
an0nc0d3r
  • 67
  • 1
  • 6

1 Answers1

1

According to the extension bundles versions available, setting the version to [3.3.0, 4.0.0) should do the trick looks like. Do note that this will update other extensions as well. So, it would be best to test that other functions are not breaking do to this change

Another option would be to just install this extension explicitly with this command as mentioned in the Web PubSub docs.

func extensions install --package Microsoft.Azure.WebJobs.Extensions.WebPubSub --version 1.0.0
PramodValavala
  • 6,026
  • 1
  • 11
  • 30
  • Thanks, but I've already tried that and it just tells me it's already installed. Have updated my question to state that too. Any other ideas? – an0nc0d3r Dec 28 '21 at 15:52
  • Got it. Forget about that. Since you have the extension bundle it doesn't work. You could either have an extension bundle confirmed or install extensions manually. If you are not using any other extension, you could simply update the extension bundle version. If you are using other extensions and can't upgrade, best to remove the extension bundle and install the extensions manually for each. – PramodValavala Dec 29 '21 at 05:30