How to Protect your Azure Resource from Accidental deletion?

Imagine a scenario where you have put so much effort to make a website live and on the day of launching, the website, you were surprised to see a “404 Not Found” message on the browser. This kind of nightmare can give you weeks of sleepless nights.

In order to deal with the above-mentioned issue, Microsoft has provided a great feature in Azure wherein you can apply a lock on the resource, which will prevent the resource from being accidentally deleted. A simple feature but very useful.

What are resource locks?

Resource locks are a setting that can be applied to any resource to block modification or deletion.

Types of Resource Locks:

  1. Delete
  2. Read-only

Delete will allow all operations against the resource but block the ability to delete it. Read-only will only allow read activities to be performed against it, blocking any modification or deletion of the resource. Resource locks can be applied to subscriptions, resource groups, and to individual resources, and are inherited when applied at higher levels.

Applying Read-only can lead to unexpected results because some operations that seem like read operations require additional actions. When a resource lock is applied, you must first remove the lock in order to perform any activity. Resource locks apply regardless of RBAC permissions.

How to create a Resource Locks?

a) Locate the resource and click on the resource in the “All Resource” page, you want to apply the lock on.

Protect Azure Resources from Accidental Deletion I

b) In the left panel, click on the “Locks” menu option.

Protect Azure Resources from Accidental Deletion II

c) Click on the “Add” menu to create a lock.

Protect Azure Resources from Accidental Deletion III

d) Give a name as “ProtectDelete” and select the lock type as “Delete”, then click on “OK”.

Protect Azure Resources from Accidental Deletion IV

A new lock property will get created. We can edit the lock property if needed.

So, in this way we can protect our resources and the efforts we took to make it live. Better safe than sorry!

Blog disclaimer: This is a professional weblog, and we have invited experts to share their thoughts, expertise , perspectives and knowledge. The opinions expressed here are purely representing their personal views and not those of any institution, employer or company.


“Extend your learning with our specialized courses"

info@voksedigital.com
Source: Microsoft Power BI
Recent Posts
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Request For Demo


This will close in 20 seconds

offpage seopowerapps