1

I'm deploying an App Service in Azure that has a related container image. I created both the App Service and the image with the Owner user (the only one I have). Still, when I start the App Service I get an error that the "image is not authorized" (see below). How to fix this problem?

The image is created and stored in the registry with no issues.

 2021-07-26T15:03:31.157Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
2021-07-26T15:03:37.000Z INFO - Stopping site sofiana because it failed during startup.
2021-07-26T15:06:32.588Z INFO - Starting container for site
2021-07-26T15:06:32.590Z INFO - docker run -d -p 8081:8081 --name sofiana_1_e0d93acf_msiProxy -e PORT=8081 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=sofiana.azurewebsites.net -e WEBSITE_INSTANCE_ID=4c49e5ee1c9d26e3d207f81f51be02bb2c4d67839b9f7b25c24fceef7fd9b44e appsvc/msitokenservice:2007200210

2021-07-26T15:06:32.592Z INFO - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2021-07-26T15:06:43.616Z INFO - Pulling image from Docker hub: sofacr.azurecr.io/nginx-visualbank:latest
2021-07-26T15:06:43.697Z ERROR - DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"Get https://sofacr.azurecr.io/v2/nginx-visualbank/manifests/latest: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information."}

2021-07-26T15:06:43.700Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
2021-07-26T15:06:49.634Z INFO - Stopping site sofiana because it failed during startup.
ps0604
  • 1,227
  • 23
  • 133
  • 330

1 Answers1

0

You need to auth against the repository

az acr login --name sofacr --subscription AZURE-SUB

  • This is how I log in when creating the image: `az acr login --name sofacr --expose-token docker login sofacr.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password `, is not against the repository? – ps0604 Jul 26 '21 at 15:51
  • Yes, after you do the `az acr login` command you should be able to pull the image and this line should work `Pulling image from Docker hub: sofacr.azurecr.io/nginx-visualbank:latest` – Fabricio Bedeschi Jul 26 '21 at 15:56
  • The problem happens when the app service starts not when I create the image. I can pull it with no problem – ps0604 Jul 26 '21 at 16:55
  • 1
    @ps0604 having the same issue. Did you manage to solve it? – eoe Sep 06 '22 at 07:56