question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az acr login failed

See original GitHub issue

@djyou The login command failed in cmd:

> az acr login
Incorrect function.

Here is the configuration of default values:

> az configure

Welcome to the Azure CLI! This command will guide you through logging in and setting some default values.

Your settings can be found at C:\Users\shizh\.azure\config
Your current configuration is as follows:

[cloud]
name = AzureCloud

[core]
first_run = yes

[defaults]
group = shizhacrg
acr = shizhacr

Other commands seem working properly:

> az acr list
[
  {
    "adminUserEnabled": false,
    "creationDate": "2017-10-18T09:16:15.114582+00:00",
    "id": "/subscriptions/dfb63c8c-7c89-4ef8-af13-75c1d873c895/resourceGroups/shizhacrg/providers/Microsoft.ContainerRegistry/registries/shizhacr",
    "location": "eastus",
    "loginServer": "shizhacr.azurecr.io",
    "name": "shizhacr",
    "provisioningState": "Succeeded",
    "resourceGroup": "shizhacrg",
    "sku": {
      "name": "Managed_Standard",
      "tier": "Managed"
    },
    "storageAccount": null,
    "tags": {},
    "type": "Microsoft.ContainerRegistry/registries"
  }
]
> az acr show
{
  "adminUserEnabled": false,
  "creationDate": "2017-10-18T09:16:15.114582+00:00",
  "id": "/subscriptions/dfb63c8c-7c89-4ef8-af13-75c1d873c895/resourceGroups/shizhacrg/providers/Microsoft.ContainerRegistry/registries/shizhacr",
  "location": "eastus",
  "loginServer": "shizhacr.azurecr.io",
  "name": "shizhacr",
  "provisioningState": "Succeeded",
  "resourceGroup": "shizhacrg",
  "sku": {
    "name": "Managed_Standard",
    "tier": "Managed"
  },
  "storageAccount": null,
  "tags": {},
  "type": "Microsoft.ContainerRegistry/registries"
}
> az acr show-usage
{
  "value": [
    {
      "currentValue": 0,
      "limit": 107374182400,
      "name": "Size",
      "unit": "Bytes"
    },
    {
      "currentValue": 0,
      "limit": 10,
      "name": "Webhooks",
      "unit": "Count"
    }
  ]
}
> az acr repository list
[]

After enabling Admin user:

> docker login shizhacr.azurecr.io
Username (shizhacr): shizhacr
Password:
Login Succeeded

but still

> az acr login
Incorrect function.

Environment summary

Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

> az --version
azure-cli (2.0.19)

acr (2.0.13)
acs (2.0.17)
appservice (0.1.18)
backup (1.0.1)
batch (3.1.5)
batchai (0.1.1)
billing (0.1.5)
cdn (0.0.9)
cloud (2.0.8)
cognitiveservices (0.1.8)
command-modules-nspkg (2.0.1)
component (2.0.7)
configure (2.0.11)
consumption (0.1.5)
container (0.1.11)
core (2.0.18)
cosmosdb (0.1.13)
dla (0.0.12)
dls (0.0.15)
eventgrid (0.1.4)
extension (0.0.4)
feedback (2.0.6)
find (0.2.7)
interactive (0.3.10)
iot (0.1.12)
keyvault (2.0.12)
lab (0.0.11)
monitor (0.0.10)
network (2.0.16)
nspkg (3.0.1)
profile (2.0.14)
rdbms (0.0.7)
redis (0.2.9)
resource (2.0.16)
role (2.0.13)
servicefabric (0.0.4)
sql (2.0.13)
storage (2.0.17)
vm (2.0.16)

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\shizh\.azure\cliextensions'

Python (Windows) 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
Dennis-D-Allencommented, Jan 5, 2018

PowerShell console works for me too. I was getting this error with ConEmu, thanks @cjeffers !

4reactions
cjefferscommented, Dec 15, 2017

executing in a regular powershell console (not ConEmu) worked for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot login to registry - Azure Container Registry
Unable to access a registry using az acr login and you receive error CONNECTIVITY_REFRESH_TOKEN_ERROR. Access to registry was denied. Response ...
Read more >
Push Docker Image task to ACR fails in Azure "unauthorized
Next, you can log in now to Azure Container Registry using the command: az acr login --name my-container-registry. Tag your docker image
Read more >
Docker Push Container to Azure ACR "unauthorized
docker build -t arcticacr.azurecr.io/sftp01/sftptest:0.02 -f Dockerfile . $ az login $ az acr login --name arcticacr $ docker push ...
Read more >
Unable To Get AAD Authorization Token With Message
To Fix this issue, Try to run sudo az login first and then try sudo az acr login –name acr001. You should get...
Read more >
Docker build fails with no auth after docker login succeeds
However in docker build it still fails with no basicu auth ... Besides, what if you use Azure CLI to login with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found