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:
- Delete
- 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.
b) In the left panel, click on the “Locks” menu option.
c) Click on the “Add” menu to create a lock.
d) Give a name as “ProtectDelete” and select the lock type as “Delete”, then click on “OK”.
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.comSource: Microsoft Power BI