Skip to main content

management_policies

Creates, updates, deletes, gets or lists a management_policies resource.

Overview

Namemanagement_policies
TypeResource
Idazure.storage.management_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
lastModifiedTimestring (date-time)Returns the date and time the ManagementPolicies was last modified.
policyobjectThe Storage Account ManagementPolicy, in JSON format. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview _. Required.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, account_name, management_policy_name, subscription_idGets the managementpolicy associated with the specified storage account.
create_or_updateinsertresource_group_name, account_name, management_policy_name, subscription_idSets the managementpolicy to the specified storage account.
create_or_updatereplaceresource_group_name, account_name, management_policy_name, subscription_idSets the managementpolicy to the specified storage account.
deletedeleteresource_group_name, account_name, management_policy_name, subscription_idDeletes 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.

NameDatatypeDescription
account_namestringThe 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_namestringThe name of the Storage Account Management Policy. It should always be 'default'. "default" Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

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

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
;

REPLACE examples

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

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
;