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

azure cli error #27540

Closed
IkiruBoy opened this issue Oct 7, 2023 · 7 comments
Closed

azure cli error #27540

IkiruBoy opened this issue Oct 7, 2023 · 7 comments
Assignees
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Graph az ad question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Upgrade az upgrade
Milestone

Comments

@IkiruBoy
Copy link

IkiruBoy commented Oct 7, 2023

Describe the bug

when i try to create service account from cli i got error

$az ad sp create-for-rbac --role Contributor --scopes /subscriptions/

Related command

$az ad sp create-for-rbac --role Contributor --scopes /subscriptions/

Errors

API version 2020-04-01-preview does not have operation group 'role_assignments'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 659, in execute
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 722, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 714, in _run_job
return cmd_copy.exception_handler(ex)
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/commands.py", line 69, in graph_err_handler
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 693, in _run_job
result = cmd_copy(params)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 330, in call
return self.handler(*args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 786, in default_command_handler
return op(**command_args)
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/custom.py", line 1414, in create_service_principal_for_rbac
role_client = _auth_client_factory(cmd.cli_ctx).role_assignments
File "/usr/lib/python3/dist-packages/azure/mgmt/authorization/_authorization_management_client.py", line 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 open an issue, please run: 'az feedback'

Issue script & Debug output

cli.knack.cli: Command arguments: ['ad', 'sp', 'create-for-rbac', '--debug', '--role', 'Contributor', '--scopes', '/subscriptions/iXXX-XXX-XXX-XXX-XXX']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f9ae33fb790>, <function OutputProducer.on_global_arguments at 0x7f9ae3307af0>, <function CLIQuery.on_global_arguments at 0x7f9ae32b0040>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'ad': ['azure.cli.command_modules.role']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: role 0.016 17 61
cli.azure.cli.core: Total (1) 0.016 17 61
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: Loaded 17 groups, 61 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : ad sp create-for-rbac
cli.azure.cli.core: Command table: ad sp create
cli.azure.cli.core: remaining : for-rbac
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f9ae2b7d700>]
az_command_data_logger: command args: ad sp create-for-rbac --debug --role {} --scopes {}
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/ikiru/.azure/commands'.
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f9ae2b2ce50>, <function register_global_query_examples_argument..register_query_examples at 0x7f9ae2a8a0d0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f9ae2a8a160>, <function register_cache_arguments..add_cache_arguments at 0x7f9ae2a8a280>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f9ae3307b80>, <function CLIQuery.handle_query_parameter at 0x7f9ae32b00d0>, <function register_global_query_examples_argument..handle_example_parameter at 0x7f9ae2afa790>, <function register_ids_argument..parse_ids_arguments at 0x7f9ae2a8a1f0>]
msrest.universal_http.requests: Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
cli.azure.cli.core.commands.client_factory: Adding custom headers to the client:
cli.azure.cli.core.commands.client_factory: 'x-ms-client-request-id': '236fe676-6529-11ee-9924-080027b9bdb0'
cli.azure.cli.core.commands.client_factory: 'CommandName': 'ad sp create-for-rbac'
cli.azure.cli.core.commands.client_factory: 'ParameterSetName': '--debug --role --scopes'
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=AuthorizationManagementClient
cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 659, in execute
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 722, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 714, in _run_job
return cmd_copy.exception_handler(ex)
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/commands.py", line 69, in graph_err_handler
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 693, in _run_job
result = cmd_copy(params)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 330, in call
return self.handler(*args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 786, in default_command_handler
return op(**command_args)
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/custom.py", line 1414, in create_service_principal_for_rbac
role_client = _auth_client_factory(cmd.cli_ctx).role_assignments
File "/usr/lib/python3/dist-packages/azure/mgmt/authorization/_authorization_management_client.py", line 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'

cli.azure.cli.core.azclierror: CLIInternalError: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: CLIInternalError: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: API version 2020-04-01-preview does not have operation group 'role_assignments'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 659, in execute
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 722, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 714, in _run_job
return cmd_copy.exception_handler(ex)
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/commands.py", line 69, in graph_err_handler
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 693, in _run_job
result = cmd_copy(params)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 330, in call
return self.handler(*args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 786, in default_command_handler
return op(**command_args)
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/custom.py", line 1414, in create_service_principal_for_rbac
role_client = _auth_client_factory(cmd.cli_ctx).role_assignments
File "/usr/lib/python3/dist-packages/azure/mgmt/authorization/_authorization_management_client.py", line 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'
cli.azure.cli.core.azclierror: API version 2020-04-01-preview does not have operation group 'role_assignments'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 659, in execute
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 722, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 714, in _run_job
return cmd_copy.exception_handler(ex)
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/commands.py", line 69, in graph_err_handler
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 693, in _run_job
result = cmd_copy(params)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 330, in call
return self.handler(*args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 786, in default_command_handler
return op(**command_args)
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/custom.py", line 1414, in create_service_principal_for_rbac
role_client = _auth_client_factory(cmd.cli_ctx).role_assignments
File "/usr/lib/python3/dist-packages/azure/mgmt/authorization/_authorization_management_client.py", line 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 open an issue, please run: 'az feedback'
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f9ae2b7d940>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 1.184 seconds (init: 0.278, invoke: 0.906)
telemetry.save: Save telemetry record of length 6394 in cache
telemetry.check: Negative: The /home/ikiru/.azure/telemetry.txt was modified at 2023-10-07 18:49:02.103739, which in less than 600.000000 s

Expected behavior

creating service account

Environment Summary

$az --version
azure-cli 2.18.0 *

core 2.18.0 *
telemetry 1.0.6

Extensions:
azure-devops 0.19.0

Python location '/usr/bin/python3'
Extensions directory '/home/ikiru/.azure/cliextensions'
Extensions system directory '/usr/lib/python3/dist-packages/azure-cli-extensions'

Python (Linux) 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]

Legal docs and information: aka.ms/AzureCliLegal

You have 2 updates available. Consider updating your CLI installation with 'az upgrade'

Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy

Additional context

$az upgrade
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Your current Azure CLI version is 2.18.0. Latest version available is 2.29.0.
Please check the release notes first: https://docs.microsoft.com/cli/azure/release-notes-azure-cli
Do you want to continue? (Y/n): y
[sudo] пароль до ikiru:
В кеші:1 https://apt.releases.hashicorp.com bookworm InRelease
В кеші:2 https://download.docker.com/linux/debian buster InRelease
В кеші:3 https://deb.parrot.sh/parrot lts-updates InRelease
В кеші:4 https://packages.cloud.google.com/apt cloud-sdk InRelease
В кеші:5 https://deb.parrot.sh/parrot parrot InRelease
В кеші:6 https://deb.parrot.sh/direct/parrot parrot-security InRelease
В кеші:7 https://deb.parrot.sh/parrot parrot-backports InRelease
В кеші:8 https://packages.microsoft.com/repos/azure-cli bookworm InRelease
Зчитування переліків пакунків... Виконано
Зчитування переліків пакунків... Виконано
Побудова дерева залежностей... Виконано
Зчитування інформації про стан... Виконано
azure-cli is already the newest version (2.18.0-2).
оновлено 0, встановлено 0 нових, 0 відмічено для видалення і 0 не оновлено.
CLI upgrade failed or aborted.

@IkiruBoy IkiruBoy added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 7, 2023
@azure-client-tools-bot-prd
Copy link

Hi @IkiruBoy,

This is not the official Azure CLI published by Microsoft.

How to tell if the installed Azure CLI is unofficial:

Please follow https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux to install Microsoft official Azure CLI.

If you feel that further discussion is needed, please add a comment with the text /clibot unresolve to reopen the issue.

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 7, 2023

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Graph az ad labels Oct 7, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Upgrade az upgrade labels Oct 7, 2023
@IkiruBoy
Copy link
Author

IkiruBoy commented Oct 7, 2023

/clibot unresolve

@IkiruBoy
Copy link
Author

IkiruBoy commented Oct 7, 2023

@yonzhan yonzhan added this to the Backlog milestone Oct 7, 2023
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 7, 2023
@bebound
Copy link
Contributor

bebound commented Oct 8, 2023

/usr/lib/python3/dist-packages/ indicates that it's an unofficial version.
Which OS are you using?

@IkiruBoy
Copy link
Author

IkiruBoy commented Oct 8, 2023

now i resolve by using docker container azure cli.
i use parrotos ara based on debian bookworm

@IkiruBoy
Copy link
Author

IkiruBoy commented Oct 8, 2023

/clibot resolve

@IkiruBoy IkiruBoy closed this as completed Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Graph az ad question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Upgrade az upgrade
Projects
None yet
Development

No branches or pull requests

4 participants