0
votes

I am following this article. I have an Azure container registry as shown below image and I have defined the task as below.

az acr task create \
--name krushnaTask \
--registry krushna \
--cmd python-hello \
--schedule "1 10 * * *" \
--context /dev/null

When the Azure is running the task it is giving below error :

2020/06/02 11:02:03 Alias support enabled for version >= 1.1.0, please see https://aka.ms/acr/tasks/task-aliases for more information.
2020/06/02 11:02:03 Creating Docker network: acb_default_network, driver: 'bridge'
2020/06/02 11:02:03 Successfully set up Docker network: acb_default_network
2020/06/02 11:02:03 Setting up Docker configuration...
2020/06/02 11:02:04 Successfully set up Docker configuration
2020/06/02 11:02:04 Logging in to registry: krushna.azurecr.io
2020/06/02 11:02:05 Successfully logged into krushna.azurecr.io
2020/06/02 11:02:05 Executing step ID: acb_step_0. Timeout(sec): 3600, Working directory: '', Network: 'acb_default_network'
2020/06/02 11:02:05 Launching container with name: acb_step_0
Unable to find image 'python-hello:latest' locally
docker: Error response from daemon: pull access denied for python-hello, repository does not   exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
2020/06/02 11:02:05 Container failed during run: acb_step_0. No retries remaining.
failed to run step ID: acb_step_0: exit status 125

What can be done so the ACR task can access the docker image?

Azure ACR repo image Azure ACR task details

2
is the image exists in docker registry?Sajeetharan
Yes I can pull the image to my local system also using command like docker pull krushna.azurecr.io/python-hello:latestKrushna

2 Answers

2
votes

I'm pretty sure the problem is that you need to input the image as krushna.azurecr.io/python-hello:tag since the image is in your ACR. When you input the image as python-hello, it means it's a public docker image in Docker hub, so it caused the error because it cannot find the image in the Docker hub. Change the command like below and it will work well:

az acr task create \
--name krushnaTask \
--registry krushna \
--cmd krushna.azurecr.io/python-hello \
--schedule "1 10 * * *" \
--context /dev/null
0
votes

When creating ACR Tasks, you should provide a git-access-token if your registry has RBAC enabled

--git-access-token
The access token used to access the source control provider.

https://docs.microsoft.com/en-us/cli/azure/acr/task?view=azure-cli-latest#az-acr-task-create

you can create the access token from this DOC

https://docs.microsoft.com/en-us/azure/container-registry/container-registry-tutorial-quick-task#configure-registry-authentication