Deploy from Azure DevOps: Azure App Service uses DockerHub when it should use Azure Registry

Mikiel Agutu 1 Reputation point
2021-02-16T11:28:16.653+00:00

Hello

I'm attempting to deploy a dockerized application to Azure App Service from Azure DevOps. I've created a Release Pipeline, and I've tried both the Azure Web App for Containers, and Azure App Service Deploy tasks. Both of them have the same problem.

The problem is this - I've configured the task to pull, and run a Docker image from my Azure Registry. However instead it tries to pull from DockerHub and fails.

In the task I specify the image name:

myapp.azurecr.io/myImage:latest

This clearly says to use 'azurecr.io', not DockerHub.

When I run the task it says success. Going into the resource in Azure, under Deployment Center, I look at the start of the log and see:

Pulling image: myapp.azurecr.io/myImage:latest

Which seems correct. A bit further down it says the container is 'initialized successfully and is ready to serve requests'.

However towards the end of the log it says:

*2021-02-16T10:01:51.351Z INFO - Pulling image from Docker hub: *****/myImage:latest*

Which is incorrect. When I try and hit the URL it doesn't work.

I've gone into Deployment Center and manually told it to use Azure registry too.

So my questions are:

  • Why does it pull from DockerHub at all?
  • Why does it try and pull from DockerHub after successfully deploying the correct image?

Thanks

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,019 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 27,271 Reputation points Microsoft Employee
    2021-02-17T21:36:30.793+00:00

    @Mikiel Agutu ,

    When you say, "However instead it tries to pull from DockerHub and fails." Could you share the exact error message you receive?

    For private registry, you may try the full > format as https:// followed by the fully qualified domain name of the registry.
    Invalid image tag. Latest tag doesn't exist by default. Change the tag to the one built by DevOps build pipeline.

    Also, review the Application Setting to allow App Service able to pull image from Azure Container Registry.

    Just to highlight, yes, if you use a private registry and point to an Azure Container Registry. All the docker images are pulled from the registry docker.io in default. For the private registry, you must set the registry name before the image name.

    Kindy navigate to Resource Explorer (https://resources.azure.com/)-> ( + ) on the Config -> Web -> Read/Write -> Navigate to the specific WebApp and review the 'LinuxFXversion' property.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.