You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/blobs/storage-lifecycle-management-concepts.md
+44-4Lines changed: 44 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Learn how to create lifecycle policy rules to transition aging data
4
4
author: mhopkins-msft
5
5
6
6
ms.author: mhopkins
7
-
ms.date: 05/21/2019
7
+
ms.date: 04/24/2020
8
8
ms.service: storage
9
9
ms.subservice: common
10
10
ms.topic: conceptual
@@ -20,7 +20,7 @@ The lifecycle management policy lets you:
20
20
- Transition blobs to a cooler storage tier (hot to cool, hot to archive, or cool to archive) to optimize for performance and cost
21
21
- Delete blobs at the end of their lifecycles
22
22
- Define rules to be run once per day at the storage account level
23
-
- Apply rules to containers or a subset of blobs (using prefixes as filters)
23
+
- Apply rules to containers or a subset of blobs (using name prefixes or [blob index tags](storage-manage-and-find-blobs.md) as filters)
24
24
25
25
Consider a scenario where data gets frequent access during the early stages of the lifecycle, but only occasionally after two weeks. Beyond the first month, the data set is rarely accessed. In this scenario, hot storage is best during the early stages. Cool storage is most appropriate for occasional access. Archive storage is the best tier option after the data ages over a month. By adjusting storage tiers in respect to the age of data, you can design the least expensive storage options for your needs. To achieve this transition, lifecycle management policy rules are available to move aging data to cooler tiers.
26
26
@@ -124,7 +124,7 @@ There are two ways to add a policy through the Azure portal.
124
124
125
125
6. For more information about this JSON example, see the [Policy](#policy) and [Rules](#rules) sections.
126
126
127
-
# [Powershell](#tab/azure-powershell)
127
+
# [PowerShell](#tab/azure-powershell)
128
128
129
129
The following PowerShell script can be used to add a policy to your storage account. The `$rgname` variable must be initialized with your resource group name. The `$accountName` variable must be initialized with your storage account name.
130
130
@@ -288,7 +288,11 @@ Filters include:
288
288
| Filter name | Filter type | Notes | Is Required |
| blobTypes | An array of predefined enum values. | The current release supports `blockBlob`. | Yes |
291
-
| prefixMatch | An array of strings for prefixes to be match. Each rule can define up to 10 prefixes. A prefix string must start with a container name. For example, if you want to match all blobs under `https://myaccount.blob.core.windows.net/container1/foo/...` for a rule, the prefixMatch is `container1/foo`. | If you don't define prefixMatch, the rule applies to all blobs within the storage account. | No |
291
+
| prefixMatch | An array of strings for prefixes to be matched. Each rule can define up to 10 prefixes. A prefix string must start with a container name. For example, if you want to match all blobs under `https://myaccount.blob.core.windows.net/container1/foo/...` for a rule, the prefixMatch is `container1/foo`. | If you don't define prefixMatch, the rule applies to all blobs within the storage account. | No |
292
+
| blobIndexMatch | An array of dictionary values consisting of Blob Index tag key and value conditions to be matched. Each rule can define up to 10 Blob Index tag condition. For example, if you want to match all blobs with `Project = Contoso` under `https://myaccount.blob.core.windows.net/` for a rule, the blobIndexMatch is `{"name": "Project","op": "==","value": "Contoso"}`. | If you don't define blobIndexMatch, the rule applies to all blobs within the storage account. | No |
293
+
294
+
> [!NOTE]
295
+
> Blob Index is in public preview, and is available in the **France Central** and **France South** regions. To learn more about this feature along with known issues and limitations, see [Manage and find data on Azure Blob Storage with Blob Index (Preview)](storage-manage-and-find-blobs.md).
292
296
293
297
### Rule actions
294
298
@@ -401,6 +405,42 @@ Some data is expected to expire days or months after creation. You can configure
401
405
}
402
406
```
403
407
408
+
### Delete data with Blob Index tags
409
+
Some data should only be expired if explicitly marked for deletion. You can configure a lifecycle management policy to expire data that are tagged with blob index key/value attributes. The following example shows a policy that deletes all block blobs tagged with `Project = Contoso`. To learn more about the Blob Index, see [Manage and find data on Azure Blob Storage with Blob Index (Preview)](storage-manage-and-find-blobs.md).
410
+
411
+
```json
412
+
{
413
+
"rules": [
414
+
{
415
+
"enabled": true,
416
+
"name": "DeleteContosoData",
417
+
"type": "Lifecycle",
418
+
"definition": {
419
+
"actions": {
420
+
"baseBlob": {
421
+
"delete": {
422
+
"daysAfterModificationGreaterThan": 0
423
+
}
424
+
}
425
+
},
426
+
"filters": {
427
+
"blobIndexMatch": [
428
+
{
429
+
"name": "Project",
430
+
"op": "==",
431
+
"value": "Contoso"
432
+
}
433
+
],
434
+
"blobTypes": [
435
+
"blockBlob"
436
+
]
437
+
}
438
+
}
439
+
}
440
+
]
441
+
}
442
+
```
443
+
404
444
### Delete old snapshots
405
445
406
446
For data that is modified and accessed regularly throughout its lifetime, snapshots are often used to track older versions of the data. You can create a policy that deletes old snapshots based on snapshot age. The snapshot age is determined by evaluating the snapshot creation time. This policy rule deletes block blob snapshots within container `activedata` that are 90 days or older after snapshot creation.
0 commit comments