How to get code in Azure portal to update?

Lorena Basulto (Contractor) 0 Reputation points
2025-08-28T15:15:22.6633333+00:00

I have code that I am deploying to Azure web app, but it never seems to get updated. Deployments report success, but in Kudu/Advanced Tools the app code under /home/site/wwwroot never shows new Modified timestamps, and app behavior doesn’t change. The only files that update are Oryx artifacts (output.tar.gz, oryx-manifest.toml).

Environment

Azure App Service: Linux, SKU B1

Runtime: PYTHON|3.12

Framework: aiohttp served via gunicorn

Startup command: gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 1200 --chdir src app:app

What I have tried

  • Run-From-Package (WEBSITE_RUN_FROM_PACKAGE=1) → app didn’t update.
  • Zip-deploy via YAML file (deployment method).
  • Zip Deploy via CLI from my machine (not GitHub Actions).

Commands I used:

Remove-Item deploy.zip -Force

Get-ChildItem src\ -Exclude "pycache", "venv" | Compress-Archive -DestinationPath deploy.zip -Force

az webapp deployment source config-zip --resource-group resource_group_name --name webapp_name --src deploy.zip

(I also deployed the same code to another Web App with the same approach; same result.)

  • GitHub Actions (zip-style deploy) → same behavior.
  • requirements.txt at ZIP root (also tried under src/) → same behavior.
  • Set SCM_DO_BUILD_DURING_DEPLOYMENT=true → Oryx runs (artifacts update), but app files under /home/site/wwwroot don’t get new Modified dates.
  • App restarts after each deploy; I’ve tailed logs with az webapp log tail.
  • Renaming the zip folder when deploying using CLI (locally).

Questions

For Python on Linux App Service, should I avoid Run-From-Package entirely and only use Zip Deploy + Oryx?

With my startup command using --chdir src, should my ZIP root contain a src/ folder, or just the contents of src?

Should gunicorn bind to the assigned $PORT instead of hardcoding 8000?

After a successful Zip Deploy, should my updated code always appear under /home/site/wwwroot, or could it be placed elsewhere?

Is there any difference between az webapp deployment source config-zip and the newer az webapp deploy --type zip for Linux/Python apps?

Not sure if I’m missing a key step here. Any guidance would be greatly appreciated.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. John Burkholder 0 Reputation points
    2025-08-28T15:46:55.4466667+00:00

    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:

    1. Run-From-Package (WEBSITE_RUN_FROM_PACKAGE=1) is still active or interfering.
    2. ZIP structure mismatch with your --chdir src startup command.
    3. Gunicorn binding to wrong port.
    4. Deployment method not overwriting existing content due to caching or path mismatch.

    1. 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.


    1. With --chdir src, should my ZIP root contain a src/ 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
        └── ...
    

    1. 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


    1. 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.


    1. Is there any difference between az webapp deployment source config-zip and az 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 and az 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.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.