Last active
January 11, 2022 22:38
-
-
Save dcasati/a8e5600429a38982620a7eedf5bb6e76 to your computer and use it in GitHub Desktop.
batch remove Service Principals not being used
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
az_rm_sp()(az ad sp list --show-mine -o json --query "[?contains(displayName, '$1')]" | jq -r '.[] | .appId' | xargs -P 4 -n 12 -I % az ad sp delete --id %) | |
example: | |
az_rm_sp azure-cli |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment