If you are looking at the disks in the portal, and you see a lock in the "locks" tab, then this is locking the disks and will need to be removed before deleting. Locks can be applied at the RG that apply to sub items.
Delete disk from Azure and Resource Group

When I search in the DISKS area, I see several additional disks which do not have owners and are listed as unattached. When I examine the names, these appear to be from VMs which have been deleted. When I attempt to delete one of theses disks, I get an error messages saying that the drive is locked.
"Failed to delete disk 'XXXSQL10_DataDisk_0'. Error: The scope 'XXXSQL10_DataDisk_0' cannot perform delete operation because following scope(s) are locked: 'Servers'. Please remove the lock and try again.
I checked the "Lock" option and this doesn't look like the right option, it appears to prevent the resource group itself from being deleted and perhaps not items in that group such as a disk.
The ends of this all is that I would like to delete these disks which are no longer need. Any help would be appreciated.
Azure Disk Storage
-
Sam Cogan 10,812 Reputation points Microsoft Employee Volunteer Moderator
2023-02-15T14:41:27.1466667+00:00