How do I correct TasksOperationsNotAllowed?

KennyC 0 Reputation points
2024-05-02T14:28:17.05+00:00

I am trying to get through this curriculum:
https://learn.microsoft.com/en-us/training/modules/build-and-store-container-images/3-build-container-image

I followed the directions exactly but am getting an error type of 'TasksOperationsNotAllowed' and not sure how to fix it.

At this point in the module I am on unit 3 of 6 and I've created the docker file, saved, closed and now trying to "Build the container image from the Dockerfile using the az acr build command."

So I copied the code provided:

az acr build --registry $ACR_NAME --image helloacrtasks:v1 .

And I get an error that looks like an auth issue:

kenny [ ~ ]$ az acr build --registry $ACR_NAME --image helloacrtasks:v1 .
Packing source code into tar to upload...
Uploading archived source code from '/tmp/build_archive_35622d6b26994bb192033339f9f20f81.tar.gz'...
Sending context (18.106 KiB) to registry: containerregistrypracticekenny2208...
(TasksOperationsNotAllowed) ACR Tasks requests for the registry containerregistrypracticekenny2208 and 33ad3be1-7611-4cb4-8d47-db49e653a4a8 are not permitted. Please file an Azure support request at http://aka.ms/azuresupport for assistance.
Code: TasksOperationsNotAllowed
Message: ACR Tasks requests for the registry containerregistrypracticekenny2208 and 33ad3be1-7611-4cb4-8d47-db49e653a4a8 are not permitted. Please file an Azure support request at http://aka.ms/azuresupport for assistance.
Target: request

I tried searching online and tried running the command to check health, but got this result:

kenny [ ~ ]$ az acr check-health
Environment checks are not supported in Azure Cloud Shell.
Registry name must be provided to check connectivity.
Please refer to https://aka.ms/acr/health-check for more information.
Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,048 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RDash 1,250 Reputation points Microsoft Vendor
    2024-05-03T10:01:15.9733333+00:00

    Hi KennyC,

    We apologize for any inconvenience you may have experienced issue while trying the exercise of Microsoft Learn path.

    When you use this command on Azure Cloud Shell:

    az acr build --registry $REGISTRYNAME --image expressimage
    you get an error:

    (TasksOperationsNotAllowed) ACR Tasks requests for the registry <containerRegistryName> and <password> are not permitted.

    Customer shared -

    Here are the few steps for using Docker CLI commands :

    1.I discovered a workaround using Docker CLI commands.

    2.Login to the ACR using az acr login -n $ACRNAME -p <password>

    Tag the image first- docker tag <image name>:latest <ACR registry name>.azurecr.io/<image name>

    3.Push the image to ACR from docker - docker push <ACR registry name>.azurecr.io/<image name>

    The images will now appear in your ACR - az acr repository list --name $ACRNAME --output table

    Here is the referral link:
    https://stackoverflow.com/questions/77982084/how-to-fix-tasksoperationsnotallowed-acr-tasks-requests-for-the-registry-cont#:~:text=The%20error%20message%20%22TasksOperationsNotAllowed%22%20occurs%20when%20ACR%20Tasks,has%20the%20required%20permissions%20to%20perform%20ACR%20tasks.
    Please let us know if they were helpful and don't hesitate to reach out to us if you face any issue.

    Thank you.

    0 comments No comments