[Role] az role assignment list: Add --fill-role-definition-name#31152
[Role] az role assignment list: Add --fill-role-definition-name#31152
az role assignment list: Add --fill-role-definition-name#31152Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| role assignment list | cmd role assignment list added parameter fill_role_definition_name |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
9d6e08e to
66cd34d
Compare
There was a problem hiding this comment.
This recording file previously contains 8 requests with /providers/Microsoft.Authorization/roleDefinitions?api-version=2022-05-01-preview. Now it contains only 4.
66cd34d to
280f5c6
Compare
|
Please fix the PR description, the command name is |
Nice catch. Fixed. |
az role assignment list: Add --fill-role-definition-name to allow omitting principalName propertyaz role assignment list: Add --fill-role-definition-name
| self.cmd('role assignment list --scope {rg_id} --fill-principal-name false ' | ||
| '--fill-role-definition-name false', |
There was a problem hiding this comment.
--asignee requires Graph query and --assignee-object-id is not supported yet (#30469), so we can only use --scope+atScope() query for now:
azure-cli/src/azure-cli/azure/cli/command_modules/role/custom.py
Lines 582 to 586 in d4147a7
This records the subscription assignments, making the recording file big.
Once --assignee-object-id is not supported (#30469), we can switch to
azure-cli/src/azure-cli/azure/cli/command_modules/role/custom.py
Lines 587 to 592 in d4147a7
Related command
az role assignment listDescription
With the ever-increasing number of built-in roles, the list returned by Role Definitions - List API is getting bigger and bigger (#30579), making
az role assignment listcommand slower.In our test subscription,
role_defsatazure-cli/src/azure-cli/azure/cli/command_modules/role/custom.py
Lines 273 to 274 in 919923c
contains 653 items with the size of 588563 bytes, bloating recording files to megabytes big, exceeding the limit of Git diff.
This PR adds
--fill-role-definition-nameto allow omittingroleDefinitionNameproperty, similar to #30693.#30587 uses
roleNamefilter to accelerateaz role definition list, but foraz role assignment list, this would require making a REST call for each role definition. Giving the user the choice whether to fillroleDefinitionNameproperty is still mandatory.Testing Guide
Without
--fill-role-definition-name false:With
--fill-role-definition-name false:History Notes
[Role]
az role assignment list: Add--fill-role-definition-nameargument. Use--fill-role-definition-name falseto omitroleDefinitionNameproperty and bypass the role definitions query