Azure Functions - Deploy Functions To Container Version of Azure Functions

Pie 246 Reputation points
2022-08-14T23:16:27.483+00:00

I have a Azure Functions App which is using containers. The container that is being used is the Python 3.8 version.

A Docker container image is being pushed via GitHub Actions to the Azure Function. In the Deployment Center - Container Logs I can see the container being pulled when updated.

However, there are no functions present.

231047-image.png

The logs seem to indicate nothing is happening.

231690-image.png

When I pull the container locally, I cd into /home/site/wwwroot/azure_function/ folder and then run func start and I get the list of functions that have been started. I would expect that to happen in the container but seems nothing is. Is there a config I am missing to start the functions after being loaded into Azure?

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

4 answers

Sort by: Most helpful
  1. David Broggy 5,681 Reputation points MVP
    2022-08-15T02:52:12.157+00:00

    Hi Pie,
    What hosting method did you choose?
    As I understand it, function apps created through VS Code won't be shown in the Fusions blade.

    reference:
    functions-create-function-app-portal

    0 comments No comments

  2. Pie 246 Reputation points
    2022-08-15T15:20:50.707+00:00

    @David Broggy
    Not sure what you mean by hosting method. I created a Azure Function App that uses Containers and then created a Dockerfile that was based off the below. The Dockerfile just installs a few packages and the items in the requirements.txt file.

    FROM mcr.microsoft.com/azure-functions/python:4-python3.8

    231136-image.png

    In VS Code I have the Azure Extension installed, and I can select to deploy my Azure Function App via VS Code.

    When I deploy it takes about 2 minutes but I don't see my functions show up. When I deploy to the non-container version of Azure Function using python, the deployment takes about 6 minutes and I do see several functions appear in the portal.

    0 comments No comments

  3. Pie 246 Reputation points
    2022-08-16T19:08:56.517+00:00

  4. Pie 246 Reputation points
    2022-08-17T16:10:08.03+00:00

    Got the functions running in a container. Here is what needs to be done.
    Since I already had a Linux Consumption plan running with a few functions I wanted to move this to a container.
    After creating the Dockerfile and copying the azure function source code I had over to the container, I was placing the code in a different directory than the /home/site/wwwroot expectation.
    The root of the function app has to be copied to that folder, as the host.json file is what Azure is looking for and when found after deployment that file is used to automatically start all the functions.
    The functions will then show up in the portal just like the consumption plan.