question

deil avatar image
0 Votes"
deil asked ·

Python web app ZIP deploy fail

I have a Python web app that I ZIP-deploy, and for some reason it keeps creating and removing a virtual environment in a loop, never finishing.

2020-05-19T23:25:53.967623000Z Found virtual environment .tar.gz archive.
2020-05-19T23:25:53.968226705Z Removing existing virtual environment directory /antenv...
2020-05-19T23:25:53.976257370Z Extracting to directory /antenv...
2020-05-19T23:25:56.205290595Z Using packages from virtual environment antenv located at /antenv.
2020-05-19T23:25:56.206097405Z Updated PYTHONPATH to ':/antenv/lib/python3.7/site-packages'
2020-05-19T23:25:56.216082621Z Found virtual environment .tar.gz archive.
2020-05-19T23:25:56.216518226Z Removing existing virtual environment directory /antenv...
2020-05-19T23:25:56.331714066Z Extracting to directory /antenv...
2020-05-19T23:25:57.226820579Z Using packages from virtual environment antenv located at /antenv.
2020-05-19T23:25:57.227425286Z Updated PYTHONPATH to ':/antenv/lib/python3.7/site-packages:/antenv/lib/python3.7/site-packages'

Log: https://gist.github.com/cdeil/ccda12faae5535d7193b7ace4a9f9355

I use this command to deploy:

az webapp deployment source config-zip --src app.zip

My requirements.txt contains this:

flask
fastapi
uvicorn
./hcem

I have a wheel hcem-0.1.dev359+g350d752.d20200520-py3-none-any.whl in the ZIP file.

My startup.sh contains this:

python -m uvicorn application:app --host 0.0.0.0

I'm using SCM_DO_BUILD_DURING_DEPLOYMENT = true

I tried in the app settings to put startup.sh or passing the start command directly.

This seems related: https://github.com/microsoft/Oryx/issues/557 and also this one https://github.com/Azure-App-Service/python/issues/17 but I couldn't figure out my issue with either one.


What is the "Found virtual environment .tar.gz archive." message about? Which file exactly?

Any suggestion to debug or fix this deployment issue?

azure-webapps
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

What app service plan are you using @deil?

0 Votes 0 ·

Hi @deil,

I wanted to follow up with you to see if you were still having issues with deploying your Python web app through zip deploy. Let us know.

Regards,
Ryan

0 Votes 0 ·

0 Answers