Dijeli putem


az group lock

Manage Azure resource group locks.

Commands

Name Description Type Status
az group lock create

Create a resource group lock.

Core GA
az group lock delete

Delete a resource group lock.

Core GA
az group lock list

List lock information in the resource-group.

Core GA
az group lock show

Show the details of a resource group lock.

Core GA
az group lock update

Update a resource group lock.

Core GA

az group lock create

Create a resource group lock.

az group lock create --lock-type {CanNotDelete, ReadOnly}
                     --name
                     --resource-group
                     [--notes]

Examples

Create a read-only resource group level lock.

az group lock create --lock-type ReadOnly -n lockName -g MyResourceGroup

Required Parameters

--lock-type -t

The type of lock restriction.

Accepted values: CanNotDelete, ReadOnly
--name -n

Name of the lock.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--notes

Notes about this lock.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group lock delete

Delete a resource group lock.

az group lock delete [--ids]
                     [--name]
                     [--resource-group]

Examples

Delete a resource group lock

az group lock delete --name lockName -g MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other "Resource Id" arguments should be specified.

--name -n

Name of the lock.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group lock list

List lock information in the resource-group.

az group lock list --resource-group
                   [--filter-string]

Examples

List out all locks on the resource group level

az group lock list -g MyResourceGroup

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--filter-string

A query filter to use to restrict the results.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group lock show

Show the details of a resource group lock.

az group lock show [--ids]
                   [--name]
                   [--resource-group]

Examples

Show a resource group level lock

az group lock show -n lockname -g MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other "Resource Id" arguments should be specified.

--name -n

Name of the lock.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az group lock update

Update a resource group lock.

az group lock update [--ids]
                     [--lock-type {CanNotDelete, ReadOnly}]
                     [--name]
                     [--notes]
                     [--resource-group]

Examples

Update a resource group lock with new notes and type

az group lock update --name lockName -g MyResourceGroup --notes newNotesHere --lock-type CanNotDelete

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other "Resource Id" arguments should be specified.

--lock-type -t

The type of lock restriction.

Accepted values: CanNotDelete, ReadOnly
--name -n

Name of the lock.

--notes

Notes about this lock.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.