Jump to content

Azure Web PubSub : Request failing with Http Error 500 for Azure functions

Featured Replies

Posted

Recently one of our customers was facing issue in web pubsub with function app sample.

 

 

 

They followed the below simple chat sample and it was working fine while running locally.

 

 

 

azure-webpubsub/samples/functions/csharp/simplechat at main · Azure/azure-webpubsub · GitHub

 

 

 

After publishing the code to azure we started to receive below error

 

 

 

largevv2px999.png.45af83117ee5ea38d954c300f0f24cc3.png

 

 

 

On further analyzing we found that there are 2 application settings keys missing in function app which was causing this error.

 

 

 

1. WebPubSubConnectionString : This will be available under your pub sub account -->Settings -->Keys and you can consider either primary or secondary key

 

 

 

largevv2px999.jpg.eea908003d6a5d4c51472a9e7d96d932.jpg

 

 

 

 

 

2. WebPubSubHub : Name of the hub configured in pub sub account under pub sub -->Settings --> Settings

 

 

 

largevv2px999.png.171389f108b13f1813eb2562bb8810bb.png

 

 

 

After adding WebPubSubConnectionString and WebPubSubHub to the function app, issue got resolved.

 

 

 

largevv2px999.png.e0313470263aec27f7ab2f3a45d909d8.png

 

 

 

 

 

With the above keys in place application started working

 

 

 

largevv2px999.png.ed05864e2ad713f0c603bf8a45d5a02c.png

 

 

 

Alternatively, we can also deploy function app using Azure Functions Core Tools (Azure/azure-functions-core-tools: Command line tools for Azure Functions (github.com)), basically does the same thing, updates the Application Settings in Function App using local.settings.json file.

 

 

 

 

 

 

 

func azure functionapp publish <FUNCIONAPP_NAME> --publish-local-settings

 

 

 

 

 

 

 

Hope this helps!!!

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...