Microsoft.Storage storageAccounts/managementPolicies 2019-04-01

Template format

To create a Microsoft.Storage/storageAccounts/managementPolicies resource, add the following JSON to the resources section of your template.

{
  "name": "default",
  "type": "Microsoft.Storage/storageAccounts/managementPolicies",
  "apiVersion": "2019-04-01",
  "properties": {
    "policy": {
      "rules": [
        {
          "enabled": "boolean",
          "name": "string",
          "type": "Lifecycle",
          "definition": {
            "actions": {
              "baseBlob": {
                "tierToCool": {
                  "daysAfterModificationGreaterThan": "number"
                },
                "tierToArchive": {
                  "daysAfterModificationGreaterThan": "number"
                },
                "delete": {
                  "daysAfterModificationGreaterThan": "number"
                }
              },
              "snapshot": {
                "delete": {
                  "daysAfterCreationGreaterThan": "number"
                }
              }
            },
            "filters": {
              "prefixMatch": [
                "string"
              ],
              "blobTypes": [
                "string"
              ]
            }
          }
        }
      ]
    }
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.Storage/storageAccounts/managementPolicies object

Note

In Bicep, type and apiVersion are specified in the first line of the resource declaration. Use the format <type>@<apiVersion>. Don't set those properties in the resource body.

Name Type Required Value
name enum Yes The name of the Storage Account Management Policy. It should always be 'default' - default
type enum Yes For JSON -managementPolicies
-or-
Microsoft.Storage/storageAccounts/managementPolicies

See Set name and type for child resources.
apiVersion enum Yes For JSON - 2019-04-01
properties object Yes Returns the Storage Account Data Policies Rules. - ManagementPolicyProperties object

ManagementPolicyProperties object

Name Type Required Value
policy object Yes The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/azure/storage/common/storage-lifecycle-managment-concepts. - ManagementPolicySchema object

ManagementPolicySchema object

Name Type Required Value
rules array Yes The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/azure/storage/common/storage-lifecycle-managment-concepts. - ManagementPolicyRule object

ManagementPolicyRule object

Name Type Required Value
enabled boolean No Rule is enabled if set to true.
name string Yes A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.
type enum Yes The valid value is Lifecycle - Lifecycle
definition object Yes An object that defines the Lifecycle rule. - ManagementPolicyDefinition object

ManagementPolicyDefinition object

Name Type Required Value
actions object Yes An object that defines the action set. - ManagementPolicyAction object
filters object No An object that defines the filter set. - ManagementPolicyFilter object

ManagementPolicyAction object

Name Type Required Value
baseBlob object No The management policy action for base blob - ManagementPolicyBaseBlob object
snapshot object No The management policy action for snapshot - ManagementPolicySnapShot object

ManagementPolicyFilter object

Name Type Required Value
prefixMatch array No An array of strings for prefixes to be match. - string
blobTypes array Yes An array of predefined enum values. Only blockBlob is supported. - string

ManagementPolicyBaseBlob object

Name Type Required Value
tierToCool object No The function to tier blobs to cool storage. Support blobs currently at Hot tier - DateAfterModification object
tierToArchive object No The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier - DateAfterModification object
delete object No The function to delete the blob - DateAfterModification object

ManagementPolicySnapShot object

Name Type Required Value
delete object No The function to delete the blob snapshot - DateAfterCreation object

DateAfterModification object

Name Type Required Value
daysAfterModificationGreaterThan number Yes Value indicating the age in days after last modification

DateAfterCreation object

Name Type Required Value
daysAfterCreationGreaterThan number Yes Value indicating the age in days after creation