Web Pub Sub messages fail

Oli Kasicki 1 Reputation point
2022-11-16T07:46:25.977+00:00

using azure functions and following any of the tutorials for the azure web pub sub setup does not work.

For example:

https://learn.microsoft.com/en-us/azure/azure-web-pubsub/quickstart-serverless?tabs=javascript

The apps and functions run, you can get the access key from the negotiate function, and even connect to the WSS. However when a message is sent i get the response that the websocket connection is in a closed state.

Looking in the live trace for webpub i get this:

{"time":"2022-11-16T07:30:21.9515041Z","logLevel":"Warning","eventName":"AbuseProtectionResponseFailed","message":"Abuse protection validation for 'https://xxxxx.azurewebsites.net/runtime/webhooks/webpubsub?code=x' failed.","exception":"Failed to connect with egress. (webpubsubfunctionitem.azurewebsites.net:443)"}

There are no responses in the functions app logged coming from the webpubsub service, but its up and running and the hub endpoints are set as per the instructions?!

Azure Web PubSub
Azure Web PubSub
An Azure service that provides real-time messaging for web applications using WebSockets and the publish-subscribe pattern.
64 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,311 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Mike Urnun 9,676 Reputation points Microsoft Employee
    2022-11-19T20:33:49.4+00:00

    Hello @Oli Kasicki - I've gone through the steps of the tutorial and encountered the same error message with AbuseProtectionResponseFailed in the Live Trace Tool. I was able to fix this issue & successfully pass validation with AbuseProtectionSucceeded message instead by verifying & ensuring a correct URL Template in the Event Handler configuration which is the step discussed in the later part of the tutorial here: https://learn.microsoft.com/en-us/azure/azure-web-pubsub/quickstart-serverless?tabs=javascript#configure-the-web-pubsub-service-event-handler

    Could you check for the same and let me know if that solves the problem for you?

    -------------------------------------------------------------------------------

    Please consider contributing to MS Q&A by marking 'Accepted Answer' and ‘Upvoting’ as applicable.


  2. Oli Kasicki 1 Reputation point
    2022-11-23T15:08:29.46+00:00

    The issue was with the ukwest region web pub sub instances. As soon as I tried another region it worked fine.

    Thanks very much for your help investigating.

    0 comments No comments