I have made a docker container with pandas and streamlit. My streamlit container runs like a dream on my local laptop. But when I try to run it under Azure App services it hangs:
Hi @sojohan, I am not an Azure expert, but can you double check you don’t need any special configuration to enable Websockets? Is it supposed to work out of the box on Azure? Can you share the content of the network tab? Chrome tools -> Network
I am also having this same problem. I have implemented all the suggestions on this forum to no avail. If anyone has been successful in deploying to Azure, a written guide will be much appreciated.
I had a lot of problems before eventually getting it working.
The most important to solve was to discover that you need to switch “Always on in the configuraiton settings”. Otherwise your docker container will be closed down after X minutes of inactivity. Leading it to have very, very long response times.
I also set folderWatchBlacklist = [''] in the config.toml file.
I also setup a script to ping my web site every 5 minutes to keep it being responsive. It’s running inside the docker container. I’m actually not sure this is needed. But I still do it.
Then I did a lot of other things to solve this. But some where because I did some very special things with streamlit. So these where changes to the code and should not be relevant to you.
I would really like there to be a guide and could maybe also find the motivation to write one the next time i deploy a streamlit app to Azure via Docker. But I don’t know when that will be unfortunately.
@Marc, thank you for your response. I will incorporate your suggestions and hopefully it will work. Should I get it work, I will report back here.
By the way, your awesome-streamlit site is awesome and I reference it from time to time. Thank you!
So I have been able to successfully deploy to Azure, thanks to @Marc’s suggestions and his ‘awesome-streamlit’ site. Basically, I created a .streamlit folder in my project folder which then holds my configurations and changed the port to 80. After pushing my docker image to Azure web app service, I added a new setting named 'WEBSITES_PORT" with value 80. Hope it helps @sojohan.
I was able to “deploy” using this reference but got this error: No credential was provided to access Azure Container Registry. Trying to look up…
Then, expectedly, this error when I navigate to the site: Application Error
If you are the application administrator, you can access the diagnostic resources.
I just copied the config.prod.toml and credentials.prod.toml files to my folder (deleted the “prod” from the file names), updated the docker file to reflect my app name.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.