Post-build actions in Python/Linux webapp do not run

Matthew Bellringer 26 Reputation points
2022-01-22T16:17:26.033+00:00

I have a Django-based web app deployed from Github, running in Python 3.9. The app deploys and starts successfully.

I need to add post-build actions to complete the deployment; the exceeding common Django task of running "manage.py". Following the general and python-specific docs I have added the app setting of POST_BUILD_SCRIPT_PATH=postbuild.sh

There is a shell script, postbuild.sh in the root of my app, which runs fine if I SSH into the running container. The expected behaviour is that after deployment, this should run, and output to the deployment log. Neither of these things happen; the log goes from starting the container all the way through to launching the app, without ever showing any output related to post-build actions.

I have tested the app setting POST_BUILD_COMMAND with a very simple echo, and that does nothing either.

Can you tell me either what I need to do to make these app settings work, or suggest an alternative method of running the post-build script?

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

Accepted answer
  1. Ryan Hill 25,391 Reputation points Microsoft Employee
    2022-01-24T20:13:20.277+00:00

    Hi @Matthew Bellringer ,

    You need to set the app setting to a relative path.

    Note: Always use relative paths in all pre- and post-build scripts because the build container in which Oryx runs is different from the runtime container in which the app runs. Never rely on the exact placement of your app project folder within the container (for example, that it's placed under site/wwwroot).

    168004-image.png


0 additional answers

Sort by: Most helpful