management_policies
Creates, updates, deletes, gets or lists a management_policies resource.
Overview
| Name | management_policies |
| Type | Resource |
| Id | azure.storage.management_policies |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
lastModifiedTime | string (date-time) | Returns the date and time the ManagementPolicies was last modified. |
policy | object | The Storage Account ManagementPolicy, in JSON format. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview _. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, account_name, management_policy_name, subscription_id | Gets the managementpolicy associated with the specified storage account. | |
create_or_update | insert | resource_group_name, account_name, management_policy_name, subscription_id | Sets the managementpolicy to the specified storage account. | |
create_or_update | replace | resource_group_name, account_name, management_policy_name, subscription_id | Sets the managementpolicy to the specified storage account. | |
delete | delete | resource_group_name, account_name, management_policy_name, subscription_id | Deletes the managementpolicy associated with the specified storage account. |
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 |
|---|---|---|
account_name | string | The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. Required. |
management_policy_name | string | The name of the Storage Account Management Policy. It should always be 'default'. "default" Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
Gets the managementpolicy associated with the specified storage account.
SELECT
id,
name,
lastModifiedTime,
policy,
systemData,
type
FROM azure.storage.management_policies
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND management_policy_name = '{{ management_policy_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Sets the managementpolicy to the specified storage account.
INSERT INTO azure.storage.management_policies (
properties,
resource_group_name,
account_name,
management_policy_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ account_name }}',
'{{ management_policy_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: management_policies
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the management_policies resource.
- name: account_name
value: "{{ account_name }}"
description: Required parameter for the management_policies resource.
- name: management_policy_name
value: "{{ management_policy_name }}"
description: Required parameter for the management_policies resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the management_policies resource.
- name: properties
description: |
Returns the Storage Account Data Policies Rules.
value:
lastModifiedTime: "{{ lastModifiedTime }}"
policy:
rules:
- enabled: {{ enabled }}
name: "{{ name }}"
type: "{{ type }}"
definition:
actions:
baseBlob: "{{ baseBlob }}"
snapshot: "{{ snapshot }}"
version: "{{ version }}"
filters:
prefixMatch: "{{ prefixMatch }}"
blobTypes: "{{ blobTypes }}"
blobIndexMatch: "{{ blobIndexMatch }}"
REPLACE examples
- create_or_update
Sets the managementpolicy to the specified storage account.
REPLACE azure.storage.management_policies
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND management_policy_name = '{{ management_policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the managementpolicy associated with the specified storage account.
DELETE FROM azure.storage.management_policies
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND management_policy_name = '{{ management_policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;