For system, network and cloud administrators
In order do delete a managed disk in Azure and without the need for the command execution confirmation (because of the –yes) parameter, type:
az disk delete --resource-group yourresourcegroup --name yourdiskname --yes
In order to delete all resource groups that start with project01, for example, you’ll first need to make sure you’re in a Bash shell and not PowerShell. Then, type:
az group list --query "[?starts_with(name,'project01')].[name]" --output tsv | xargs -L1 bash -c 'az group delete --name $0 --no-wait --yes'
In order to view all managed disks that start with the disk name, type:
az disk list --query "[?starts_with(name,'disk')].name" --output tsv