Streamlit app deployed on an Azure Web App does not work


Am trying to deploy and run a webapp on Azure based on Python 3.10.
The deployment is from Visual Studio Code and it works seamlessly. However, when I run the app based on the command:
python -m streamlit run --server.port 8000 --server.address
it fails saying it could not create websockets.

WebSocket connection to โ€˜wss:// < default domain > /streamโ€™ failed:

We enabled websockets via:

az webapp config set --web-sockets-enabled true --name MyAppName --resource-group MyResourceGroup
(The documentation says Linux boxes on the B1 tier should have it on already)

The app is SSO enabled.

Tried a few other combinations like disabling HTTPS only, setting CORS to false, etc . Nothing has helped.

Any ideas?

Have u written DockerFile for your application? @thestarsailor . It is very easy to run via DockerFile

No, its a direct deploy via VS Code in my case.

Hi, I was having similar issue. resolved by giving this custom command

python -m streamlit run --server.port 8000 --server.address --server.enableCORS=false --server.enableXsrfProtection=false

Disabling CORS worked for me but it was giving a warning that it is not compatible with XsrfProtection=true hence turned it off too. I am looking for its implications now.