az account lock

Manage Azure subscription level locks.

Commands

az account lock create

Create a subscription lock.

az account lock delete

Delete a subscription lock.

az account lock list

List lock information in the subscription.

az account lock show

Show the details of a subscription lock.

az account lock update

Update a subscription lock.

az account lock create

Create a subscription lock.

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

Examples

Create a read-only subscription level lock.

az account lock create --lock-type ReadOnly -n lockName

Required Parameters

--lock-type -t

The type of lock restriction.

accepted values: CanNotDelete, ReadOnly
--name -n

Name of the lock.

Optional Parameters

--notes

Notes about this lock.

az account lock delete

Delete a subscription lock.

az account lock delete [--ids]
                       [--name]

Examples

Delete a subscription lock

az account lock delete --name lockName

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.

az account lock list

List lock information in the subscription.

az account lock list [--filter-string]
                     [--query-examples]

Examples

List out all locks on the subscription level

az account lock list

Optional Parameters

--filter-string

A query filter to use to restrict the results.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

az account lock show

Show the details of a subscription lock.

az account lock show [--ids]
                     [--name]
                     [--query-examples]

Examples

Show a subscription level lock

az account lock show -n lockname

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.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

az account lock update

Update a subscription lock.

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

Examples

Update a subscription lock with new notes and type

az account lock update --name lockName --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.