New Fresh deep-dives on cloud, AI, mobile & web now publish on blog.msdevbuild.com Read the latest → Install the app
Azure

Microsoft Azure: Avoid unknown or accidental deletion of Azure resources

By   Saturday, May 15, 2021 comments
reads
React:
Azure has role-based access control (RBAC) to restrict access to resources and management features, but it can’t be used to quickly prevent the users from accidentally deleting a resource.

One of my friends called and asked How to avoid unknown or accidental deletion of Azure resources by other users, In this article, will share the steps, Azure resource lock implementation, Which Prevents Accidental Deletion of Resources.

Microsoft Azure: Avoid unknown or accidental deletion of Azure resources

Type Azure Lock

Microsoft provided two types of azure resource lock

CannotDelete 

 Lock prevents users from deleting a storage account, but permits reading and modifying its configuration.

Type Azure Resource Lock

ReadOnly 

Lock prevents users from deleting a storage account or modifying its configuration but permits reading the configuration.


Type Azure Resource Lock

User role Administrator and owner can modify the above two azure lock features.

Configure Azure Lock

We will see the following steps for how to configure azure lock using the Azure portal.

Step 1: Navigate to your storage account, or if you have not created it before, I have shared steps in my previous article about how to create an Azure storage account.

Microsoft Azure: Avoid unknown or accidental deletion of Azure resources

Step 2: On Storage account quick setting menu and Select on Lock, the lock list showing empty means, they are is no lock available on existing so click on Add for new lock configuration

Microsoft Azure: Avoid unknown or accidental deletion of Azure resources

Create new Lock

As mentioned above, Resource lock has two types, so select the Lock type as per your need and provide the lock name and description for understanding.

Microsoft Azure: Avoid unknown or accidental deletion of Azure resources

After clicking on Ok, You will get the following list screen with Lock Name, type, and Edit. Edit Options for Edit the name and type, delete option for deleting the lock associated with a storage account.

Microsoft Azure: Avoid unknown or accidental deletion of Azure resources

Resource Lock testing

You can navigate to Storage account and click on Delete

Microsoft Azure: Avoid unknown or accidental deletion of Azure resources

After clicking on the delete option, Immediately Azure intelligent will show the notification saying you can’t delete because of the Resource lock

Microsoft Azure: Avoid unknown or accidental deletion of Azure resources

Summary

You have learned now and How to Avoid Accidental Deletion of Azure Resource on the Azure Portal and available lock options. If you have questions, Keep continuing to post your comment below.
SJ
Suthahar Jegatheesan

Cloud, AI & Mobile Solutions Architect · 18+ years across Azure, Google Cloud and Firebase, C#, Python, .NET MAUI and Flutter. Author of the Xamarin Q&A Book.

More in this series

No comments:

sponsored

What Colleagues Say

“Suthahar is one of the most thorough and knowledgeable cloud architects I’ve worked with. His depth on Azure and ability to make complex mobile solutions work cross-platform is remarkable. He always delivers beyond expectations.”

AT Arun T. Senior Engineering Manager · Direct Manager

“I’ve followed Suthahar’s MSDEVBUILD blog for years — practical, deep, always current. Working alongside him confirmed what I suspected: he’s as sharp in person as on paper, and a genuinely generous mentor and architect.”

RK Rajesh K. Lead Developer · Mindtree

Certifications & Recognition

AZ-300 · Azure Architect Technologies AZ-301 · Azure Architect Design AZ-104 · Azure Administrator Associate AI-100 · Designing Azure AI Solutions DP-900 · Azure Data Fundamentals MCPD · Windows Phone Certified SAFe® 4 Scrum Master

Technical Expertise

☁ Cloud Platforms Microsoft Azure — Expert · 18 yrs App Services · AKS · Functions · Cosmos DB · APIM · Entra ID AWS & Google Cloud — Advanced
🤖 AI & Automation Azure OpenAI / GenAI — Advanced · 5 yrs RAG Pipelines · Bot Framework · Cognitive Services · Vision & Speech AI · ML.NET
📱 Mobile Architecture .NET MAUI & Xamarin — Expert · 12 yrs Flutter · Native iOS/Android · Offline-First · Secure Storage & Auth
🔒 Identity & Security Microsoft Entra ID — Expert OAuth 2.0 · OIDC · Zero Trust · Conditional Access · RBAC · Key Vault

Speaking & Community

Microsoft User Group Malaysia Recurring speaker on Azure architecture, AI integration and .NET mobile development across Malaysia and APAC.
Global Azure Bootcamp — Chennai Presented “AI into Xamarin Mobile Apps” at GAB Chennai, part of the worldwide Global Azure community event.
AI & Azure OpenAI Community Events Workshops and live demos on RAG pipelines, AI agents and intelligent workflow automation since 2023.
Mobile & Cloud Workshops — Coimbatore Multi-day deep-dive sessions at GRG Computer Technology, KG Microsoft Innovation Center and RVS College of Arts and Science.
500+Blog Articles
50+Conference Talks
10K+Monthly Readers
30Public Repositories
3Continents Delivered
New home

MSDEVBUILD now publishes on blog.msdevbuild.com

Every new article lands there first — cloud and Azure, AI and GitHub Copilot, .NET MAUI and Flutter, web and Firebase. It installs as an app, opens like a native one and keeps working offline.

MSDEVBUILD Assistant Ask about Suthahar, Azure, AI or mentorship
Hi! I’m a simple FAQ bot for MSDEVBUILD. Tap a question below or type your own.