Azure / azure-functions-docker

This repo contains the base Docker images for working with azure functions
MIT License
267 stars 118 forks source link

Linux docker image ignores Azure Startup Command setting #240

Open metoule opened 4 years ago

metoule commented 4 years ago

On an Linux Azure web app (not Azure function), it's possible to customize the startup script with the Startup command setting (configuration blade):

image

That script is then called by the Linux web app docker file:

https://github.com/Azure-App-Service/ImageBuilder/blob/master/GenerateDockerFiles/dotnetcore/debian-9/init_container.sh#L44

Here, the docker file doesn't seem to call that user command script:

https://github.com/Azure/azure-functions-docker/blob/master/host/3.0/buster/amd64/dotnet/start.sh

Is there a way to configure this setting for a Linux Azure function app?

horihiro commented 3 years ago

As far as I investigated, the specified command is passed to docker run.

image

image

And the command is passed to /azure-functions-host/start.sh as an argument.

image

But /azure-functions-host/start.sh doesn't handle any arguments inside it. For example, this file https://github.com/Azure/azure-functions-docker/blob/dev/host/3.0/buster/amd64/dotnet/dotnet-inproc/start.sh

This seems the reason why Startup Command is ignored.

@pragnagopa Could you please take a look this or assign the right person?

balag0 commented 3 years ago

Startup commands are not supported on functions images. The way to achieve this is to build a custom image that has the right start up command builtin.

horihiro commented 3 years ago

Thank you @balag0 ! I understand that the startup command cannot be used for Function App. Now we can see the startup command setting in Configuration blade for a Function App hosted by Linux App Service Plan. It should be removed.