0
votes

I try to use Azure pipelines for ci and cd.

1- My application image is built and pushed to azure container registry.

2- Release pipeline try to pull image from ACR it gets error. Logs from container settings:

INFO  - Pulling image: registryname/repo:latest
ERROR - DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"Get https://registry-1.docker.io/v2/registryname/repo/manifests/latest: unauthorized: incorrect username or password"}

ERROR - Pulling docker image registryname/repo:latest failed:
INFO  - Pulling image from Docker hub: registryname/repo:latest
ERROR - DockerApiException: Docker API responded with status code=NotFound, response={"message":"pull access denied for registryname/repo, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"}

ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
INFO  - Stopping site appname because it failed during startup.

Ss from configuration: enter image description here

Thanks for your help.

1
you just need to pass the valid container registry and the image nameSajeetharan
I think my container registry is valid and image name is also right. Why did you think they are invalid?dcy
Because the error message indicates thatSajeetharan
I checked the credentials but it seems right however when I try to login from cmd like docker login registryName, I get unauthorized: authentication required.dcy
You need to create a service connection from azure DevOps or use the cli in order to authenticate with acrAmit Baranes

1 Answers

0
votes

When you use the ACR to store the image and want to deploy the images in it to Azure Web App, you need to set the image name as ACRName.azurecr.io/image:tag, not just the image name and tag. And set the environment variables like:

DOCKER_REGISTRY_SERVER_USERNAME - The username for the ACR server. DOCKER_REGISTRY_SERVER_URL - The full URL to the ACR server. (For example, https://my-server.azurecr.io.) DOCKER_REGISTRY_SERVER_PASSWORD - The password for the ACR server.

And the credential should have enough permissions. When all things are OK, the container logs will look like this:

enter image description here