Azure / Azure/azure-sdk-tools

Add clean-up of "Unknown" role assignments

Open
#12,072 0 comments 0 reactions 1 assignee Claimed by @weshaggard View on GitHub
Central-EngSys needs-triage
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
143

Description

A number of role assignments get left behind from our testing and we should add some clean-up so we don't hit the cap of number of role assignments and to avoid any security risks.

This is a snippet to clean them up using az cli for the TME sub but we can do the something similar in the PS modules to add to our sub clean-up scripts.

```
az login
$ids = az role assignment list --query "[?principalName==''].id" -o tsv --subscription "4d042dc6-fe17-4698-a23f-ec6a8d1e98f4" --scope "/subscriptions/4d042dc6-fe17-4698-a23f-ec6a8d1e98f4"
$ids | % { az role assignment delete --ids $_ --subscription "4d042dc6-fe17-4698-a23f-ec6a8d1e98f4" }
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.