azure-cli: Crash when running az keyvault list using a managed identity

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az keyvault list

Errors:

get_token() takes 1 positional argument but 2 were given
Traceback (most recent call last):
python3.6/site-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())
...
    response = self.next.send(request)
azure/core/pipeline/_base.py, ln 69, in send
    _await_result(self._policy.on_request, request)
azure/core/pipeline/_tools.py, ln 29, in await_result
    result = func(*args, **kwargs)
core/pipeline/policies/_authentication.py, ln 93, in on_request
    self._token = self._credential.get_token(*self._scopes)
TypeError: get_token() takes 1 positional argument but 2 were given

To Reproduce:

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

  • Assign a system managed identity to a VM
  • Give it access to a key vault
  • on the VM, log into az cli using az login --identity
  • az keyvault list tsv --query '[].name'

Expected Behavior

Environment Summary

Linux-5.3.0-1035-azure-x86_64-with-debian-buster-sid
Python 3.6.10
Installer: DEB

azure-cli 2.11.0

Additional Context

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 15 (9 by maintainers)

Most upvoted comments

please try with edge build https://github.com/Azure/azure-cli#edge-builds now and official release will be available on 9/22

I checked on our RHEL7 VMs in Azure. I’m getting the same exception with get_token arguments from 2.11.0 installed via RPM from the https://packages.microsoft.com/yumrepos/azure-cli repo. 2.10.1 (previous to 2.11 in the repository) and earlier versions installed via RPM work as expected (they return the keyvault data).

The simplest command is “az keyvault list”, we use it with the --query argument and -g, but that shouldn’t matter. The Login was done with a managed identity assigned to the VMSS (az login -i).