LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

az-lock

Manage Azure resource locks

TLDR

Create a read-only lock on a resource group
$ az lock create --name [MyLock] --resource-group [MyResourceGroup] --lock-type ReadOnly
copy
Create a delete lock to prevent accidental deletion
$ az lock create --name [MyLock] --resource-group [MyResourceGroup] --lock-type CanNotDelete
copy
List all locks in a resource group
$ az lock list --resource-group [MyResourceGroup]
copy
Show details of a lock
$ az lock show --name [MyLock] --resource-group [MyResourceGroup]
copy
Delete a lock
$ az lock delete --name [MyLock] --resource-group [MyResourceGroup]
copy
Create a lock on a specific resource
$ az lock create --name [MyLock] --resource-group [MyResourceGroup] --resource-name [MyResource] --resource-type [Microsoft.Storage/storageAccounts] --lock-type CanNotDelete
copy

SYNOPSIS

az lock subcommand [options]

DESCRIPTION

az lock manages Azure resource locks. Locks prevent accidental deletion or modification of critical resources. Two lock types are available: CanNotDelete allows read and modify operations but prevents deletion, while ReadOnly allows only read operations.Locks can be applied at subscription, resource group, or individual resource level. Child resources inherit locks from parent resources.

PARAMETERS

--name -n

Name of the lock.
--lock-type -t
Type of lock: CanNotDelete or ReadOnly.
--resource-group -g
Name of resource group.
--resource-name --resource
Name of the resource being locked.
--resource-type
The type of the resource being locked (e.g., Microsoft.Network/subnets).
--namespace
Provider namespace (e.g., Microsoft.Provider).
--parent
Parent path for nested resources (e.g., resA/myA/resB/myB).
--notes
Notes about the lock.
--ids
One or more resource IDs. Used with delete/show/update instead of --name.

SUBCOMMANDS

create

Create a lock.
delete
Delete a lock.
list
List locks.
show
Show details of a lock.
update
Update a lock.

INSTALL

sudo dnf install azure-cli
copy
sudo pacman -S azure-cli
copy
sudo zypper install azure-cli
copy
brew install azure-cli
copy
nix profile install nixpkgs#azure-cli
copy

CAVEATS

Requires Azure CLI and appropriate RBAC permissions (Owner or User Access Administrator). Locks do not restrict actions performed by the Azure platform itself. A ReadOnly lock on a resource group affects all resources within it.

SEE ALSO

az(1), az-tag(1), az-provider(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid