I'm not even sure where to begin. Been stuck on this for weeks. azure support no help
tried deploying my webapp via the
az webapp up --runtime PYTHON:3.9 --sku B1 --logs
command as per the tutorial.
did not work tried so many things and troubleshooting steps BUT then downgrading to python 3.9 seemed to fix it. closed the web app as just wanted to test deployment
Lo and behold time to deploy again and even with 3.9 it's not working. Very similar error to before.
Everything seems fine until you go to the site and it shows the default page.
Hey, Python developers!
Your app service is up and running.
Time to take the next step and deploy your code.
Please I am so stuck. I have no idea what to do. The logs more or less seem fine. The only exception is probably this line:
**2024-07-20T05:59:44.2790642Z No framework detected; using default app from /opt/defaultsite**
Full log from docker.log file:
2024-07-20T05:55:00.3902714Z _____
2024-07-20T05:55:00.3986130Z / _ \ __________ _________ ____
2024-07-20T05:55:00.3986446Z / /_\ \\___ / | \_ __ \_/ __ \
2024-07-20T05:55:00.3986509Z / | \/ /| | /| | \/\ ___/
2024-07-20T05:55:00.3986564Z \____|__ /_____ \____/ |__| \___ >
2024-07-20T05:55:00.3986623Z \/ \/ \/
2024-07-20T05:55:00.3986678Z A P P S E R V I C E O N L I N U X
2024-07-20T05:55:00.3986739Z
2024-07-20T05:55:00.3986817Z Documentation: http://aka.ms/webapp-linux
2024-07-20T05:55:00.3986873Z Python 3.9.19
2024-07-20T05:55:00.3986927Z Note: Any data outside '/home' is not persisted
2024-07-20T05:55:03.8214747Z Starting OpenBSD Secure Shell server: sshd.
2024-07-20T05:55:03.9381273Z WEBSITES_INCLUDE_CLOUD_CERTS is not set to true.
2024-07-20T05:55:04.2147956Z App Command Line not configured, will attempt auto-detect
2024-07-20T05:55:04.5881884Z Starting periodic command scheduler: cron.
2024-07-20T05:55:04.5894244Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite
2024-07-20T05:55:04.6707489Z Could not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2024-07-20T05:55:04.6793501Z Could not find operation ID in manifest. Generating an operation id...
2024-07-20T05:55:04.6794124Z Build Operation ID: 0b109b87-79d7-48d6-b574-02224ca2189f
2024-07-20T05:55:05.1858753Z Oryx Version: 0.2.20240619.2, Commit: cf006407a02b225f59dccd677986973c7889aa50, ReleaseTagName: 20240619.2
2024-07-20T05:55:05.2140942Z No framework detected; using default app from /opt/defaultsite
2024-07-20T05:55:05.2236371Z Generating `gunicorn` command for 'application:app'
2024-07-20T05:55:05.2517486Z Writing output script to '/opt/startup/startup.sh'
2024-07-20T05:55:05.4037423Z WARNING: Could not find virtual environment directory /home/site/wwwroot/antenv.
2024-07-20T05:55:05.4038188Z WARNING: Could not find package directory /home/site/wwwroot/__oryx_packages__.
2024-07-20T05:55:14.2190016Z [2024-07-20 05:55:14 +0000] [72] [INFO] Starting gunicorn 22.0.0
2024-07-20T05:55:14.2989377Z [2024-07-20 05:55:14 +0000] [72] [INFO] Listening at: http://0.0.0.0:8000 (72)
2024-07-20T05:55:14.3000537Z [2024-07-20 05:55:14 +0000] [72] [INFO] Using worker: sync
2024-07-20T05:55:14.3510534Z [2024-07-20 05:55:14 +0000] [85] [INFO] Booting worker with pid: 85
2024-07-20T05:55:15.2720796Z 169.254.130.1 - - [20/Jul/2024:05:55:15 +0000] "GET /robots933456.txt HTTP/1.1" 404 207 "-" "HealthCheck/1.0"
2024-07-20T05:55:17.8317395Z 169.254.130.1 - - [20/Jul/2024:05:55:17 +0000] "GET / HTTP/1.1" 200 0 "-" "vscode-azureappservice/0.25.2 core-rest-pipeline/1.11.0 Node/v20.9.0 OS/(x64-Windows_NT-10.0.22631)"
2024-07-20T05:55:17.8318606Z 169.254.130.1 - - [20/Jul/2024:05:55:17 +0000] "GET / HTTP/1.1" 200 0 "-" "ReadyForRequest/1.0 (LocalCache)"
2024-07-20T05:55:18.1029493Z 169.254.130.1 - - [20/Jul/2024:05:55:18 +0000] "GET / HTTP/1.1" 200 0 "-" "ReadyForRequest/1.0 (AppInit)"
2024-07-20T05:59:13.3801927Z _____
2024-07-20T05:59:13.3830788Z / _ \ __________ _________ ____
2024-07-20T05:59:13.3830958Z / /_\ \\___ / | \_ __ \_/ __ \
2024-07-20T05:59:13.3831009Z / | \/ /| | /| | \/\ ___/
2024-07-20T05:59:13.3831055Z \____|__ /_____ \____/ |__| \___ >
2024-07-20T05:59:13.3831101Z \/ \/ \/
2024-07-20T05:59:13.3831177Z A P P S E R V I C E O N L I N U X
2024-07-20T05:59:13.3831231Z
2024-07-20T05:59:13.3831279Z Documentation: http://aka.ms/webapp-linux
2024-07-20T05:59:13.3831412Z Python 3.9.19
2024-07-20T05:59:13.4094526Z Note: Any data outside '/home' is not persisted
2024-07-20T05:59:13.4100953Z Starting OpenBSD Secure Shell server: sshd.
2024-07-20T05:59:13.4103417Z WEBSITES_INCLUDE_CLOUD_CERTS is not set to true.
2024-07-20T05:59:13.4104380Z App Command Line not configured, will attempt auto-detect
2024-07-20T05:59:13.6625701Z Starting periodic command scheduler: cron.
2024-07-20T05:59:13.6708328Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite
2024-07-20T05:59:13.7244425Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2024-07-20T05:59:13.7279268Z Build Operation ID: b17556e5486e42ab
2024-07-20T05:59:13.7290837Z Oryx Version: 0.2.20240619.2, Commit: cf006407a02b225f59dccd677986973c7889aa50, ReleaseTagName: 20240619.2
2024-07-20T05:59:13.7292985Z Output is compressed. Extracting it...
2024-07-20T05:59:13.7310566Z Extracting '/home/site/wwwroot/output.tar.gz' to directory '/tmp/8dca87ff5223cb1'...
2024-07-20T05:59:44.2576475Z App path is set to '/tmp/8dca87ff5223cb1'
- **2024-07-20T05:59:44.2790642Z No framework detected; using default app from /opt/defaultsite**
2024-07-20T05:59:44.2802269Z Generating `gunicorn` command for 'application:app'
2024-07-20T05:59:44.3170940Z Writing output script to '/opt/startup/startup.sh'
2024-07-20T05:59:52.8680747Z Using packages from virtual environment antenv located at /tmp/8dca87ff5223cb1/antenv.
2024-07-20T05:59:52.8751736Z Updated PYTHONPATH to '/agents/python:/opt/startup/app_logs:/tmp/8dca87ff5223cb1/antenv/lib/python3.9/site-packages'
2024-07-20T05:59:56.4825254Z [2024-07-20 05:59:56 +0000] [84] [INFO] Starting gunicorn 22.0.0
2024-07-20T05:59:56.5937341Z [2024-07-20 05:59:56 +0000] [84] [INFO] Listening at: http://0.0.0.0:8000 (84)
2024-07-20T05:59:56.5938220Z [2024-07-20 05:59:56 +0000] [84] [INFO] Using worker: sync
2024-07-20T05:59:56.6264592Z [2024-07-20 05:59:56 +0000] [97] [INFO] Booting worker with pid: 97
2024-07-20T05:59:56.6519476Z 169.254.130.1 - - [20/Jul/2024:05:59:56 +0000] "GET / HTTP/1.1" 200 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0"
2024-07-20T05:59:57.0656262Z 169.254.130.1 - - [20/Jul/2024:05:59:57 +0000] "GET /robots933456.txt HTTP/1.1" 404 207 "-" "HealthCheck/1.0"
2024-07-20T05:59:57.7421541Z [2024-07-20 05:59:57 +0000] [85] [INFO] Worker exiting (pid: 85)
2024-07-20T05:59:57.7934766Z [2024-07-20 05:59:57 +0000] [72] [INFO] Handling signal: term`
In my settings.py, I set:
ALLOWED_HOSTS = ['*']`
Just for testing purposes. So I know this issue can't be from that. Also have this towards the end:
STATIC_URL = '/static/'
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATIC_ROOT = BASE_DIR / 'staticfiles'
The SCM_DO_BUILD_DURING_DEPLOYMENT
is also set to true.
I'm not even sure where to begin. I'm not really a devops guy.
There are other things I'd be interested in discussing (i.e. an azure support engineer told me there's a bug with python 4.1~ and the latest django with azure app service, but that's another topic)
Right now I just want this launched and even if nobody knows what the issue is where exactly am i sort of supposed to pinpoint where it may be coming from? Azure is saying recent deployment is successful. Clearly it isn't.
I can webssh if it helps.
I am deploying it from a folder on my pc, that is linked to github but not from github via a Ci/cd pipeline. local git is the term i think
-changing python versions -updating requirements.txt file -playing around with some ettings -azure support`
I Cloned the GitHub repository from MS document to create and deploy Django web app to Azure App service.
For Deployment purpose I ran below commands to create Virtual Directory (venv) in the project.
py -m venv .venv
.venv\scripts\activate
Make sure that requirements.txt file contains the Required packages.
requirements.txt:
Django
whitenoise
I ran the below command to deploy the django web app to Azure app service.
az webapp up --runtime PYTHON:3.9 --sku B1 --location eastus2 --logs
I Successfully deployed django app to the Azure web apps as shown below.
Azure Web App Output:
If you are still facing issue for deployment, use Visual Studio Azure Extension to deploy your app to Azure.
After Successful deployment If you see the sample page or Error page use below command as startup Command in Configuration section of Azure App service.
gunicorn --bind=0.0.0.0 --timeout 600 <yourprojectnameContainswsgifile>.wsgi
Azure Output: