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 login fails unexpectedly "NotImplementedError: APIVersion 2019-06-01 is not available"

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

az login fails unexpectedly, in the same environment and docker container where it always was working, very strange. 100% reproducible, fails all the time.

Command Name az login

Errors:

APIVersion 2019-06-01 is not available
Traceback (most recent call last):
python3.6/dist-packages/knack/cli.py, ln 215, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 654, in execute
    raise ex
cli/core/commands/__init__.py, ln 718, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 711, in _run_job
    six.reraise(*sys.exc_info())
...
azure/cli/core/_profile.py, ln 865, in find_from_service_principal_id
    result = self._find_using_specific_tenant(tenant, token_entry[_ACCESS_TOKEN])
azure/cli/core/_profile.py, ln 960, in _find_using_specific_tenant
    subscriptions = client.subscriptions.list()
mgmt/resource/subscriptions/subscription_client.py, ln 132, in subscriptions
    raise NotImplementedError("APIVersion {} is not available".format(api_version))
NotImplementedError: APIVersion 2019-06-01 is not available

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here…
  • az login --service-principal --username {} --password {} --tenant {} --debug

Expected Behavior

Login to work, was always working

Environment Summary

Linux-3.10.0-1062.12.1.el7.x86_64-x86_64-with-Ubuntu-18.04-bionic
Python 3.6.9
Installer: PIP

azure-cli 2.7.0 *

Additional Context

Getting error, but it worked just recently, what might cause this?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Dmitry1987commented, Jul 24, 2020

got it 😃)) I referred to the “azure” python package. because the error appears when I upgrade from 4.x to 5. but it works now, so it’s ok. And thank you for the information, it’s appreciated!

0reactions
jiaslicommented, Jul 24, 2020

Hi @Dmitry1987, I am glad the issue is solved.

However, the current Azure CLI version is 2.9.1. We haven’t reached 4.0 or 5.0 yet. 😉

https://github.com/Azure/azure-cli/blob/b01fbe373a059aa6c746e6e067aac4ac77323211/src/azure-cli-core/setup.py#L20

I tested with both formats of --username and they all work correctly:

> az login --service-principal --username http://cliapp --password xxx --tenant 54826b22-38d6-4fb2-bad9-b7b93a3e9c5a
[
  {
    "cloudName": "AzureCloud",
    "id": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a",
    ...
    
> az login --service-principal --username 45ee948b-9214-4d23-9a52-1a641c7c8009 --password xxx --tenant 54826b22-38d6-4fb2-bad9-b7b93a3e9c5a
[
  {
    "cloudName": "AzureCloud",
    "id": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a",
    ...

Per the debug log, the error is irrelevant to login but to listing subscriptions:

  File "/usr/local/lib/python3.6/dist-packages/azure/cli/core/_profile.py", line 960, in _find_using_specific_tenant
    subscriptions = client.subscriptions.list()
  File "/usr/local/lib/python3.6/dist-packages/azure/mgmt/resource/subscriptions/subscription_client.py", line 132, in subscriptions
    raise NotImplementedError("APIVersion {} is not available".format(api_version))
NotImplementedError: APIVersion 2019-06-01 is not available

I would still recommend checking the installation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

az login fails with "NotImplementedError: APIVersion 2019-06 ...
Describe the bug Command Name az login Errors: APIVersion 2019-06-01 is not available Traceback (most recent call last): ...
Read more >
az acr build command fails "NotImplementedError: APIVersion ...
The command fails with the following error: APIVersion 2019-06-01-preview is not available Traceback (most recent call last): File ...
Read more >
Terraform with AZ suddenly stopped working - Microsoft Q&A
Working with Terraform and AZ Cli. It was all working fine, but suddenly today Terraform gives me following error.
Read more >
azure-cli: az webapp commands failing: API version 2022-03 ...
az webapp list. The command failed with an unexpected error. Here is the traceback: API version 2022-03-01 does not have operation group 'web_apps'...
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