Azure / Azure/app-service-linux-docs

Post Deployment Script in Azure Web App for Containers

Open
#31 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
150
Forks
90
Avg merge
2m
Merged PRs (30d)
1

Description

Is it possible to run a post-deploy script inside a container in Azure Web App for **Containers**(not the "regular" Web App with Kudu).

I have an ARM template that creates some resources, including a Web App for Containers where I use a Dockerhub image. I want to run a post-deployment script inside the container(a database migration script if that matters("bundle exec rake db:migrate" specifically)).

I can put the command into the Startup File in the Container Settings in the Azure Portal. That runs the command successfully, but it doesn't start up the container normally. So, I have to remove the Startup File migration command after it completes and then restart the Web App for it to start up normally. This is not optimal, neither is running the migration command on every startup/restart and then starting up the webserver.

This type of post-deploy script option is available in Heroku's template deployments, using the scripts object and the postdeploy key in it. See https://devcenter.heroku.com/articles/app-json-schema#scripts.

Does such a post-deploy script option exist for Azure Web App for Containers? I believe such an option exists for the regular Web Apps, but I haven't seen anything related to Web App for Containers.
If not, is there a simpler/better way to run the migrate command than what I'm currently doing?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.