0
votes

I'm trying to deploy the Hello World Azure Function using a Docker image by following this doc to the letter. The only difference is I'm using WestUS for the region, and uploaded my image to Azure Container Registry: <myname>.azurecr.io/<imagename>

I deploy using

az functionapp create --name <myppname> --storage-account <mystorageaccount> --resource-group <myresourcegroup> --plan <mypremiumplan> --deployment-container-image-name <myname>.azurecr.io/<imagename>

However I get this:

Error:

Azure Functions Runtime is unreachable. Click here for details on storage configuration.

I looked through the troubleshooting docs and none of the cases seem relevant. What could be the issue?

1
It seems the region you want to deploy your function is different from the region of the storage. - Hury Shen

1 Answers

2
votes

For your issue, the region is not the problem. The possible reason is that the custom image does not pull down to your function plan, because your plan does not have the permission to pull it.

The Azure Container Registry is a private registry. You can see the Note like this:

If your container is private, you would have to set the following application settings as well

  • DOCKER_REGISTRY_SERVER_USERNAME
  • DOCKER_REGISTRY_SERVER_PASSWORD

You will have to stop and then start your function app for these values to be picked up

It's the reason and also the solution.

And another solution is that you can use the parameters

  • --docker-registry-server-user
  • --docker-registry-server-password

in your CLI command to set a credential for your ACR. It's the new feature refer to the latest CLI version. For more details, see az functionapp create.