I've created a web app service with B1 tier pricing in linux/python3.7
I've hooked up my Azure git to the deployement center, the application builds correctly, I've edited the start command to python -m streamlit run app.py --server.port 8000 --server.address 0.0.0.0. The app launches, I can access to the URL, but streamlit is stuck into Please wait...
I've tried to enable WebSockets, since some people said it was the issue. I could not found the option in the Portal, so I had to use the command az webapp config set --web-sockets-enabled true --name MyAppName --resource-group MyResourceGroup. In the output json, I can see the option enabled.
"webSocketsEnabled": true,
I tried to enable/disable all kind of options in the configuration Portal, but nothing is working. Any idea on what I am doing wrong?
(The app works in local mode, and I don't have access to Docker on my local computer, so I can not use this option to build my docker image)
EDIT 1:
In the chrome console, I get an error:
WebSocket connection to '' failed: WebSocket is closed before the connection is established.
But WebSocket is enabled, or at least from what my previous commands says
After reproducing from my end, I could able to reproduce the same error when the webapp is deployed with python 3.9.
RESULTS:
But when I re-deployed a new Web app with Runtime version- Python 3.10 the error was resolved. The below code works fine when the streamlit app runs locally.
import streamlit as st
st.set_page_config(page_title="My Test app", page_icon=":tada", layout="wide")
# --- HEADER SECTION ----
st.subheader("Hi, I am test app :wave:")
st.title("A test app to test streamlit")
st.write("I am passionate py developer")
st.write("[Learn More >](https://streamlit.io/)")
Python -m streamlit run app.py
RESULTS:
Deployed the same to a new app service on azure with Runtime stack Python version 3.10, OS Linux and SKU B1 Pricing tier (Basic).
Note- Free tier is not supported for Streamlit app atleast B1 or above is mandatory.
Deploy the local code of censusapp in Azure App Service via VS code.
After the code is deployed > Try accessing the website you will receive an application error, to resolve that. Let’s add python -m streamlit run app.py --server.port 8000 --server.address 0.0.0.0> in the startup command in the Configuration.
Disable HTTPS Only to OFF and set the configuration settings as below:-
NOTE: Even if you set this settings to OFF> you can browse your website with https://
After these settings are added and validated, follow the below steps
Browse your website
Wait until the website loads
Now you can see that the error doesn't show up anymore and the website runs successfully in the browser.
Make sure that if your Web app is running on lower Python version than 3.10 Please re-create a new Web App on Azure with runtime stack python 3.10 to resolve this issue.
Related
It is really frustrating as I am not able to resolve this issue of Application error. The app is up and running however when I try to access via azure URL, it gives the application error. Help would be appreciated
The error message
No issue in the logs, app is up and running
Your webapp is deployed on the Linux platform, and it is temporarily unclear what language your webapp is written in from the log.
Regarding the problem of Application Error, we usually add Startup Command to solve this problem.
Prerequisites:
Make sure that the port defined in the code uses the process.env.PORT parameter.
Example: In the nodejs project, when we are testing locally, we can define it like this:
const port = 8081 || process.env.PORT.
Then we need to add the startup command.
① If it is a vue project, the recommended command is
pm2 serve /home/site/wwwroot --no-daemon --spa
②If it is react or angular, it is recommended to use
npx serve -s
If you are using Python, you can refer to the following document.
Configure a custom startup file for Python apps on Azure App Service
I am attempting to launch the Simple Web Agent on the the develop branch using python3 and after having followed the documentation the agent is reportedly running according to "vctl status". However, netstat does not show any process running on the localhost and any attempt to communicate with localhost leads to "localhost refused to connect". Is there some process that must be completed before the documentation (other than activating the platform), or is there some other issue potentially in implementation, or is this a bug.
Screenshot
The SimpleWebAgent runs on top of the volttron platform itself. So you would need to setup the configuration file to support the web itself in the base platform.
# bootstrap the environment
(volttron) ~/volttron: python3 bootstrap.py --web
# create instance capable of handling web
(volttron) ~/volttron: vcfg
# Start volttron
(volttron) ~/volttron: ./start-volttron
Now you can do your netstat test and go from there.
I have Ubuntu 16.04 on VMware workstation 12 player and my desktop is Windows 10. I have created a simple Flask web api and using nginx and uwsgi. Same application is working on my Azure Ubuntu 16.04 VM without any problem.
I have not made any changes in code I brought all the files from Azure VM via scp from my local VMware VM. But still app is not working. I have followed steps given in following URLs:
I have executed all the step accept last step, instead of creating uWSGI Emperor I created systemd service
https://vladikk.com/2013/09/12/serving-flask-with-nginx-on-ubuntu/
https://www.digitalocean.com/community/questions/convert-run-at-startup-script-from-upstart-to-systemd-for-ubuntu-16
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04
Web api is working when i am running it from terminal using "python3 MLService.py &" command. which means flask along with my code has no issue. it is some thing with uwsgi and nginx.
Can any one help me understand gcloud app deploy? I tried deploying an application but it gave me the error:
ERROR: (gcloud.app.deploy) Error Response: [13] An internal error
occurred while creating a Google Cloud Storage bucket.
Thanks,
-VR
gcloud is google sdk command to interact with its cloud services, you can read more about it here https://cloud.google.com/sdk/gcloud/
you can run gcloud commands either by installing gcloud sdk or from a gcloud shell where sdk is pre-installed.
gcloud app deploy looks for app.yaml which can be configured based on this documentation https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
To address the error try running this command gcloud config set app/use_deprecated_preparation True; and give a try.
once we run gcloud app deploy --version v1 a version of the application is created and can be accessed by the corresponding url from version column.
one can even login to the running instance of VM by accessing respective instance ssh.
this command will tar ball the folder containing app.yaml and will be used to create the running nodejs instance; the entire deployment depends on PORT being used as part of NodeJS application for running production instance, and a proper package.json which will have all the dependencies listed and contains a start script to run the application.

I cannot for the life of me the the hello world app that google provides to work. I am following the tutorial here: https://cloud.google.com/nodejs/getting-started/hello-world
I have followed all the steps and the hello world code runs perfectly on my local machine. However, when I try to run
gcloud preview app deploy app.yaml --promote
I get the following output:
You are about to deploy the following modules:
- empirical-lens-111022/default (from [C:\Users\zakpt\Downloads\nodejs-getting-started-1-hello-world\nodejs-getting-started-1-hello-world\app.yaml])
Deployed URL: [https://empirical-lens-111022.appspot.com]
Do you want to continue (Y/n)? y
Beginning deployment...
Verifying that Managed VMs are enabled and ready.
Provisioning remote build service.
Copying certificates for secure access. You may be prompted to create an SSH keypair.
ERROR: (gcloud.preview.app.deploy) Couldn't connect to the Docker daemon.
I have no idea what to do, since the Docker isn't mentioned at all in the tutorial, and googling has only shown solutions for OSX. I am on Windows 10