-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Role] az role assignment list
: Add --fill-principal-name
to allow omitting principalName
property
#30693
Open
jiasli
wants to merge
1
commit into
Azure:dev
Choose a base branch
from
jiasli:fill-principal-name
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,055
−16
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
️✔️AzureCLI-FullTest
|
Hi @jiasli, |
|
rule | cmd_name | rule_message | suggest_message |
---|---|---|---|
role assignment list | cmd role assignment list added parameter fill_principal_name |
Thank you for your contribution! We will review the pull request and get back to you soon. |
jiasli
commented
Mar 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recording YAML should contain no requests to https://graph.microsoft.com/
.
58f0877
to
1181051
Compare
az role assignment list
: Add --fill-principal-name
to allow skipping filling principalName
propertyaz role assignment list
: Add --fill-principal-name
to allow omitting principalName
property
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related command
az role assignment list
Description
Fix #30469 (comment)
Part of the fix to #30428
After getting role assignments from REST API,
az role assignment list
queries Microsoft Graph to fill theprincipalName
property:userPrincipalName
ServicePrincipalNames[0]
displayName
The motivation is to provide a display name of the assignee, but when the logged-in account has no permission,
az role assignment list
will show a warning:azure-cli/src/azure-cli/azure/cli/command_modules/role/custom.py
Line 300 in 4d6d480
To make things worse, if the machine has no network access to Microsoft Graph, the whole command will fail.
This PR adds
--fill-principal-name
argument to allow skipping fillingprincipalName
property.Testing Guide
Additional information
I deliberately choose
--fill-principal-name
instead of--no-fill-principal-name
, because this gives us the possibility to turn off fillingprincipalName
by default. If we choose--no-fill-principal-name
, turning on fillingprincipalName
will become--no-fill-principal-name false
which is awkward.