Skip to content

[Feature Request] az role assignment list/delete: Make --scope a required argument #30471

@jiasli

Description

@jiasli

#27651 made --scope a required argument for az role assignment create.

I propose making --scope a required argument for az role assignment list/delete too, as explained below:

az role assignment list

Even though the output of this command contains no secret, it contains PII - the email address of the assignee:

  {
    "id": "/subscriptions/xxx/providers/Microsoft.Authorization/roleAssignments/xxx",
    "principalId": "xxx",
    "principalName": xxx#EXT#@xxx.onmicrosoft.com,
    "principalType": "User",
    ...
  }

Without specifying --scope, this command lists all role assignments under the current subscription. The PII can be saved into build logs, such as GitHub Action logs. Therefore, we should ask the user to explicitly specify the scope under which role assignments should be listed to avoid showing PII as much as possible.

az role assignment delete

#13577 made a very nice metaphor: This command is an insane footgun. Without specifying --scope, it deletes all role assignment under the current subscription. We should ask the user to explicitly specify the scope under which role assignments should be deleted to avoid expectedly nuking the whole subscription.

Making --scope a required argument aligns all create, list and delete commands to have a consistent interface.

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamRBACaz rolequestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions