Giter Site home page Giter Site logo

msdocs-python-flask-webapp-quickstart's Introduction

Deploy a Python (Flask) web app to Azure App Service - Sample Application

This is the sample Flask application for the Azure Quickstart Deploy a Python (Django or Flask) web app to Azure App Service. For instructions on how to create the Azure resources and deploy the application to Azure, refer to the Quickstart article.

Sample applications are available for the other frameworks here:

If you need an Azure account, you can create one for free.

msdocs-python-flask-webapp-quickstart's People

Contributors

bobtabor-msft avatar davidcberry13 avatar ismailmo1 avatar microsoft-github-operations[bot] avatar microsoftopensource avatar msangapu-msft avatar vmagelo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msdocs-python-flask-webapp-quickstart's Issues

Non-working web app using up-to-date Azure quickstart guide

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. Follow the official steps on Microsoft's website to deploy the example Python3.9-based web app.

Any log messages given by the failure

Local build and deployment works, however, the site is not accessible. The reason is a Flask dependency issue as documented here.

Expected/desired behavior

Web app accessible.

OS and Version?

Linux deployment on Azure app services

Versions

Python3.9

Mention any other details that might be useful

There are already multiple PRs attempting to fix this issue:


Thanks! We'll be in touch soon.

Requirements.txt not installing

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Git clone this repo, change the requirements.txt, deploy to Azure Web App using VS Code

Any log messages given by the failure

VS code said the deployment was successful. However, when I look at the app logs, it did not install the packages in my requirements.txt, and so the app failed when it tried to import one of them.

2024-03-26T20:29:02.6875605
import pymongo

2024-03-26T20:29:02.687564
ModuleNotFoundError: No module named 'pymongo'

Expected/desired behavior

I expect adding requirements.txt will automatically install those packages in the web app

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 10

Versions

Container can't find templates

Please provide us with the following information:

When I try to do a ZIP deploy of this code I receive an error that Flask cannot find the template files, they seem to exist in the container though. Also running the code locally does work as expected.

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. Create a zip file that contains the necessary files (the files in this repository)
  2. Deploy the app with az webapp deploy --resource-group 'xxx' --name 'xxx' --src-path 'test_app.zip'

Any log messages given by the failure

`
2023-11-13T15:04:44.460506197Z: [ERROR] [2023-11-13 15:04:44,459] ERROR in app: Exception on / [GET]
2023-11-13T15:04:44.460540498Z: [ERROR] Traceback (most recent call last):
2023-11-13T15:04:44.460547298Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app

2023-11-13T15:04:44.460553099Z: [ERROR] response = self.full_dispatch_request() \n
2023-11-13T15:04:44.460558199Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
2023-11-13T15:04:44.460563299Z: [ERROR] rv = self.handle_user_exception(e)
2023-11-13T15:04:44.460574199Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
2023-11-13T15:04:44.460579699Z: [ERROR] rv = self.dispatch_request()
2023-11-13T15:04:44.460584399Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
2023-11-13T15:04:44.460589199Z: [ERROR] return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
2023-11-13T15:04:44.460593800Z: [ERROR] File "/tmp/8dbe458884515a3/app.py", line 12, in index
2023-11-13T15:04:44.460598600Z: [ERROR] return render_template('index.html')
2023-11-13T15:04:44.460603200Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/flask/templating.py", line 148, in render_template
2023-11-13T15:04:44.460608100Z: [ERROR] ctx.app.jinja_env.get_or_select_template(template_name_or_list),
2023-11-13T15:04:44.460612700Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/jinja2/environment.py", line 1081, in get_or_select_template
2023-11-13T15:04:44.460617500Z: [ERROR] return self.get_template(template_name_or_list, parent, globals)
2023-11-13T15:04:44.460622100Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/jinja2/environment.py", line 1010, in get_template
2023-11-13T15:04:44.460627000Z: [ERROR] return self._load_template(name, globals)
2023-11-13T15:04:44.460631501Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/jinja2/environment.py", line 969, in _load_template
2023-11-13T15:04:44.460636301Z: [ERROR] template = self.loader.load(self, name, self.make_globals(globals))
2023-11-13T15:04:44.460640801Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
2023-11-13T15:04:44.460645701Z: [ERROR] source, filename, uptodate = self.get_source(environment, name)
2023-11-13T15:04:44.460650301Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/flask/templating.py", line 59, in get_source
2023-11-13T15:04:44.460654901Z: [ERROR] return self._get_source_fast(environment, template)
2023-11-13T15:04:44.460659401Z: [ERROR] File "/tmp/8dbe458884515a3/antenv/lib/python3.9/site-packages/flask/templating.py", line 95, in _get_source_fast
2023-11-13T15:04:44.460664201Z: [ERROR] raise TemplateNotFound(template)
2023-11-13T15:04:44.460680202Z: [ERROR] jinja2.exceptions.TemplateNotFound: index.html
2023-11-13T15:04:44.488524379Z: [INFO] Request for index page received
2023-11-13T15:04:44.488558180Z: [INFO] 169.254.129.1 - - [13/Nov/2023:15:04:44 +0000] "GET / HTTP/1.1" 500 265 "-" "AlwaysOn"
`

Expected/desired behavior

I would expect that if I follow the steps of this tutorial that I can see the demo application when I go to the URL.

OS and Version?

Local = windows10, web app is a linux web app with Python 3.9

Versions

Mention any other details that might be useful

One thing that might be different is that I used terraform to set up the web app infrastructure


Thanks! We'll be in touch soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.