management_locks
Creates, updates, deletes, gets or lists a management_locks resource.
Overview
| Name | management_locks |
| Type | Resource |
| Id | azure.resource.management_locks |
Fields
The following fields are returned by SELECT queries:
- get_at_resource_level
- list_at_resource_level
- get_at_resource_group_level
- list_at_resource_group_level
- get_by_scope
- get_at_subscription_level
- list_by_scope
- list_at_subscription_level
| Name | Datatype | Description |
|---|---|---|
id | string | The resource ID of the lock. |
name | string | The name of the lock. |
level | string | The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. Required. Known values are: "NotSpecified", "CanNotDelete", and "ReadOnly". |
notes | string | Notes about the lock. Maximum of 512 characters. |
owners | array | The owners of the lock. |
type | string | The resource type of the lock - Microsoft.Authorization/locks. |
| Name | Datatype | Description |
|---|---|---|
id | string | The resource ID of the lock. |
name | string | The name of the lock. |
level | string | The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. Required. Known values are: "NotSpecified", "CanNotDelete", and "ReadOnly". |
notes | string | Notes about the lock. Maximum of 512 characters. |
owners | array | The owners of the lock. |
type | string | The resource type of the lock - Microsoft.Authorization/locks. |
| Name | Datatype | Description |
|---|---|---|
id | string | The resource ID of the lock. |
name | string | The name of the lock. |
level | string | The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. Required. Known values are: "NotSpecified", "CanNotDelete", and "ReadOnly". |
notes | string | Notes about the lock. Maximum of 512 characters. |
owners | array | The owners of the lock. |
type | string | The resource type of the lock - Microsoft.Authorization/locks. |
| Name | Datatype | Description |
|---|---|---|
id | string | The resource ID of the lock. |
name | string | The name of the lock. |
level | string | The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. Required. Known values are: "NotSpecified", "CanNotDelete", and "ReadOnly". |
notes | string | Notes about the lock. Maximum of 512 characters. |
owners | array | The owners of the lock. |
type | string | The resource type of the lock - Microsoft.Authorization/locks. |
| Name | Datatype | Description |
|---|---|---|
id | string | The resource ID of the lock. |
name | string | The name of the lock. |
level | string | The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. Required. Known values are: "NotSpecified", "CanNotDelete", and "ReadOnly". |
notes | string | Notes about the lock. Maximum of 512 characters. |
owners | array | The owners of the lock. |
type | string | The resource type of the lock - Microsoft.Authorization/locks. |
| Name | Datatype | Description |
|---|---|---|
id | string | The resource ID of the lock. |
name | string | The name of the lock. |
level | string | The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. Required. Known values are: "NotSpecified", "CanNotDelete", and "ReadOnly". |
notes | string | Notes about the lock. Maximum of 512 characters. |
owners | array | The owners of the lock. |
type | string | The resource type of the lock - Microsoft.Authorization/locks. |
| Name | Datatype | Description |
|---|---|---|
id | string | The resource ID of the lock. |
name | string | The name of the lock. |
level | string | The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. Required. Known values are: "NotSpecified", "CanNotDelete", and "ReadOnly". |
notes | string | Notes about the lock. Maximum of 512 characters. |
owners | array | The owners of the lock. |
type | string | The resource type of the lock - Microsoft.Authorization/locks. |
| Name | Datatype | Description |
|---|---|---|
id | string | The resource ID of the lock. |
name | string | The name of the lock. |
level | string | The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. Required. Known values are: "NotSpecified", "CanNotDelete", and "ReadOnly". |
notes | string | Notes about the lock. Maximum of 512 characters. |
owners | array | The owners of the lock. |
type | string | The resource type of the lock - Microsoft.Authorization/locks. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_at_resource_level | select | resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, subscription_id | Get the management lock of a resource or any level below resource. | |
list_at_resource_level | select | resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, subscription_id | $filter | Gets all the management locks for a resource or any level below resource. |
get_at_resource_group_level | select | resource_group_name, lock_name, subscription_id | Gets a management lock at the resource group level. | |
list_at_resource_group_level | select | resource_group_name, subscription_id | $filter | Gets all the management locks for a resource group. |
get_by_scope | select | scope, lock_name | Get a management lock by scope. | |
get_at_subscription_level | select | lock_name, subscription_id | Gets a management lock at the subscription level. | |
list_by_scope | select | scope | $filter | Gets all the management locks for a scope. |
list_at_subscription_level | select | subscription_id | $filter | Gets all the management locks for a subscription. |
create_or_update_at_resource_level | insert | resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, subscription_id, properties | Creates or updates a management lock at the resource level or any level below the resource. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. | |
create_or_update_at_resource_group_level | insert | resource_group_name, lock_name, subscription_id, properties | Creates or updates a management lock at the resource group level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. | |
create_or_update_by_scope | insert | scope, lock_name, properties | Create or update a management lock by scope. | |
create_or_update_at_subscription_level | insert | lock_name, subscription_id, properties | Creates or updates a management lock at the subscription level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. | |
create_or_update_at_resource_level | replace | resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, subscription_id, properties | Creates or updates a management lock at the resource level or any level below the resource. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. | |
create_or_update_at_resource_group_level | replace | resource_group_name, lock_name, subscription_id, properties | Creates or updates a management lock at the resource group level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. | |
create_or_update_by_scope | replace | scope, lock_name, properties | Create or update a management lock by scope. | |
create_or_update_at_subscription_level | replace | lock_name, subscription_id, properties | Creates or updates a management lock at the subscription level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. | |
delete_at_resource_level | delete | resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, subscription_id | Deletes the management lock of a resource or any level below the resource. To delete management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. | |
delete_at_resource_group_level | delete | resource_group_name, lock_name, subscription_id | Deletes a management lock at the resource group level. To delete management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. | |
delete_by_scope | delete | scope, lock_name | Delete a management lock by scope. | |
delete_at_subscription_level | delete | lock_name, subscription_id | Deletes the management lock at the subscription level. To delete management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
lock_name | string | The name of lock to delete. Required. |
parent_resource_path | string | The parent resource identity. Required. |
resource_group_name | string | The name of the resource group containing the lock. Required. |
resource_name | string | The name of the resource with the lock to delete. Required. |
resource_provider_namespace | string | The resource provider namespace of the resource with the lock to delete. Required. |
resource_type | string | The resource type of the resource with the lock to delete. Required. |
scope | string | The scope for the lock. Required. |
subscription_id | string | |
$filter | string | The filter to apply on the operation. Default value is None. |
SELECT examples
- get_at_resource_level
- list_at_resource_level
- get_at_resource_group_level
- list_at_resource_group_level
- get_by_scope
- get_at_subscription_level
- list_by_scope
- list_at_subscription_level
Get the management lock of a resource or any level below resource.
SELECT
id,
name,
level,
notes,
owners,
type
FROM azure.resource.management_locks
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_provider_namespace = '{{ resource_provider_namespace }}' -- required
AND parent_resource_path = '{{ parent_resource_path }}' -- required
AND resource_type = '{{ resource_type }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND lock_name = '{{ lock_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets all the management locks for a resource or any level below resource.
SELECT
id,
name,
level,
notes,
owners,
type
FROM azure.resource.management_locks
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_provider_namespace = '{{ resource_provider_namespace }}' -- required
AND parent_resource_path = '{{ parent_resource_path }}' -- required
AND resource_type = '{{ resource_type }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
;
Gets a management lock at the resource group level.
SELECT
id,
name,
level,
notes,
owners,
type
FROM azure.resource.management_locks
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lock_name = '{{ lock_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets all the management locks for a resource group.
SELECT
id,
name,
level,
notes,
owners,
type
FROM azure.resource.management_locks
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
;
Get a management lock by scope.
SELECT
id,
name,
level,
notes,
owners,
type
FROM azure.resource.management_locks
WHERE scope = '{{ scope }}' -- required
AND lock_name = '{{ lock_name }}' -- required
;
Gets a management lock at the subscription level.
SELECT
id,
name,
level,
notes,
owners,
type
FROM azure.resource.management_locks
WHERE lock_name = '{{ lock_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets all the management locks for a scope.
SELECT
id,
name,
level,
notes,
owners,
type
FROM azure.resource.management_locks
WHERE scope = '{{ scope }}' -- required
AND $filter = '{{ $filter }}'
;
Gets all the management locks for a subscription.
SELECT
id,
name,
level,
notes,
owners,
type
FROM azure.resource.management_locks
WHERE subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
;
INSERT examples
- create_or_update_at_resource_level
- create_or_update_at_resource_group_level
- create_or_update_by_scope
- create_or_update_at_subscription_level
- Manifest
Creates or updates a management lock at the resource level or any level below the resource. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
INSERT INTO azure.resource.management_locks (
properties,
resource_group_name,
resource_provider_namespace,
parent_resource_path,
resource_type,
resource_name,
lock_name,
subscription_id
)
SELECT
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ resource_provider_namespace }}',
'{{ parent_resource_path }}',
'{{ resource_type }}',
'{{ resource_name }}',
'{{ lock_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
type
;
Creates or updates a management lock at the resource group level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
INSERT INTO azure.resource.management_locks (
properties,
resource_group_name,
lock_name,
subscription_id
)
SELECT
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ lock_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
type
;
Create or update a management lock by scope.
INSERT INTO azure.resource.management_locks (
properties,
scope,
lock_name
)
SELECT
'{{ properties }}' /* required */,
'{{ scope }}',
'{{ lock_name }}'
RETURNING
id,
name,
properties,
type
;
Creates or updates a management lock at the subscription level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
INSERT INTO azure.resource.management_locks (
properties,
lock_name,
subscription_id
)
SELECT
'{{ properties }}' /* required */,
'{{ lock_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
type
;
# Description fields are for documentation purposes
- name: management_locks
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the management_locks resource.
- name: resource_provider_namespace
value: "{{ resource_provider_namespace }}"
description: Required parameter for the management_locks resource.
- name: parent_resource_path
value: "{{ parent_resource_path }}"
description: Required parameter for the management_locks resource.
- name: resource_type
value: "{{ resource_type }}"
description: Required parameter for the management_locks resource.
- name: resource_name
value: "{{ resource_name }}"
description: Required parameter for the management_locks resource.
- name: lock_name
value: "{{ lock_name }}"
description: Required parameter for the management_locks resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the management_locks resource.
- name: scope
value: "{{ scope }}"
description: Required parameter for the management_locks resource.
- name: properties
value:
level: "{{ level }}"
notes: "{{ notes }}"
owners:
- applicationId: "{{ applicationId }}"
REPLACE examples
- create_or_update_at_resource_level
- create_or_update_at_resource_group_level
- create_or_update_by_scope
- create_or_update_at_subscription_level
Creates or updates a management lock at the resource level or any level below the resource. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
REPLACE azure.resource.management_locks
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND resource_provider_namespace = '{{ resource_provider_namespace }}' --required
AND parent_resource_path = '{{ parent_resource_path }}' --required
AND resource_type = '{{ resource_type }}' --required
AND resource_name = '{{ resource_name }}' --required
AND lock_name = '{{ lock_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
properties,
type;
Creates or updates a management lock at the resource group level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
REPLACE azure.resource.management_locks
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lock_name = '{{ lock_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
properties,
type;
Create or update a management lock by scope.
REPLACE azure.resource.management_locks
SET
properties = '{{ properties }}'
WHERE
scope = '{{ scope }}' --required
AND lock_name = '{{ lock_name }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
properties,
type;
Creates or updates a management lock at the subscription level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
REPLACE azure.resource.management_locks
SET
properties = '{{ properties }}'
WHERE
lock_name = '{{ lock_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
properties,
type;
DELETE examples
- delete_at_resource_level
- delete_at_resource_group_level
- delete_by_scope
- delete_at_subscription_level
Deletes the management lock of a resource or any level below the resource. To delete management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
DELETE FROM azure.resource.management_locks
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND resource_provider_namespace = '{{ resource_provider_namespace }}' --required
AND parent_resource_path = '{{ parent_resource_path }}' --required
AND resource_type = '{{ resource_type }}' --required
AND resource_name = '{{ resource_name }}' --required
AND lock_name = '{{ lock_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Deletes a management lock at the resource group level. To delete management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
DELETE FROM azure.resource.management_locks
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND lock_name = '{{ lock_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Delete a management lock by scope.
DELETE FROM azure.resource.management_locks
WHERE scope = '{{ scope }}' --required
AND lock_name = '{{ lock_name }}' --required
;
Deletes the management lock at the subscription level. To delete management locks, you must have access to Microsoft.Authorization/\ * or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
DELETE FROM azure.resource.management_locks
WHERE lock_name = '{{ lock_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;