![Forrest logo](/images/logo.png)
az-lock:tldr:9d1da
The command "az lock list" is used in the context of the Azure command-line interface (CLI) to list the locks that have been applied to resources in your Azure subscription.
In Azure, resource locks provide a way to prevent accidental deletion or modification of critical resources. By applying a lock to a resource, you can prevent any unauthorized or accidental actions being performed on that resource. There are two types of locks:
- CanNotDelete: This lock type blocks any delete or modification operations on the resource. It ensures that the resource cannot be deleted or modified until the lock is removed.
- ReadOnly: This lock type allows read-only actions on the resource but blocks any delete or modification operations. It ensures that the resource remains in a "read-only" state until the lock is removed.
The "az lock list" command lists all the locks applied to the resources in your Azure subscription. It retrieves information such as the lock type, resource ID, lock ID, and the owner of the lock for each locked resource. This command helps you understand the current lock state of your Azure resources and allows you to manage the locks accordingly.