Bitbucket Server docker breaking after azure webapp updates the image

We are using atlassian/bitbucket-server docker image to run our bitbucket server in azure webapp for linux. Database is external SQL Server PaaS in azure and data directory is mounted using a azure premium storage account. Everything works great, until atlassian pushes an update to the tag we are locked on to. At this point the following happens:

  1. Azure detects the update to the tag.
  2. To make the update seamless, it spins up a new container with the image
  3. Spins up the container, while the old one is running
  4. Switches the requests over from current container to new container

Now because the current container is still running it has a .lock file in the data directory which causes the bitbucket boot to fail in the new container. As azure thinks that the container is up, it switches to using the updated container and we end up with a broken bitbucket server until we reboot the azure web app.

Is there a way in azure to disable “download auto updates” to the image? We are locked in the the exact tag down to minor version like “6.4.2”, when atlassian pushes an update to that tag itself, azure still tries to auto update.

We would like to control when the restarts and updates happen.

Source: StackOverflow