It sounds like your deployments are succeeding in terms of Oryx processing, but the actual app code isn't being updated in /home/site/wwwroot
. This typically points to one of the following:
- Run-From-Package (WEBSITE_RUN_FROM_PACKAGE=1) is still active or interfering.
- ZIP structure mismatch with your
--chdir src
startup command. - Gunicorn binding to wrong port.
- Deployment method not overwriting existing content due to caching or path mismatch.
- Should I avoid Run-From-Package for Python on Linux App Service?
Yes. For Python on Linux, Run-From-Package is not recommended. It’s primarily designed for Windows-based apps. On Linux, it can cause issues like the one you're seeing — deployments succeed but code doesn't update.
➡️ Action: Remove WEBSITE_RUN_FROM_PACKAGE
from your App Settings entirely.
- With
--chdir src
, should my ZIP root contain asrc/
folder or just its contents?
Your ZIP should contain the src/
folder, not just its contents. Since you're telling Gunicorn to --chdir src
, it expects that folder to exist in /home/site/wwwroot
.
➡️ Action: Ensure your ZIP structure looks like:
deploy.zip
└── src/
├── app.py
├── other_files.py
└── ...
- Should Gunicorn bind to the assigned
$PORT
instead of hardcoding 8000?
Yes. Azure assigns a dynamic port via the $PORT
environment variable. Hardcoding 8000
will cause the app to fail silently or not respond.
➡️ Action: Update your startup command to:
gunicorn --bind 0.0.0.0:$PORT --worker-class aiohttp.worker.GunicornWebWorker --timeout 1200 --chdir src app:app
- After a successful Zip Deploy, should updated code always appear under
/home/site/wwwroot
?
Yes. That’s the default deployment path for Linux App Service. If your code isn’t showing up there, something is blocking or misrouting the deployment.
➡️ Action: Double-check ZIP structure and remove WEBSITE_RUN_FROM_PACKAGE
.
- Is there any difference between
az webapp deployment source config-zip
andaz webapp deploy --type zip
?
Yes, slightly:
-
config-zip
: Older method, still works but less flexible. -
deploy --type zip
: Newer and preferred method, especially for Linux apps. It supports better logging and integration.
➡️ Action: Prefer az webapp deploy --type zip
going forward.
🛠️ Additional Suggestions
- Clear App Settings: Remove any lingering settings like
WEBSITE_RUN_FROM_PACKAGE
,SCM_DO_BUILD_DURING_DEPLOYMENT
, unless you're using Oryx intentionally. - Use App Service Logs: Check
/LogFiles
andaz webapp log tail
for startup errors. - Try Manual Deployment: Use FTP or local Git to test if ZIP deploy is the issue.
- Check App Settings in Azure Portal: Sometimes settings persist even after CLI changes.