Open pichuang opened 1 year ago
Thank you for opening this issue, we will look into it.
Thank you for your feedback. This has been routed to the support team for assistance.
non-customer reported issue. Adding Service team to look into this.
Miss v2020_04_01_preview
12:17:53 pinhuang@rhel8 1 /usr/lib64/az/lib/python3.9/site-packages/azure/mgmt./authorization
$ ls
_authorization_management_client.py models.py _serialization.py v2018_01_01_preview v2021_01_01_preview _version.py
_configuration.py __pycache__ v2015_06_01 v2019_08_01_preview v2021_12_01_preview
__init__.py py.typed v2015_07_01 v2020_10_01 v2022_04_01
and will break in here
+1 facing the same issue when running az grafana create --name X --resource-group Y. Used to work before.
Also ran into this error. Just wanted to note that the error doesn't affect the creation of the Azure Managed Grafana instance. It was created, but I just needed to add RBAC manually.
Hi @yonzhan Is it possible to assign someone to take a look? Even through I know it's not an issue of a critical feature being broken, it's an issue of user experience.
@yugangw-msft do you know who can help with this?
Workaround with manual join permission before fixing the issue
Just tested this again using azure-cli version 2.50.0 and it does not seem to be an issue anymore.
Still have the same issue.
Line 85: az grafana create -g rg-poc-aks -l EastUS --name grafana-poc-aks
Grafana instance of 'grafana-poc-aks' was created. Now creating default role assignments for its managed identity, and current CLI account unless --principal-ids are provided
The command failed with an unexpected error. Here is the traceback:
No module named 'azure.mgmt.authorization.v2020_04_01_preview'
Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/mnt/c/Users/pinhuang/rhwsl-home/.azure/cliextensions/amg/azext_amg/custom.py", line 68, in create_grafana
_create_role_assignment(cmd.cli_ctx, p, t, grafana_admin_role_id, resource.id)
File "/mnt/c/Users/pinhuang/rhwsl-home/.azure/cliextensions/amg/azext_amg/custom.py", line 115, in _create_role_assignment
assignments_client = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_AUTHORIZATION,
File "/usr/lib64/az/lib/python3.9/site-packages/azure/mgmt/authorization/_authorization_management_client.py", line 784, in role_assignments
from .v2020_04_01_preview.operations import RoleAssignmentsOperations as OperationClass
ModuleNotFoundError: No module named 'azure.mgmt.authorization.v2020_04_01_preview'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
real 3m14.864s
user 0m0.674s
sys 0m0.318s
$ az version
{
"azure-cli": "2.50.0",
"azure-cli-core": "2.50.0",
"azure-cli-telemetry": "1.0.8",
"extensions": {
"aks-preview": "0.5.149",
"amg": "1.2.7",
"arcdata": "1.5.3",
"azure-firewall": "0.14.8",
"bastion": "0.2.5",
"connectedk8s": "1.3.20",
"customlocation": "0.1.3",
"k8s-configuration": "1.7.0",
"k8s-extension": "1.4.2",
"ssh": "2.0.0",
"virtual-wan": "0.2.17"
}
}
still seeing issue in version 2.51.0
same issue even in version 2.53
A workaround is to pass --skip-role-assignments
but I'd rather know why it is broken and have someone fix it.
This issue has been fixed in the latest version of the cli extension: 1.2.8
I can confirm that this no longer throws an error in the latest version
$ az version
{
"azure-cli": "2.53.1",
"azure-cli-core": "2.53.1",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"account": "0.2.5",
"aks-preview": "0.5.168",
"amg": "1.2.9",
"k8s-configuration": "1.7.0",
"k8s-extension": "1.5.1"
}
}
Describe the bug
The latest version of azure-cli is unable to execute commands such as 'az grafana create' correctly
Related command
az grafana create
Errors
$ az grafana create -g rg-poc1-aks -l EastUS --name grafana-poc2-aks Grafana instance of 'grafana-poc2-aks' was created. Now creating default role assignments for its managed identity, and current CLI account unless --principal-ids are provided The command failed with an unexpected error. Here is the traceback: No module named 'azure.mgmt.authorization.v2020_04_01_preview' Traceback (most recent call last): File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/mnt/c/Users/pinhuang/rhwsl-home/.azure/cliextensions/amg/azext_amg/custom.py", line 68, in create_grafana _create_role_assignment(cmd.cli_ctx, p, t, grafana_admin_role_id, resource.id) File "/mnt/c/Users/pinhuang/rhwsl-home/.azure/cliextensions/amg/azext_amg/custom.py", line 115, in _create_role_assignment assignments_client = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_AUTHORIZATION, File "/usr/lib64/az/lib/python3.9/site-packages/azure/mgmt./authorization/_authorization_management_client.py", line 784, in role_assignments from .v2020_04_01_preview.operations import RoleAssignmentsOperations as OperationClass ModuleNotFoundError: No module named 'azure.mgmt.authorization.v2020_04_01_preview'
Issue script & Debug output
Expected behavior
No error messages are being displayed.
Environment Summary
$ az --version azure-cli 2.49.0
core 2.49.0 telemetry 1.0.8
Extensions: aks-preview 0.5.141 amg 1.2.5 arcdata 1.5.0 azure-firewall 0.14.7 bastion 0.2.4 connectedk8s 1.3.20 customlocation 0.1.3 k8s-configuration 1.7.0 k8s-extension 1.4.1 ssh 1.1.6 virtual-wan 0.2.17
Dependencies: msal 1.20.0 azure-mgmt-resource 22.0.0
Python location '/usr/bin/python3.9' Extensions directory '/mnt/c/Users/pinhuang/rhwsl-home/.azure/cliextensions'
Python (Linux) 3.9.13 (main, Nov 9 2022, 13:16:24) [GCC 8.5.0 20210514 (Red Hat 8.5.0-15)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response