2021-10-10 17:19:02 +01:00
|
|
|
# az lock
|
|
|
|
|
|
|
|
> Manage Azure locks.
|
2023-10-15 08:42:29 +01:00
|
|
|
> Part of `azure-cli` (also known as `az`).
|
2022-10-04 16:06:23 +01:00
|
|
|
> More information: <https://learn.microsoft.com/cli/azure/lock>.
|
2021-10-10 17:19:02 +01:00
|
|
|
|
|
|
|
- Create a read-only subscription level lock:
|
|
|
|
|
|
|
|
`az lock create --name {{lock_name}} --lock-type ReadOnly`
|
|
|
|
|
|
|
|
- Create a read-only resource group level lock:
|
|
|
|
|
|
|
|
`az lock create --name {{lock_name}} --resource-group {{group_name}} --lock-type ReadOnly`
|
|
|
|
|
|
|
|
- Delete a subscription level lock:
|
|
|
|
|
|
|
|
`az lock delete --name {{lock_name}}`
|
|
|
|
|
|
|
|
- Delete a resource group level lock:
|
|
|
|
|
|
|
|
`az lock delete --name {{lock_name}} --resource-group {{group_name}}`
|
|
|
|
|
|
|
|
- List out all locks on the subscription level:
|
|
|
|
|
|
|
|
`az lock list`
|
|
|
|
|
2024-02-09 14:34:08 +00:00
|
|
|
- Show a subscription level lock with a specific [n]ame:
|
2021-10-10 17:19:02 +01:00
|
|
|
|
|
|
|
`az lock show -n {{lock_name}}`
|