Forrest logo
back to the az tool

az-lock:tldr:9d1da

az-lock: List out all locks on the subscription level.
$ az lock list
try on your machine

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:

  1. 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.
  2. 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.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the az tool