Forum Discussion

charlieteague's avatar
charlieteague
Copper Contributor
Feb 03, 2024

YML Docker@2 Push --##[error]denied: requested access to the resource is denied

Using Docker@2 in the yml file to Push a build, results in the following error:

 

##[error]denied: requested access to the resource is denied

 

But when changing both of the tasks below to mailto:Docker@1, the push works.  What must be done to make mailto:Docker@2 work?

  - task: Docker@1
    displayName: Build an image
    inputs:
      command: build
      repository: TicketManagement
      azureSubscriptionEndpoint: [Redated]
      azureContainerRegistry: [Redated]
      dockerFile: Dockerfile
      imageName: $(Build.BuildId)
      arguments: '--build-arg PROJECT=$(System.TeamProject) --build-arg REPOSITORY=$(Build.Repository.Name) --build-arg INSTANCEURL=$(System.CollectionUri) --build-arg PULLREQUEST_ID=$(System.PullRequest.PullRequestId) --build-arg TARGET_BRANCH_NAME=$(System.PullRequest.targetBranchName) --build-arg SOURCE_BRANCH_NAME=$(System.PullRequest.SourceBranch)'
  - task: Docker@1
    displayName: Push an image
    inputs:
      command: push
      repository: TicketManagement
      azureSubscriptionEndpoint: [Redated]
      azureContainerRegistry: [Redated]
      action: Push an image
      imageName: $(Build.BuildId)
      tags: $(Build.BuildId)

1 Reply

  • charlieteague's avatar
    charlieteague
    Copper Contributor
    In Docker@1 the resource is azureSubscriptionEndpoint and my value in azureContainerRegistry, satisfied authentication, Is there a different parameter that I need for Docker@2?