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 not working in compute instance but working on local desktop

See original GitHub issue

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug As a ML devops I would like to build custom docker images and push into ACR.

From the compute instance bash command line:

az login 
az acr login -name xxx - failed with error:
CLIInternalError: The command failed with an unexpected error. Here is the traceback:
APIVersion 2019-12-01-preview is not available
Traceback (most recent call last):
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/knack/cli.py", line 215, in invoke
    cmd_result = self.invocation.execute(args)
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 654, in execute
    raise ex
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 711, in _run_job
    six.reraise(*sys.exc_info())
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/six.py", line 703, in reraise
    raise value
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 688, in _run_job
    result = cmd_copy(params)
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 325, in __call__
    return self.handler(*args, **kwargs)
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 784, in default_command_handler
    return op(**command_args)
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/command_modules/acr/custom.py", line 236, in acr_login
    password=password)
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 417, in get_login_credentials
    is_login_context=True)
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 310, in _get_credentials
    registry, resource_group_name = get_registry_by_name(cli_ctx, registry_name)
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/command_modules/acr/_utils.py", line 107, in get_registry_by_name
    client = cf_acr_registries(cli_ctx)
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cli/command_modules/acr/_client_factory.py", line 19, in cf_acr_registries
    return get_acr_service_client(cli_ctx).registries
  File "/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/mgmt/containerregistry/container_registry_management_client.py", line 208, in registries
    raise NotImplementedError("APIVersion {} is not available".format(api_version))
NotImplementedError: APIVersion 2019-12-01-preview is not available

To troubleshoot: I try az acr --help and help message appears. So the acr module is installed. Then I try az acr list and it fails with similar error as above.

To Reproduce

az login az acr login --name xxx

az acr --help az acr list

Expected behavior

az login az acr login --name xxx Login Succeeded

Environment summary

Compute instance of type:

  Virtual machine size
   STANDARD_DS3_V2 (4 Cores, 14 GB RAM, 28 GB Disk)
   Processing Unit
   CPU - General purpose

Azure CLI version:

{
  "azure-cli": "2.13.0",
  "azure-cli-core": "2.13.0",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "azure-cli-ml": "1.15.0"
  }
}

Based on @fengzhou-msft hint here I have re-installed the azure cli using apt using this instruction: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash Install azure cli using apt Did not make a difference

Based on this issue I tried az acr login --name xxxx --subscription yyyy Encountered error

azureuser@mlcompute-herman:~/cloudfiles/code$ pip show azure-mgmt-containerregistry
Name: azure-mgmt-containerregistry
Version: 2.8.0
Summary: Microsoft Azure Container Registry Client Library for Python
Home-page: https://github.com/Azure/azure-sdk-for-python
Author: Microsoft Corporation
Author-email: azpysdkhelp@microsoft.com
License: MIT License
Location: /anaconda/envs/azureml_py36/lib/python3.6/site-packages
Requires: msrestazure, azure-common, msrest
Required-by: azureml-core, azure-cli

No errors encountered when I use azure cli downloaded into windows 10

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yugangw-msftcommented, Oct 22, 2020

Installation issue

0reactions
hermandrcommented, Nov 2, 2020

OK Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot login to registry - Azure Container Registry
This article helps you troubleshoot problems you might encounter when logging into an Azure container registry.
Read more >
Azure image instance: credential rejected - Stack Overflow
I have run the following command with every combination of user name and password I can think of, from my azure account to...
Read more >
Building and Running Container Images with ACR, ACI and ...
Now, from within this folder, we can build using the az acr build command, specifying the ACR instance to use with -r ,...
Read more >
Deploy existing .NET apps as Windows containers ...
NET MVC Project that helps nerds and computer people plan get-togethers. ... locally to ensure that the application is working fine.
Read more >
A look at ACR Tasks | The Code Attic - WordPress.com
After some major headaches with a Docker Desktop update causing a uninstall and reinstall, which resulted in all my local images being ...
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