1

When trying to invoke an Azure Function wrapped in a Docker container all I get is an internal server error 500.

Here is what I did to create my container:

mkdir docker-function
cd docker function
func init --docker
func new (I then selected Http Trigger)
docker build -t hello-docker-function:latest .
docker tag hello-docker-function myaccount/hello-docker-function
docker push myaccount/hello-docker-function:latest

I then created an Azure Function in US Central, selected Docker (on Linux).
I then clicked Configure container settings.
As Image source I selected Docker Hub
As Repository Access I selected Public
As Image I specified myaccount/hello-docker-function
I did not specify any kind of Startup file

When invoking the function (via its URL or via the Run button) all I get is an internal server error 500.

I also tried with the Azure Container Registry - same result.

Any idea?

AnNaSF
  • 165
  • 1
  • 10
  • Should you specify "myaccount/hello-docker-function:latest" but not "myaccount/hello-docker-function" in "Image" box ? Missing tag(:latest) ? – Hury Shen Nov 18 '19 at 08:26

1 Answers1

1

I've tried to reproduce the problem, and also received a 500 response code.

As it seems the problem was related to 2 things: the authentication which must be either configured or disabled and the worker runtime which must be specified.

So 2 things that made it work for me:

  1. Setting the authLevel to anonymous in function.json. If you want to enable the authentication, this question might be helpful: Http Trigger Azure Function in Docker with non anonymous authLevel

  2. In the Azure Web UI FunctionApp configuration page set the FUNCTIONS_WORKER_RUNTIME to node (I used nodeJS).

vvraskin
  • 368
  • 6
  • 13
  • Thanks, I set the `authLevel` but indeed forgot to specify the `FUNCTIONS_WORKER_RUNTIME`- thanks! – AnNaSF Nov 18 '19 at 10:42