Error during WebSocket handshake on Azure App Service

Mr Robi 1 Reputation point
2019-12-17T02:24:35.603+00:00

Hi, I'm trying to deploy my NodeJS/React app to Azure App Service, and have turned on Web sockets option in Configuration > Web sockets > On, and restarted the instance. However, I still encounter "Error during WebSocket handshake: Unexpected response code: 503" on the application. Can anyone advise on this?

Update: Found the answer that I need. I can change startup command in Configuration > General settings > Startup Command. By default, it's using "npm start" which is meant for development only (for React).

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

2 answers

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2019-12-17T11:07:02.063+00:00

    Thanks for asking question! Could you please double check on ports, As Azure WebApps only listens on port 80 & 443, You may check below link:

    https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#network-endpoint-listening

    Also there is limits of websockets per app service instance for different tier, please see

    https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/#app-service-limits.


  2. Samir Jain 26 Reputation points
    2019-12-18T07:01:32.553+00:00

    @Mr Robi You may explicitly try creating the default document index.html as per https://learn.microsoft.com/en-us/azure/app-service/configure-common#default-documents

    If this does not work, please create the iisnode.yml file to get more information around it. https://blogs.msdn.microsoft.com/azureossds/2018/08/03/debugging-node-js-apps-on-azure-app-services/

    alt text


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.