Management Policies - Get
Gets the managementpolicy associated with the specified storage account.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/default?api-version=2022-09-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
account
|
path | True |
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. |
management
|
path | True |
The name of the Storage Account Management Policy. It should always be 'default' |
|
resource
|
path | True |
string |
The name of the resource group within the user's subscription. The name is case insensitive. Regex pattern: |
subscription
|
path | True |
string |
The ID of the target subscription. |
api-version
|
query | True |
string |
The API version to use for this operation. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK -- Get the managementpolicy successfully. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
StorageAccountGetManagementPolicies
Sample Request
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/res7231/providers/Microsoft.Storage/storageAccounts/sto288/managementPolicies/default",
"name": "DefaultManagementPolicy",
"type": "Microsoft.Storage/storageAccounts/managementPolicies",
"properties": {
"policy": {
"rules": [
{
"enabled": true,
"name": "olcmtest",
"type": "Lifecycle",
"definition": {
"filters": {
"blobTypes": [
"blockBlob"
],
"prefixMatch": [
"olcmtestcontainer"
]
},
"actions": {
"baseBlob": {
"tierToCool": {
"daysAfterModificationGreaterThan": 30
},
"tierToArchive": {
"daysAfterModificationGreaterThan": 90
},
"delete": {
"daysAfterModificationGreaterThan": 1000
}
},
"snapshot": {
"delete": {
"daysAfterCreationGreaterThan": 30
}
}
}
}
}
]
},
"lastModifiedTime": "2018-06-08T03:01:55.7168089Z"
}
}
Definitions
Name | Description |
---|---|
Date |
Object to define snapshot and version action conditions. |
Date |
Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, daysAfterLastAccessTimeGreaterThan and daysAfterCreationGreaterThan are mutually exclusive. The daysAfterLastTierChangeGreaterThan property is only applicable for tierToArchive actions which requires daysAfterModificationGreaterThan to be set, also it cannot be used in conjunction with daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan. |
Management |
The Get Storage Account ManagementPolicies operation response. |
Management |
Actions are applied to the filtered blobs when the execution condition is met. |
Management |
Management policy action for base blob. |
Management |
An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. |
Management |
Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical AND is performed on all filters. |
Management |
The name of the Storage Account Management Policy. It should always be 'default' |
Management |
An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. |
Management |
The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. |
Management |
Management policy action for snapshot. |
Management |
Management policy action for blob version. |
Rule |
The valid value is Lifecycle |
Tag |
Blob index tag based filtering for blob objects |
DateAfterCreation
Object to define snapshot and version action conditions.
Name | Type | Description |
---|---|---|
daysAfterCreationGreaterThan |
number |
Value indicating the age in days after creation |
daysAfterLastTierChangeGreaterThan |
number |
Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. |
DateAfterModification
Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, daysAfterLastAccessTimeGreaterThan and daysAfterCreationGreaterThan are mutually exclusive. The daysAfterLastTierChangeGreaterThan property is only applicable for tierToArchive actions which requires daysAfterModificationGreaterThan to be set, also it cannot be used in conjunction with daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan.
Name | Type | Description |
---|---|---|
daysAfterCreationGreaterThan |
number |
Value indicating the age in days after blob creation. |
daysAfterLastAccessTimeGreaterThan |
number |
Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy |
daysAfterLastTierChangeGreaterThan |
number |
Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. |
daysAfterModificationGreaterThan |
number |
Value indicating the age in days after last modification |
ManagementPolicy
The Get Storage Account ManagementPolicies operation response.
Name | Type | 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 |
properties.lastModifiedTime |
string |
Returns the date and time the ManagementPolicies was last modified. |
properties.policy |
The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. |
|
type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
ManagementPolicyAction
Actions are applied to the filtered blobs when the execution condition is met.
Name | Type | Description |
---|---|---|
baseBlob |
The management policy action for base blob |
|
snapshot |
The management policy action for snapshot |
|
version |
The management policy action for version |
ManagementPolicyBaseBlob
Management policy action for base blob.
Name | Type | Description |
---|---|---|
delete |
The function to delete the blob |
|
enableAutoTierToHotFromCool |
boolean |
This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. |
tierToArchive |
The function to tier blobs to archive storage. |
|
tierToCold |
The function to tier blobs to cold storage. |
|
tierToCool |
The function to tier blobs to cool storage. |
|
tierToHot |
The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts |
ManagementPolicyDefinition
An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set.
Name | Type | Description |
---|---|---|
actions |
An object that defines the action set. |
|
filters |
An object that defines the filter set. |
ManagementPolicyFilter
Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical AND is performed on all filters.
Name | Type | Description |
---|---|---|
blobIndexMatch |
An array of blob index tag based filters, there can be at most 10 tag filters |
|
blobTypes |
string[] |
An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are supported for appendBlob. |
prefixMatch |
string[] |
An array of strings for prefixes to be match. |
ManagementPolicyName
The name of the Storage Account Management Policy. It should always be 'default'
Name | Type | Description |
---|---|---|
default |
string |
ManagementPolicyRule
An object that wraps the Lifecycle rule. Each rule is uniquely defined by name.
Name | Type | Description |
---|---|---|
definition |
An object that defines the Lifecycle rule. |
|
enabled |
boolean |
Rule is enabled if set to true. |
name |
string |
A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. |
type |
The valid value is Lifecycle |
ManagementPolicySchema
The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
Name | Type | Description |
---|---|---|
rules |
The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. |
ManagementPolicySnapShot
Management policy action for snapshot.
Name | Type | Description |
---|---|---|
delete |
The function to delete the blob snapshot |
|
tierToArchive |
The function to tier blob snapshot to archive storage. |
|
tierToCold |
The function to tier blobs to cold storage. |
|
tierToCool |
The function to tier blob snapshot to cool storage. |
|
tierToHot |
The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts |
ManagementPolicyVersion
Management policy action for blob version.
Name | Type | Description |
---|---|---|
delete |
The function to delete the blob version |
|
tierToArchive |
The function to tier blob version to archive storage. |
|
tierToCold |
The function to tier blobs to cold storage. |
|
tierToCool |
The function to tier blob version to cool storage. |
|
tierToHot |
The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts |
RuleType
The valid value is Lifecycle
Name | Type | Description |
---|---|---|
Lifecycle |
string |
TagFilter
Blob index tag based filtering for blob objects
Name | Type | Description |
---|---|---|
name |
string |
This is the filter tag name, it can have 1 - 128 characters |
op |
string |
This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently supported |
value |
string |
This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters |