I want to build and push an image to a private ACR. Due to my environment I have troubles using tools like Docker. I've found that the Azure CLI has an option to build and push images (az acr build), which for me is the optimal solution as it is an Azure native tool. When I run the command the following error is returned:
fel@homelap:~$ az acr build --resource-group test_rg --image testing_image:1.0.0 --registry testacr --file Dockerfile .
Packing source code into tar to upload...
Uploading archived source code from '/tmp/build_archive_57ca72e53484451aab5eaa18df7eff3c.tar.gz'...
Sending context (126.159 MiB) to registry: testacr...
Queued a build with ID: cb4
Waiting for an agent...
2025/02/17 08:52:27 Downloading source code...
2025/02/17 08:52:29 Finished downloading source code
2025/02/17 08:52:30 Using acb_vol_35f4f194-c973-40cf-a4b3-3db226a6a953 as the home volume
2025/02/17 08:52:30 Setting up Docker configuration...
2025/02/17 08:52:30 Successfully set up Docker configuration
2025/02/17 08:52:30 Logging in to registry: testacr.azurecr.io
failed to login, ran out of retries: failed to set docker credentials: Error response from daemon: Get "/":
denied: client with IP '52.178.20.80' is not allowed access. Refer to grant access. CorrelationId: 79d8fbb8-0e42-4
dc8-9cf2-14153f3f6821
: exit status 1
Run ID: cb4 failed after 8s. Error: failed during run, err: exit status 1
Run failed
In the registry configuration I have marked the "Allow trusted Microsoft services to access this container registry":
I'm using the Azure CLI so I suppose this option is not useful for me (the trusted services are listed here: ).
I've tried to run the command against a public registry and it worked, so I assume it is not related with permissions (AcrPush).
To better understand what's happening behind, what does this command do? I've not found much info or documentation about this but, for what is returned in the command logs, seems that some code is executed in some agent in some network.
I want to build and push an image to a private ACR. Due to my environment I have troubles using tools like Docker. I've found that the Azure CLI has an option to build and push images (az acr build), which for me is the optimal solution as it is an Azure native tool. When I run the command the following error is returned:
fel@homelap:~$ az acr build --resource-group test_rg --image testing_image:1.0.0 --registry testacr --file Dockerfile .
Packing source code into tar to upload...
Uploading archived source code from '/tmp/build_archive_57ca72e53484451aab5eaa18df7eff3c.tar.gz'...
Sending context (126.159 MiB) to registry: testacr...
Queued a build with ID: cb4
Waiting for an agent...
2025/02/17 08:52:27 Downloading source code...
2025/02/17 08:52:29 Finished downloading source code
2025/02/17 08:52:30 Using acb_vol_35f4f194-c973-40cf-a4b3-3db226a6a953 as the home volume
2025/02/17 08:52:30 Setting up Docker configuration...
2025/02/17 08:52:30 Successfully set up Docker configuration
2025/02/17 08:52:30 Logging in to registry: testacr.azurecr.io
failed to login, ran out of retries: failed to set docker credentials: Error response from daemon: Get "https://testacr.azurecr.io/v2/":
denied: client with IP '52.178.20.80' is not allowed access. Refer https://aka.ms/acr/firewall to grant access. CorrelationId: 79d8fbb8-0e42-4
dc8-9cf2-14153f3f6821
: exit status 1
Run ID: cb4 failed after 8s. Error: failed during run, err: exit status 1
Run failed
In the registry configuration I have marked the "Allow trusted Microsoft services to access this container registry":
I'm using the Azure CLI so I suppose this option is not useful for me (the trusted services are listed here: https://learn.microsoft/en-us/azure/container-registry/allow-access-trusted-services#trusted-services).
I've tried to run the command against a public registry and it worked, so I assume it is not related with permissions (AcrPush).
To better understand what's happening behind, what does this command do? I've not found much info or documentation about this but, for what is returned in the command logs, seems that some code is executed in some agent in some network.
Share Improve this question edited Feb 17 at 9:32 Felipe asked Feb 17 at 9:21 FelipeFelipe 3392 gold badges6 silver badges17 bronze badges 1- This looks like a question for devops.stackexchange – tevemadar Commented Feb 17 at 10:02
1 Answer
Reset to default 0I would recommend to try to login first and than you can pull and push image
You can try to login with below command
az acr login -n mytestregistry --expose-token
It will ask for username and password. Enter user name as registry name for example "mytestregistry " and password from your container registry => setting => Access Key
I hope it helps. If it is somehow helpful, please accept my answer. Thank you