0

I am new to web development and am currently trying to deploy a Flask Web Application on Microsoft Azure. I do so from a local Git repository as I am using tensorflow models that have a size of almost 600MB altogether which I cannot upload on GitHub.

The application works locally and I can successfully deploy it in Microsoft Azure (according to the CMD). However, visiting the URL gives a '503 Service Temporarily Unavailable'. What does that mean?

Can someone explain to me how I need to structure my application to make it work properly. I know that I need a startup.txt file to tell Azure where to find my main.py file to start the Flask app. I also have a requirements.txt file with all the dependencies. What am I missing?

Any help / feedback is very much appreciated!
All the best,
snowe

My current app structure:

.git
static
templates
models
utils (some python functions)
main.py
requirements.txt
startup.txt (with: gunicorn --bind=0.0.0.0 --timeout 600 main:app)
snowe
  • 31
  • 1
  • 1
  • 4
  • it is correctly deployed, you need to see what error you are facing in logs or deploy it manually on azure – sahasrara62 Apr 23 '20 at 16:54
  • Hi sahasrara62 :) I redeployed everything and now I don't get any errors when I open the URL. I only get the default page. When I open the 'Git clone url' it says 'No route registered for '/.git'. Does that mean anything? And what do you mean with deploy manually? – snowe Apr 23 '20 at 20:40
  • i don't have hand on experience with ci cd process, but in azure you can upload code in azure repo and create a ci cd process to deploy the system, you can deploy them in pipline in azure – sahasrara62 Apr 23 '20 at 21:08
  • Now I get: ` ERROR - Container for site has exited, failing site start ERROR - Container didn't respond to HTTP pings on port: 8000, failing site start ` what does that mean? in my flask main.py file, which port do I have to specify and which host? – snowe Apr 24 '20 at 10:10
  • [expose export error](https://stackoverflow.com/questions/55688600/azure-web-app-on-linux-error-container-didnt-respond-to-http-pings-on-port) please go through this, regarding [deploying flask app in azure](https://medium.com/@nikovrdoljak/deploy-your-flask-app-on-azure-in-3-easy-steps-b2fe388a589e) try with a sample project and see how u can scale it to you current project :) – sahasrara62 Apr 24 '20 at 11:57
  • thank you, I will try :) – snowe Apr 24 '20 at 18:53
  • I managed to make it work with your advice sahasrara62, thank you! I had to downscale my application and its resources but at least I got a working pipeline :) – snowe Apr 29 '20 at 07:52
  • cool, good to know it's working :) – sahasrara62 Apr 29 '20 at 12:02
  • I hope u r doing well and deployed ur project in cloud, [little more help](https://towardsdatascience.com/how-to-deploy-ml-models-using-flask-gunicorn-nginx-docker-9b32055b3d0) if you still stuck somewhere – sahasrara62 May 02 '20 at 02:48

0 Answers0