Building image by using ACR tasks does not work.

Arif Mohammed 0 Reputation points
2025-12-22T04:32:42.1733333+00:00
I am following MS Learn documentation to prepare for AZ-204 exam and I cannot build the image by using ACR tasks, same issue exists in pay as you go subscription. Following command fails : "az acr build --image sample/hello-world:v1 --registry ngraptortest --file Dockerfile ."

Error:


(TasksOperationsNotAllowed) ACR Tasks requests for the registry myregistryname and <subscription id> 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 myregistryname and <subscription id> are not permitted. Please file an Azure support request at http://aka.ms/azuresupport for assistance.
Target: request




Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shraddha Pandey 565 Reputation points Microsoft External Staff Moderator
    2025-12-22T08:20:22.6833333+00:00

    Hey Arif Mohammed,

    It sounds like you're running into an issue with building images using ACR Tasks, and you're getting a "TasksOperationsNotAllowed" error. This can often be linked to permissions or configurations associated with your Azure Container Registry (ACR). Here’s what you can do to troubleshoot this issue:

    1. Check Permissions: Make sure your managed identity or Azure user account has the appropriate roles assigned to it. Specifically, check that you have the following roles:
      • Container Registry Contributor
      • Container Registry Transfer Pipeline Contributor
      You can find more details on role assignments here.
    2. Private Endpoint Configurations: If your ACR has a private endpoint enabled, you might need to allow ACR Tasks as trusted services. Check that your registry does not block this access. More information on enabling it can be found here.
    3. Verify Source Repository Configuration: Ensure that the command is referencing the correct context for your repository, and that it is configured properly.
    4. Network Configuration: Check if there are any conflicts in your Network Security Group (NSG) rules or other network settings that might be affecting access.
    5. Check Task Logs: You can list and analyze any failed task runs using:
      
         az acr task list-runs -r <registry-name> -n <task-name> --run-status Failed --top 10
      
      
      Investigate the logs for any specific errors that could give more insight.
    6. Health Check: You can also run a health check on your ACR to see if it's functioning correctly:
      
         az acr check-health --name <registry-name> --ignore-errors --yes
      
      

    If you’ve gone through these steps and the issue persists, please let me know if you have access to the Azure portal logs or need assistance interpreting them.

    Follow-Up Questions:

    1. Have you verified if your Azure user has the necessary permissions for the ACR?
    2. Is your ACR using a private endpoint, and if so, have you configured it to allow ACR Tasks as a trusted service?
    3. Can you provide additional context about the Dockerfile or the specific project you’re working with?
    4. Have you checked for any relevant network configurations that could be impacting access?
    5. Could you share the output from any task log runs that might provide insight into the error?

    Let me know how it goes! Hope this helps!

    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.