`az role assignment delete` command is an insane footgun
See original GitHub issue
az feedback
auto-generates most of the information requested below, as of CLI version 2.0.62
Describe the bug
If you type az role assignment delete
with no arguments, the Azure CLI offers to delete every role assignment in your subscription. This is insane.
To Reproduce
- Make sure your cat/child/fingers are as far away from the keyboard as possible
- Type
az role assignment delete
with no arguments - Throw your computer into the ocean
Expected behavior
Literally anything else
Environment summary
Homebrew
$ az --version
azure-cli 2.2.0 *
command-modules-nspkg 2.0.3
core 2.2.0 *
nspkg 3.0.4
telemetry 1.0.4
Python location '/Users/bellamko/git/k8s-infrastructure/.direnv/python-3.8.2/bin/python3'
Extensions directory '/Users/bellamko/.azure/cliextensions'
Python (Darwin) 3.8.2 (default, Mar 11 2020, 00:29:50)
[Clang 11.0.0 (clang-1100.0.33.17)]
Additional context
This reminds me of how az vmss delete-instances
used to offer to delete every single one of your VMs if you didn’t pass in --instance-ids
. Now it just raises an error, which is sane behavior.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:12 (7 by maintainers)
Top Results From Across the Web
az role assignment | Microsoft Learn
Manage role assignments. In this article. Commands; az role assignment create; az role assignment delete; az role assignment list; az role assignment ......
Read more >Untitled
Slepo tipkanje test, The manhattans crazy free mp3 download, Anschluss frischluft kaminofen, ... El mas feo del mundo 2014, Anamorphose selbst erstellen, ...
Read more >COLUMBIA - Amazon S3
an informal chain of command and decision-making pro- ... Though assigned an operational role by NASA, during this ... 30 foot gun barrel....
Read more >Learning Archives - Michael Bianco
This seems insane to be and makes for very ugly code, I must be missing something ... However, if a function creates a...
Read more >Ask HN: Inherited the worst code and tech team I have ever ...
I gather the reason for that is because it was developed on production directly and deleting things is too risky. - the database...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue was previously reported in #2933 and the prompt for “delete all” was added in #8862.
The logic is to search for all assignments and delete them all:
I agree this behavior is insane and should be changed even though it is a breaking change.
If you have already deleted all role assignments, and luckily you are a Global Administrator in AAD tenant, there is a chance to recover it: https://docs.microsoft.com/en-us/azure/role-based-access-control/elevate-access-global-admin
I accidentally did this:
az role assignment create --assignee “$SOME_VAR” --role “Owner”
SOME_VAR was accidentally set to empty string. I did not get any prompt and EVERY OWNER WAS DELETED.I lost access to my subscription. Cannot even file a support ticket cause I lost permissions. Is there a way to fix this?