Websocket connection to xxxx failed for React Static Web App + Django App Service application

Nicholas 20 Reputation points
2025-05-05T02:08:19.5266667+00:00

I have a react frontend hosted on Static Web Apps and Django backend hosted on App Service with Azure Redis cache server.

I'm using the base websocket functionality (no other libraries) and for django I'm using channels-redis.

Everything should be set up properly as my websocket connection work fine locally but on Azure it does not work at all, saying my websocket connection failed with no other error message or way to debug this.

index-CCaVDsll.js:6 WebSocket error:

  1. Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
  2. isTrusted: true
  3. bubbles: false
  4. cancelBubble: false
  5. cancelable: false
  6. composed: false
    1. currentTarget: WebSocket {url: 'wss://XXXXXXX.azurewebsites.net/ws/XXXXXXX/XXXXX/', readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
    2. defaultPrevented: false
    3. eventPhase: 0
    4. returnValue: true
    5. srcElement: WebSocket {url: 'wss://XXXXXXX.azurewebsites.net/ws/XXXXXXX/XXXXX/', readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
    6. target: WebSocket {url: 'wss://XXXXXXX.azurewebsites.net/ws/XXXXXXX/XXXXX/', readyState: 3, bufferedAmount: 0, onopen: ƒ, onerror: ƒ, …}
    7. timeStamp: 8701.199999988079
    8. type: "error"
    9. [[Prototype]]: Event
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,157 questions
{count} votes

Accepted answer
  1. Prabhavathi Manchala 1,370 Reputation points Microsoft External Staff Moderator
    2025-05-09T01:19:02.6+00:00

    Hi Nicholas,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue:

    Websocket connection to xxxx failed for React Static Web App + Django App Service application

    Solution:

    After unlinking my app service from my static web app, I was able to finally get the websocket connection through.

    Please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Nicholas 20 Reputation points
    2025-05-07T00:59:09.2133333+00:00

    After unlinking my app service from my static web app, I was able to finally get the websocket connection through.

    0 comments No comments

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.