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:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Installation issue
OK Thank you