Forrest logo
back to the az tool

az-lock:tldr:3f971

az-lock: Create a read-only resource group level lock.
$ az lock create --name ${lock_name} --resource-group ${group_name} --lock-type ReadOnly
try on your machine

The command "az lock create" is used to create a lock on a resource in Azure. In this specific command, the lock being created is of type "ReadOnly".

Here's the breakdown of the command:

  • "az lock create": This is the base command for creating a lock. It is followed by additional parameters to specify the details of the lock.
  • "--name ${lock_name}": This parameter is used to provide a name for the lock. The value of ${lock_name} is a placeholder for the actual name that you need to provide. For example, if you want to name the lock "myLock", you would replace ${lock_name} with "myLock".
  • "--resource-group ${group_name}": This parameter specifies the resource group that contains the resource on which the lock is being created. Here, ${group_name} is a placeholder for the actual name of the resource group. For example, if the resource group is called "myResourceGroup", you would replace ${group_name} with "myResourceGroup".
  • "--lock-type ReadOnly": This parameter specifies the type of lock being created. In this case, the lock type is set to "ReadOnly", which means that the resource will be read-only and no modifications can be made to it.

To summarize, this command creates a lock with a specified name, on a resource in a given resource group, and sets the lock type to "ReadOnly".

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