Hi I have been trying to deploy a streamlit app in azure for the past couple of days. A simple app like
import streamlit as st
def main():
st.write('hello all')
if __name__=='__main__':
main()
even with requirements.txt, a docker file, trying to push the docker image to azure container registry, all process are done right. There are even no errors so that i can debug them. The app just opens up in azure and freezes in the please wait screen. Please can someone help. I have tried everything, github deployment local deployment. I have been following the below articles.
https://saitracychen.medium.com/deploy-a-streamlit-app-to-azure-126452e7df6d
https://towardsdatascience.com/deploying-a-streamlit-web-app-with-azure-app-service-1f09a2159743
What am not getting is if this is a recent issue specifically with streamlit and azure or am i doing something wrong. attaching my problem below. I have also managed to capture a HAR file from the frozen page if anyone can help with it. If anyone can document the recent process and changes we have to make to deploy in azure that will be great as the support on this topic is pretty thin online.
TLDR: you need to get at least a B1 appservice plan. The FREE one will not work with Streamlit (and apps using WebSockets).
After a couple of hours trying to find the answer to the same answer, I found out what it was. I wanted to deploy a streamlit app, but was stuck at the same place after following the guidance. A Ctrl+Maj+J showed in the "Please wait" page that WebSockets were an issue. It appears WebSockets will not work for FREE Linux appservice plans, and after recreating a B1 appservice plan (as in the guidance), it worked.
Related
I installed/imported streamlit, numpy, and pandas but I do not know how I can see the charts I have made. How do I deploy it on repl.it?
Actually, you can.
Add the streamlit by going to Packages, searching for streamlit, and clicking on install
[]
Write your code (for example in a file called app.py)
Go to the shell of Repl.it and type streamlit run app.py (assuming your app is indeed called that way)
It might ask you if you want to register your email: either enter or press ENTER
Wait a bit: a "Firefox" window will open in Repl.it with the app
You can not deploy streamlit application within repl.it because
In order to protect against CSRF attacks, we send a cookie with each request.
To do so, we must specify allowable origins, which places a restriction on
cross-origin resource sharing.
One solution is push your code from repl.it to GitHub. Then deploy from GitHub on share.streamlit.io.
First picture: your streamlit app code will be in here.
Second one: main.py to drive the streamlit app.
Last one: you can click Start button for the program to run.
I make this topic as we have a problem uploading a python archive in Azure. We did a modular code with python, which is a text generator. The code is working on python environment, besides we wanted to upload it to the cloud. When we tried it, we used the App service of Microsoft azure, we didn’t have any trouble while we were doing the process this way. Nevertheless, at the end, the program gave us a json, when we tried to put that URL into the navigator… There’s were the problem is, the generated Jason doesn’t connect with the navigator. We don’t have any clue of what’s happening, because the console doesn´t give any warning or error.
If any of you knows or have a tip for us to solve this problem, I would appreciate it,
Thanks for your attention and have a nice day.
Welcome to Stack Overflow! From what I understand, I suppose you should be going with Azure Automation Runbooks instead of Azure App Service, if you intend to execute or automate a task-like job. You can also test your runbook and implement error handling streams to ensure it works as expected. Please refer to this example for a detailed walkthrough.
Please elaborate your requirement if this is not what you were looking for, and we can explore other alternatives.
Stack communities,
I need your help. I’ve just written my first app in Python with the dash libraries. I am now trying to deploy thanks to the Heroku frameworks. It first works but when trying to connect it my database (PostGre), it crashed. I think it’s because my connection btw Heroku/PostGre SQL is not working correctly.
I’ve tried many changes within my code but still don’t understand why my app crash.
When I try to run the app, I get the following error within the heroku log :
Image of the Heroku error within the server log
My code can be found here in my Github repositorie.
As of now, my database consists of a giant CSV master file because I want to keep it simple for now.
Link to the Database (Private): https://s3-eu-west-1.amazonaws.com/iag-test1/Test1.csv
*On Heroku it seems that I should use the AWS-S3 and connect it. But I didn't manage to do it.
The goal of this project is to build an end-to-end visualization tool in python and deploy it. (I decided to use Dash Library and Heroku to deploy it). Maybe I should switch to AWS...
Any help/advice would be greatly appreciated…
This morning I made some changes to my Python web app, and then I uploaded my App using the tool provided by Google. But it stopped at "Compilation starting", and it showed error 500 after couple minutes. In the same time, I cannot access the dashboard of the app.
I have never faced this situation.
Did anyone experience the same situation? Or what might cause this situation?
It is really weird that after clicking run button, it does nothing and also no log and show a clock sign on the first column.
It works normally before. However, after I messed up my python environment, the google coursebuilder can't run web application. That's my guessing. When I run which python.it only shows:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
These let me feel like I have no way to solve it!Are there anyone who came across this problem before? Any ideas or suggestions?
Updated: I follow suggestions to use command line to run web application on GAE. It reminds me here:
Update: The error message shows that GAE can't get the allocated port and domain. The reason why it happens is that when I use command line to run the web application, I also open GAE GUI to run a web app with the same port number.
So the way to solve it is to close the GAE GUI and free the port. Or we also could designate another kind of port number with command line.(--port=XXXX and --admin_port=YYYY). Or take a look at the doc:
Again thanks for the help of Mihail R!
The OP had multiple issues with GAE setup which were resolved by simply reinstalling the GAE Launcher and making sure the app was first copied into Applications from the .dmg file, then ran from the Applications instead of from inside the .dmg file, and appropriate permissions were suppose to be given so that GAE Launcher created the symlinks it needed to work properly.
More instructions on proper GAE SDK installation can be found here: https://cloud.google.com/appengine/downloads after clicking on the needed SDK and then the OS the SDK will be installed on.