Resource locks protect your Azure resources from accidental deletion or modification,As an administrator, you can lock an Azure subscription, resource group, or resource to protect them from accidental user deletions and modifications. The lock overrides any user permissions. You can set locks that prevent either deletions or modifications. In the portal, these locks are called Delete and Read-only
HOW TO LOCK A RESOURCE GROUP
To do this
-we will create a resource group
-lock the resource group
HOW TO CREATE A RESOURCE GROUP
Go to azure account
search resource group
click on create
give the resource group a name
review and create
create
resource group is ready
Now the resource group is ready, lets proceed to lock it.
-open the resource group and click on lock
click "add"
give the lock a name
LOCK TYPES
READ ONLY-means authorized users can read and modify a resource, but they can't delete it.
DELETE- means authorized users can read a resource, but they can't delete or update it
FOR THIS TUTORIAL WE WILL USE THE DELETE LOCK TYPE
ADD A NOTE
CLICK "ok"
for this tutorial we will create a storage account and add to the resource group created, then we try to delete
if you dont know how to create a storage account
we created a storage account "testlockdelete2023"
Now lets try to delete
AS YOU CAN SEE THE LOCK PREVENTS THE CODE FROM DELETION
Top comments (0)