Azure Web PubSub : Request failing with Http Error 500 for Azure functions
Published Jan 30 2023 08:03 AM 1,077 Views

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




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





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




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





With the above keys in place application started working




Alternatively, we can also deploy function app using Azure Functions Core Tools (Azure/azure-functions-core-tools: Command line tools for Azure Functions (, 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!!!



Version history
Last update:
‎Jan 30 2023 08:01 AM
Updated by: