Open dallmair opened 1 month ago
Thank you for opening this issue, we will look into it.
Hi @dallmair Find similar issue https://github.com/Azure/azure-cli/issues/21581. | ||
---|---|---|
Issue title | Encountered a bug in az vm run-command show | |
Create time | 2022-03-10 | |
Comment number | 3 |
Possible solution:
The error message "No value for given attribute" is a generic error message that can occur in different commands. The error message indicates that there is a problem with the input parameters or the command itself. In the case of the az vm run-command show
command, the error message can occur if the command is not properly formatted or if there is a problem with the input parameters. To resolve the issue, you can try to check the input parameters and make sure that they are correct. You can also try to run the command with the --debug
option to get more information about the error. If the issue persists, you can try to reopen this issue.
Please confirm if this resolves your issue.
Hi @azure-client-tools-bot-prd
Please confirm if this resolves your issue.
Unfortunately it does not, the input parameters are correct and supported, per the documentation.
I am able to repro by running az role assignment list --all --role AcrPull
.
This seems to be an old issue.
When --all
is used, scope
is set to None
:
scope
is later used to list role definitions:
However, as its value is None
, SDK shows the ValueError: No value for given attribute
error.
A workaround is to first get the GUID of AcrPull
:
> az role definition list --name AcrPull
[
{
"assignableScopes": [
"/"
],
"createdBy": null,
"createdOn": "2018-10-22T19:01:56.822718+00:00",
"description": "acr pull",
"id": "/subscriptions/1c638cf4-608f-4ee6-b680-c329e824c3a8/providers/Microsoft.Authorization/roleDefinitions/7f951dda-4ed3-4680-a7ca-43fe172d538d",
"name": "7f951dda-4ed3-4680-a7ca-43fe172d538d",
"permissions": [
{
"actions": [
"Microsoft.ContainerRegistry/registries/pull/read"
],
"condition": null,
"conditionVersion": null,
"dataActions": [],
"notActions": [],
"notDataActions": []
}
],
"roleName": "AcrPull",
"roleType": "BuiltInRole",
"type": "Microsoft.Authorization/roleDefinitions",
"updatedBy": null,
"updatedOn": "2021-11-11T20:13:08.877932+00:00"
}
]
Then run
az role assignment list --all --role 7f951dda-4ed3-4680-a7ca-43fe172d538d
I prefer not to change the current "when --all
is used, scope
is set to None
" behavior since --all
is already a bad design (as discussed in https://github.com/Azure/azure-cli/issues/14302).
Once --all
is removed, this ValueError: No value for given attribute
issue will automatically be solved, as --scope
will default to the current subscription and be kept (not set to None
).
Describe the bug
Running
az role assignment list --all --role AcrPull
fails with an unexpected error (traceback).Related command
az role assignment list
Errors
Issue script & Debug output
Expected behavior
Should show JSON of all AcrPull role assignments (all resources, all assignees, specific role).
Environment Summary
Additional context
No response