az resource lock
Manage Azure resource level locks.
Commands
Name | Description | Type | Status |
---|---|---|---|
az resource lock create |
Create a resource-level lock. |
Core | GA |
az resource lock delete |
Delete a resource-level lock. |
Core | GA |
az resource lock list |
List lock information in the resource-level. |
Core | GA |
az resource lock show |
Show the details of a resource-level lock. |
Core | GA |
az resource lock update |
Update a resource-level lock. |
Core | GA |
az resource lock create
Create a resource-level lock.
az resource lock create --lock-type {CanNotDelete, ReadOnly}
--name
[--namespace]
[--notes]
[--parent]
[--resource --resource-name]
[--resource-group]
[--resource-type]
Examples
Create a read-only resource level lock on a vnet.
az resource lock create --lock-type ReadOnly -n lockName -g MyResourceGroup --resource myvnet --resource-type Microsoft.Network/virtualNetworks
Create a read-only resource level lock on a vnet using a vnet id.
az resource lock create --lock-type ReadOnly -n lockName --resource /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}
Required Parameters
The type of lock restriction.
Property | Value |
---|---|
Accepted values: | CanNotDelete, ReadOnly |
Name of the lock.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Provider namespace (Ex: 'Microsoft.Provider').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Notes about this lock.
The parent path (Ex: 'resA/myA/resB/myB').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
If an ID is given, other resource arguments should not be given.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The resource type (Ex: 'resC'). Can also accept namespace/type format (Ex: 'Microsoft.Provider/resC').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az resource lock delete
Delete a resource-level lock.
az resource lock delete [--ids]
[--name]
[--namespace]
[--parent]
[--resource --resource-name]
[--resource-group]
[--resource-type]
Examples
Delete a resource level lock
az resource lock delete --name lockName -g MyResourceGroup --resource myvnet --resource-type Microsoft.Network/virtualNetworks
Delete a resource level lock on a vnet using a vnet id.
az resource lock delete -n lockName --resource /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VMName}
Delete a resource-level lock. (autogenerated)
az resource lock delete --ids /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Web/sites/{WebApp}
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). If provided, no other "Resource Id" arguments should be specified.
Name of the lock.
Provider namespace (Ex: 'Microsoft.Provider').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The parent path (Ex: 'resA/myA/resB/myB').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
If an ID is given, other resource arguments should not be given.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The resource type (Ex: 'resC'). Can also accept namespace/type format (Ex: 'Microsoft.Provider/resC').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az resource lock list
List lock information in the resource-level.
az resource lock list [--filter-string]
[--namespace]
[--parent]
[--resource --resource-name]
[--resource-group]
[--resource-type]
Examples
List out all locks on a vnet
az resource lock list -g MyResourceGroup --resource myvnet --resource-type Microsoft.Network/virtualNetworks
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
A query filter to use to restrict the results.
Provider namespace (Ex: 'Microsoft.Provider').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The parent path (Ex: 'resA/myA/resB/myB').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
If an ID is given, other resource arguments should not be given.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The resource type (Ex: 'resC'). Can also accept namespace/type format (Ex: 'Microsoft.Provider/resC').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az resource lock show
Show the details of a resource-level lock.
az resource lock show [--ids]
[--name]
[--namespace]
[--parent]
[--resource --resource-name]
[--resource-group]
[--resource-type]
Examples
Show a resource level lock
az resource lock show -n lockname -g MyResourceGroup --resource myvnet --resource-type Microsoft.Network/virtualNetworks
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). If provided, no other "Resource Id" arguments should be specified.
Name of the lock.
Provider namespace (Ex: 'Microsoft.Provider').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The parent path (Ex: 'resA/myA/resB/myB').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
If an ID is given, other resource arguments should not be given.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The resource type (Ex: 'resC'). Can also accept namespace/type format (Ex: 'Microsoft.Provider/resC').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az resource lock update
Update a resource-level lock.
az resource lock update [--ids]
[--lock-type {CanNotDelete, ReadOnly}]
[--name]
[--namespace]
[--notes]
[--parent]
[--resource --resource-name]
[--resource-group]
[--resource-type]
Examples
Update a resource level lock with new notes and type
az resource lock update --name lockName -g MyResourceGroup --resource myvnet --resource-type Microsoft.Network/virtualNetworks --notes newNotesHere --lock-type CanNotDelete
Update a resource-level lock. (autogenerated)
az resource lock update --lock-type CanNotDelete --name lockName --namespace Microsoft.Network --resource-group MyResourceGroup --resource-name myvnet --resource-type Microsoft.Network/virtualNetworks
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). If provided, no other "Resource Id" arguments should be specified.
The type of lock restriction.
Property | Value |
---|---|
Accepted values: | CanNotDelete, ReadOnly |
Name of the lock.
Provider namespace (Ex: 'Microsoft.Provider').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Notes about this lock.
The parent path (Ex: 'resA/myA/resB/myB').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
If an ID is given, other resource arguments should not be given.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The resource type (Ex: 'resC'). Can also accept namespace/type format (Ex: 'Microsoft.Provider/resC').
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |