Why aren’t you using Azure resource locks?

Why aren’t you using Azure resource locks?

Resource locks are something that you get told about and always think you’ll get round to them at some point. However, the idea of having to turn something off to work on your resources just sounds annoying.

I recently was involved in a hackathon, it was my first and to be honest I was caught up in the excitement of being “one of the cool kids”, you always hear of hackathons and they sound great. Free pizza, exchanging ideas, long hours, free pizza, etc, etc, but what you probably don’t realise is that all of that frantic creativity can overwhelm your normal “sensible” sysadmin tendencies. I had a moment of total panic when I thought i’d deleted the wrong database VM. Luckily over the years I’ve become quite good at hiding panic, but I definitely felt the blood draining from my face. Luckily I didn’t delete the wrong server, but it did prompt me to look at resource locks.

There are a few different types, but I recommend that you put “Delete locks” on all your important resources (ideally at a resource group level). They don’t stop you breaking your resource by changing it, but it does stop you deleting it

To enable a delete lock you just need to..

  1. Browse to your resource group or target resource
  2. Click on it (To get the menu)
  3. Find Locks in the menu


  1. Add a lock, select the type as Delete


  1. Click OK

Now you’re good to go. If you do need to delete the resource, then just remove the lock. If you want more information on Resource Locks, Microsoft have a great article