dockerazure-functionsazure-container-instancesazure-container-registryazure-container-apps

Access docker container running on Azure Function App


I deploy a containerized python function on Azure using the official Microsoft guide.

The application is running and I am able to call my function (it's an http trigger function), but I don't know how to connect to the docker container it is running. If I use the Kudu console from the Azure portal on the Function App service, the docker command is not available and I can't see any file in the /home/site/wwwroot

If I go to the LogStream from Kudu, I can see some docker commands like

Pull Image successful, Time taken: 1 Seconds
2024-08-07T15:15:50.990Z INFO  - Starting container for site
2024-08-07T15:15:50.991Z INFO  - docker run -d --expose=80 --name ** -e WEBSITE_USE_DIAGNOSTIC_SERVER=false -e DOCKER_CUSTOM_IMAGE_NAME=** -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=** -e WEBSITE_AUTH_ENABLED=False -e PORT=80 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=** -e WEBSITE_INSTANCE_ID=**

But nothing else. Does anyone know where exactly is my container running and how can I access its logs and connect to it to inspect files?


Solution

  • When you create a Container App Environment function, the Container Apps environment creates a Resource Group with same name as environment, inside that Resource Group your container app will be created.

    If you want to use console of the container you need to open container and select Console you will get option to choose startup command to use the console.