Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API version 2020-04-01-preview does not have operation group 'role_assignments' #16498

Closed
3vi1 opened this issue Jan 12, 2021 · 4 comments
Closed

Comments

@3vi1
Copy link

3vi1 commented Jan 12, 2021

The following occurs when trying to display the assignment list from the 'az role assignment' on Linux. The same command, runs without error from the same version of az in the cloud shell, with the same core and telemetry versions.

Command Name
az role assignment list

Errors:

API version 2020-04-01-preview does not have operation group 'role_assignments'
Traceback (most recent call last):
python3/dist-packages/knack/cli.py, ln 215, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 659, in execute
    raise ex
cli/core/commands/__init__.py, ln 722, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 715, in _run_job
    six.reraise(*sys.exc_info())
...
cli/command_modules/role/custom.py, ln 197, in list_role_assignments
    assignments_client = factory.role_assignments
azure/mgmt/authorization/_authorization_management_client.py, ln 196, in role_assignments
    raise ValueError("API version {} does not have operation group 'role_assignments'".format(api_version))
ValueError: API version 2020-04-01-preview does not have operation group 'role_assignments'

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 role assignment list --all

Expected Behavior

Environment Summary

Linux-5.8.0-36-generic-x86_64-with-glibc2.32
Python 3.9.1
Installer: PIP

azure-cli 2.17.1

Extensions:
azure-devops 0.19.0

Additional Context

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 12, 2021
@yonzhan yonzhan added the RBAC az role label Jan 12, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jan 12, 2021
@yonzhan yonzhan removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Jan 12, 2021
@yonzhan yonzhan added this to the S182 milestone Jan 12, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 12, 2021

az role

@3vi1
Copy link
Author

3vi1 commented Jan 12, 2021

This appears to be similar to #13827. Backleveling to azure-cli 2.16 worked as a workaround. The same command works fine from that version.

@yonzhan yonzhan modified the milestones: S182, S183 Feb 6, 2021
@yonzhan yonzhan modified the milestones: S183 - For Ignite, S184 Feb 26, 2021
@yonzhan yonzhan modified the milestones: S184, S185 Mar 14, 2021
@yonzhan yonzhan modified the milestones: S185, S186 Apr 2, 2021
@yonzhan yonzhan modified the milestones: S186, S187 Apr 25, 2021
@jiasli
Copy link
Member

jiasli commented May 10, 2021

This issue is not the same as #13827 because the error Unsupported API version '2020-04-01' for Network Resource in #13827 is returned by the service, while this error ValueError: API version 2020-04-01-preview does not have operation group 'role_assignments' is purely a client-side error.

As you installed Azure CLI via pip, please make sure azure-mgmt-authorization is installed correctly as Azure CLI requires:

'azure-mgmt-authorization~=0.61.0',

TL; DR: This SDK is not merged to the master branch of https://github.com/Azure/azure-sdk-for-python, so you won't find the source code there: https://github.com/Azure/azure-sdk-for-python/blob/2383277a260ac100593c15a3326c44dd45440824/sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization

@jiasli
Copy link
Member

jiasli commented Oct 16, 2023

pip is not a recommended way of installing Azure CLI. We recommend installing official Azure CLI packages as documented by https://learn.microsoft.com/en-us/cli/azure/install-azure-cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants