Created
December 16, 2025 14:36
-
-
Save JosiahSiegel/46c5b31b130846808401a2f7103f13cf to your computer and use it in GitHub Desktop.
Get User's Azure Resource Group RBAC Assignments
This file contains hidden or 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
| az role assignment list --assignee <USER_OBJECT_ID> --all --include-inherited --include-groups -o json | jq -r '["| Resource Group | Roles |", "|----------------|-------|"] + ([.[] | select(.scope | test("/resourceGroups/[^/]+$") or test("/subscriptions/[^/]+$") or test("/managementGroups/")) | {rg: (.resourceGroup // "Subscription-level"), role: .roleDefinitionName}] | group_by(.rg) | map({rg: .[0].rg, roles: (map(.role) | unique | sort | join(", "))}) | sort_by(.rg) | map("| \(.rg) | \(.roles) |")) | .[]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment