Created
November 11, 2020 07:59
-
-
Save vladwa/9fd62c800463c69c61fadfb823622e78 to your computer and use it in GitHub Desktop.
Azure - Delete unattached/unused disks
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
unattachedDisk=`az disk list --query "[?diskState=='Unattached'].id" --output table | grep sub` | |
for diskId in ${unattachedDisk} | |
do | |
echo ${diskId} | |
az disk delete --ids ${diskId} --yes --no-wait | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment