AZ900: Microsoft Azure Fundamentals
Governance and Compliance
Resource Locks
Azure resource locks are a powerful feature designed to protect your critical assets from accidental deletion or modification. In this article, we explore how Beta Innovation can use Azure resource locks to safeguard important resources and ensure operational continuity.
Azure resource locks serve as protective measures by blocking unintended changes. They can be applied at multiple points in the resource hierarchy, including subscriptions, resource groups, and individual resources.
Types of Resource Locks
Azure provides two types of resource locks:
Read-Only Lock
This lock restricts any modifications by allowing only viewing access. Think of it as a museum exhibit—you can inspect details such as replication settings, files, or containers, but you cannot make any changes.Delete Lock
This lock allows modifications while preventing the deletion of a resource. For instance, if you apply a Delete lock to a virtual machine, you can still perform actions like starting, stopping, or resizing the VM, but deleting it is blocked.
Key Features of Resource Locks
Scope of Application:
Resource locks can be applied broadly across an entire subscription or narrowly to a specific resource. This flexibility is similar to setting up a security system for an entire building or just a single room.Flexible Control:
Choose between a Read-Only lock and a Delete lock based on your specific security requirements.
Benefits of Using Resource Locks
Resource locks provide several advantages:
Protection Against Accidental Actions:
They help prevent unintended changes, reducing the risk of human error.Customizable Security:
Lock configurations can be tailored to meet your operational needs, ensuring a secure environment.Enhanced Governance:
Resource locks contribute to improved compliance and governance by establishing an extra layer of control over resource modifications.
Use Cases for Resource Locks
Resource locks are particularly useful for protecting high-value assets, such as:
- Production databases
- Key networking components
- Essential services
They ensure that your most critical components remain secure and fully operational.
Managing Resource Locks in the Azure Portal
Managing resource locks via the Azure Portal is straightforward. Follow these steps to implement and oversee locks on your resources:
Navigating the Locks:
Sign in to the Azure Portal, navigate to your subscription, and search for "locks." Locks set at the subscription level are inherited by all resource groups and underlying resources.Applying a Lock to a Resource Group:
Within a specific resource group, search for "lock" and add a new lock. For instance, you might name the lock "dnd" (do not delete) and then confirm by clicking OK.Effect of Locks on Resources:
When a lock is applied to a resource group, attempts to delete any resource within that group (such as a storage account) will be blocked. An error message will inform you that the deletion is prevented by the active Delete lock.Understanding Inheritance and Overrides:
Locks applied at the resource group level are automatically inherited by all resources within that group. However, additional locks can be set on individual resources. For example, adding a Read-Only lock at the resource level will override other operations, such as restarting the resource.Removing Locks:
To remove a lock, return to the "locks" section. If a lock is inherited from a parent scope (like a resource group), you will need to remove it from that parent level rather than individually on the resource.
Note
When managing resource locks, always verify the scope from which the lock originates to avoid unintentional exposure of critical resources.
This concludes our detailed guide on managing Azure resource locks. By employing these locks effectively, you can enhance the security and governance of your Azure environment while protecting valuable assets.
For further reading on Azure security features, refer to the Azure Documentation and explore additional resources on our website.
Watch Video
Watch video content