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
- Create a zip file that contains the necessary files (the files in this repository)
- 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.