Answers: <p>The image name needs to be in all lowercase.  You can't just change the push command to lowercase.</p>
  <pre><code>$ docker build -t arcticacr.azurecr.io/sftp01/sftptest:0.02 -f Dockerfile .
  $ az login
  $ az acr login --name arcticacr
  $ docker push arcticacr.azurecr.io/sftp01/sftptest:0.02
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2022-07-17T20:53:21.530Z
Answers: 2023-06-01T15:58:09.597Z
Answers: 2023-06-01T15:58:09.597Z
Answers: Adam Winter
Body: <p>What is going on here?  This should work.</p>
  <pre><code>$ az logout
  $ az login
  To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code FW....C to authenticate.
  [
    {
      &quot;cloudName&quot;: &quot;AzureCloud&quot;,
      &quot;homeTenantId&quot;: &quot;[redacted]&quot;,
      &quot;id&quot;: &quot;[redacted]&quot;,
      &quot;isDefault&quot;: true,
      &quot;managedByTenants&quot;: [],
      &quot;name&quot;: &quot;Azure subscription 1&quot;,
      &quot;state&quot;: &quot;Enabled&quot;,
      &quot;tenantId&quot;: &quot;[redacted]&quot;,
      &quot;user&quot;: {
        &quot;name&quot;: &quot;[redacted]&quot;,
        &quot;type&quot;: &quot;user&quot;
      }
    }
  ]
  $ az account set -s [subscription id redacted]
  $ az acr login --name arcticacr
  Login Succeeded
  $ docker push ArcticaCR.azurecr.io/sftp01/sftptest:0.02
  The push refers to a repository [ArcticaCR.azurecr.io/sftp01/sftptest]
  b152ea134f5f: Preparing 
  d799cb5f12bf: Preparing 
  6b4e8c931236: Preparing 
  6f4c91ca60bd: Preparing 
  86eecfa8066e: Preparing 
  unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
  </code></pre>
  <p>I'm logged in as the owner of this registry (per IAM).  I should be authorized to do anything.  Admin user is enabled under Access keys, even though I'm not using those.</p>
  
Tags: <docker><azure-devops><azure-pipelines>
Title: Docker Push Container to Azure ACR "unauthorized: authentication required"
UserDisplayName: Adam Winter
ThreadText: # Docker Push Container to Azure ACR "unauthorized: authentication required"
  
  (Asked by: username_0 on 2022-07-17)
  
  What is going on here? This should work.
  
  ```
  $ az logout
  $ az login
  To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code FW....C to authenticate.
  [
    {
      "cloudName": "AzureCloud",
      "homeTenantId": "[redacted]",
      "id": "[redacted]",
      "isDefault": true,
      "managedByTenants": [],
      "name": "Azure subscription 1",
      "state": "Enabled",
      "tenantId": "[redacted]",
      "user": {
        "name": "[redacted]",
        "type": "user"
      }
    }
  ]
  $ az account set -s [subscription id redacted]
  $ az acr login --name arcticacr
  Login Succeeded
  $ docker push ArcticaCR.azurecr.io/sftp01/sftptest:0.02
  The push refers to a repository [ArcticaCR.azurecr.io/sftp01/sftptest]
  b152ea134f5f: Preparing 
  d799cb5f12bf: Preparing 
  6b4e8c931236: Preparing 
  6f4c91ca60bd: Preparing 
  86eecfa8066e: Preparing 
  unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
  
  ```
  
  I'm logged in as the owner of this registry (per IAM). I should be authorized to do anything. Admin user is enabled under Access keys, even though I'm not using those.
  
  **Tags:** docker, azure-devops, azure-pipelines
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-07-17. Score: 1
  
  The image name needs to be in all lowercase. You can't just change the push command to lowercase.
  
  ```
  $ docker build -t arcticacr.azurecr.io/sftp01/sftptest:0.02 -f Dockerfile .
  $ az login
  $ az acr login --name arcticacr
  $ docker push arcticacr.azurecr.io/sftp01/sftptest:0.02
  
  ```
  
  
  ---
  
  