How do you update function app with new docker container?

Tall Paul 1 Reputation point
2022-11-07T14:24:25.903+00:00

I am trying to understand how to properly update a function app when a new updated docker container is required. I am using a GitHub action to build and deploy the docker image to an Azure registry; which works without issue. Then I associate that newly created image with an existing function app. This does not appear to work as no matter what I do the same (older) image is loaded. I found, mentioned here, that if I recreate the function app then it will pick up the latest image.

Should I need to recreate a function app each time? I would think that if the DOCKER_CUSTOM_IMAGE_NAME was specified that it would pick up the referenced image (which is not happening). I have tried different image names; however, the function app appears to continue to use the old image and not the reference to the updated one. I have downloaded the image from the repository and the image is built/working as I would expect, but this is not the image the function app is loading.

Due to changes with Azure Functions version 4, I am required to build a custom image to get all the underlying libraries required. Would someone please be able to give me some further insight into this? I would hate to have to recreate the function app each time I need to deploy an updated version, not to mention the headache of moving the configuration from one to the other so that it is properly configured.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,499 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Tall Paul 1 Reputation point
    2022-11-07T20:59:26.397+00:00

    I believe I found my issue. The function app was previously built from a package. It appears that this setting is still enabled even though the WEBSITE_RUN_FROM_PACKAGE has been set to 0 and or deleted. The image is updated/loaded as expected; however, the old package is overwriting the /home/site/wwwroot contents.

    I have not found a way to use only the image and not the old package, so it looks like I may have to recreate the function app. At least with this, I will only need to recreate once instead of each time a deployment is required.

    0 comments No comments

  2. Tall Paul 1 Reputation point
    2022-11-08T23:32:15.827+00:00

    For those that may stubble upon this thread, I needed to remove several parameters that were causing the software package to be picked up and installed in the /home/site/wwwroot directory. Once the parameters that were causing the software to overwrite in /home/site/wwwroot everything was good to go. No need to recreate the function app once the configuration parameters were updated.