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
@@ -29,7 +29,7 @@ Consider a scenario where data gets frequent access during the early stages of t
29
29
30
30
## Availability and pricing
31
31
32
-
The lifecycle management feature is available in all Azure regions for General Purpose v2 (GPv2) accounts, Blob storage accounts, and Premium Block Blob storage accounts. In the Azure portal, you can upgrade an existing General Purpose (GPv1) account to a GPv2 account. For more information about storage accounts, see [Azure storage account overview](../common/storage-account-overview.md).
32
+
The lifecycle management feature is available in all Azure regions for General Purpose v2 (GPv2) accounts, Blob storage accounts, and Premium Block Blob storage accounts. In the Azure portal, you can upgrade an existing General Purpose (GPv1) account to a GPv2 account. For more information about storage accounts, see [Azure storage account overview](../common/storage-account-overview.md).
33
33
34
34
The lifecycle management feature is free of charge. Customers are charged the regular operation cost for the [Set Blob Tier](https://docs.microsoft.com/rest/api/storageservices/set-blob-tier) API calls. Delete operation is free. For more information about pricing, see [Block Blob pricing](https://azure.microsoft.com/pricing/details/storage/blobs/).
35
35
@@ -47,7 +47,7 @@ A policy can be read or written in full. Partial updates are not supported.
47
47
> [!NOTE]
48
48
> If you enable firewall rules for your storage account, lifecycle management requests may be blocked. You can unblock these requests by providing exceptions for trusted Microsoft services. For more information, see the Exceptions section in [Configure firewalls and virtual networks](https://docs.microsoft.com/azure/storage/common/storage-network-security#exceptions).
49
49
50
-
This article shows how to manage policy by using the portal and PowerShell methods.
50
+
This article shows how to manage policy by using the portal and PowerShell methods.
51
51
52
52
# [Portal](#tab/azure-portal)
53
53
@@ -60,64 +60,78 @@ There are two ways to add a policy through the Azure portal.
60
60
61
61
1. Sign in to the [Azure portal](https://portal.azure.com).
62
62
63
-
2. In the Azure portal, search for and select your storage account.
63
+
1. In the Azure portal, search for and select your storage account.
64
64
65
-
3. Under **Blob Service**, select **Lifecycle management** to view or change your rules.
65
+
1. Under **Blob service**, select **Lifecycle Management** to view or change your rules.
66
66
67
-
4. Select the **List view** tab.
67
+
1. Select the **List View** tab.
68
68
69
-
5. Select **Add rule** and then fill out the **Action set** form fields. In the following example, blobs are moved to cool storage if they haven't been modified for 30 days.
69
+
1. Select **Add a rule** and name your rule on the **Details** form. You can also set the **Rule scope**, **Blob type**, and **Blob subtype** values. The following example sets the scope to filter blobs. This causes the **Filter set** tab to be added.
70
70
71
-

71
+
:::image type="content" source="media/storage-lifecycle-management-concepts/lifecycle-management-details.png" alt-text="Lifecycle management add a rule details page in Azure portal":::
72
72
73
-
6. Select **Filter set** to add an optional filter. Then, select **Browse**to specify a container and folder by which to filter.
73
+
1. Select **Base blobs** to set the conditions for your rule. In the following example, blobs are moved to cool storage if they haven't been modified for 30 days.
74
74
75
-

75
+
:::image type="content" source="media/storage-lifecycle-management-concepts/lifecycle-management-base-blobs.png" alt-text="Lifecycle management base blobs page in Azure portal":::
76
76
77
-
8. Select **Review + add**to review the policy settings.
77
+
The **Last accessed**option is available in preview in the following regions:
78
78
79
-
9. Select **Add** to add the new policy.
79
+
- France Central
80
+
- Canada East
81
+
- Canada Central
82
+
83
+
> [!IMPORTANT]
84
+
> The last access time tracking preview is for non-production use only. Production service-level agreements (SLAs) are not currently available.
85
+
86
+
For more information about the **Last accessed** option, see [Move data based on last accessed date (preview)](#move-data-based-on-last-accessed-date-preview).
87
+
88
+
1. If you selected **Limit blobs with filters** on the **Details** page, select **Filter set** to add an optional filter. The following example filters on blobs in the *mylifecyclecontainer* container that begin with "log".
89
+
90
+
:::image type="content" source="media/storage-lifecycle-management-concepts/lifecycle-management-filter-set.png" alt-text="Lifecycle management filter set page in Azure portal":::
91
+
92
+
1. Select **Add** to add the new policy.
80
93
81
94
#### Azure portal Code view
82
95
1. Sign in to the [Azure portal](https://portal.azure.com).
83
96
84
-
2. In the Azure portal, search for and select your storage account.
97
+
1. In the Azure portal, search for and select your storage account.
85
98
86
-
3. Under **Blob Service**, select **Lifecycle management** to view or change your policy.
99
+
1. Under **Blob service**, select **Lifecycle Management** to view or change your policy.
87
100
88
-
4. The following JSON is an example of a policy that can be pasted into the **Code view** tab.
101
+
1. The following JSON is an example of a policy that can be pasted into the **Code View** tab.
| blobTypes | An array of predefined enum values. | The current release supports `blockBlob`. | Yes |
287
-
| 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 |
300
+
| blobTypes | An array of predefined enum values. | The current release supports `blockBlob` and `appendBlob`. Only delete is supported for `appendBlob`, set tier is not supported. | Yes |
301
+
| 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 |
288
302
| 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 |
289
303
290
304
> [!NOTE]
@@ -296,21 +310,23 @@ Actions are applied to the filtered blobs when the run condition is met.
296
310
297
311
Lifecycle management supports tiering and deletion of blobs and deletion of blob snapshots. Define at least one action for each rule on blobs or blob snapshots.
| tierToCool | Support blobs currently at hot tier | Not supported |
316
+
| enableAutoTierToHotFromCool | Support blobs currently at cool tier | Not supported |
317
+
| tierToArchive | Support blobs currently at hot or cool tier | Not supported |
318
+
| delete | Supported for `blockBlob` and `appendBlob`| Supported |
304
319
305
320
>[!NOTE]
306
321
>If you define more than one action on the same blob, lifecycle management applies the least expensive action to the blob. For example, action `delete` is cheaper than action `tierToArchive`. Action `tierToArchive` is cheaper than action `tierToCool`.
307
322
308
323
The run conditions are based on age. Base blobs use the last modified time to track age, and blob snapshots use the snapshot creation time to track age.
309
324
310
-
| Action run condition | Condition value | Description |
| daysAfterModificationGreaterThan | Integer value indicating the age in days | The condition for base blob actions |
328
+
| daysAfterCreationGreaterThan | Integer value indicating the age in days | The condition for blob snapshot actions |
329
+
| daysAfterLastAccessTimeGreaterThan | Integer value indicating the age in days | (preview) The condition for base blob actions when last accessed time is enabled |
314
330
315
331
## Examples
316
332
@@ -344,6 +360,69 @@ This example shows how to transition block blobs prefixed with `container1/foo`
344
360
}
345
361
```
346
362
363
+
### Move data based on last accessed date (preview)
364
+
365
+
You can enable last access time tracking to keep a record of when your blob is last read or written. You can use last access time as a filter to manage tiering and retention of your blob data.
366
+
367
+
The **Last accessed** option is available in preview in the following regions:
368
+
369
+
- France Central
370
+
- Canada East
371
+
- Canada Central
372
+
373
+
> [!IMPORTANT]
374
+
> The last access time tracking preview is for non-production use only. Production service-level agreements (SLAs) are not currently available.
375
+
376
+
#### How last access time tracking works
377
+
378
+
When last access time tracking is enabled, the blob property called `LastAccessTime` is updated when a blob is read or written. A [Get Blob](/rest/api/storageservices/get-blob) operation is considered an access operation. [Get Blob Properties](/rest/api/storageservices/get-blob-properties), [Get Blob Metadata](/rest/api/storageservices/get-blob-metadata), and [Get Blob Tags](/rest/api/storageservices/get-blob-tags) are not access operations, and therefore don't update the last access time.
379
+
380
+
To minimize the impact on read access latency, only the first read of the last 24 hours updates the last access time. Subsequent reads in the same 24-hour period do not update the last access time. If a blob is modified between reads, the last access time is the more recent of the two values.
381
+
382
+
In the following example, blobs are moved to cool storage if they haven't been accessed for 30 days. The `enableAutoTierToHotFromCool` property is a Boolean value that indicates if a blob should automatically be tiered from cool back to hot if it is accessed again after being tiered to cool.
383
+
384
+
```json
385
+
{
386
+
"enabled": true,
387
+
"name": "last-accessed-thirty-days-ago",
388
+
"type": "Lifecycle",
389
+
"definition": {
390
+
"actions": {
391
+
"baseBlob": {
392
+
"enableAutoTierToHotFromCool": true,
393
+
"tierToCool": {
394
+
"daysAfterLastAccessTimeGreaterThan": 30
395
+
}
396
+
}
397
+
},
398
+
"filters": {
399
+
"blobTypes": [
400
+
"blockBlob"
401
+
],
402
+
"prefixMatch": [
403
+
"mylifecyclecontainer/log"
404
+
]
405
+
}
406
+
}
407
+
}
408
+
```
409
+
410
+
#### Storage account support
411
+
412
+
Last access time tracking is available for the following types of storage accounts:
413
+
414
+
- General-purpose v2 storage accounts
415
+
- Block blob storage accounts
416
+
- Blob storage accounts
417
+
418
+
If your storage account is a general-purpose v1 account, use the Azure portal to upgrade to a general-purpose v2 account.
419
+
420
+
Storage accounts with a hierarchical namespace enabled for use with Azure Data Lake Storage Gen2 are not yet supported.
421
+
422
+
#### Pricing and billing
423
+
424
+
Each last access time update is considered an [other operation](https://azure.microsoft.com/pricing/details/storage/blobs/).
425
+
347
426
### Archive data after ingest
348
427
349
428
Some data stays idle in the cloud and is rarely, if ever, accessed once stored. The following lifecycle policy is configured to archive data shortly after it is ingested. This example transitions block blobs in the storage account within container `archivecontainer` into an archive tier. The transition is accomplished by acting on blobs 0 days after last modified time:
@@ -466,13 +545,16 @@ For data that is modified and accessed regularly throughout its lifetime, snapsh
466
545
467
546
## FAQ
468
547
469
-
**I created a new policy, why do the actions not run immediately?**
470
-
The platform runs the lifecycle policy once a day. Once you configure a policy, it can take up to 24 hours for some actions to run for the first time.
548
+
**I created a new policy, why do the actions not run immediately?**
549
+
550
+
The platform runs the lifecycle policy once a day. Once you configure a policy, it can take up to 24 hours for some actions to run for the first time.
551
+
552
+
**If I update an existing policy, how long does it take for the actions to run?**
553
+
554
+
The updated policy takes up to 24 hours to go into effect. Once the policy is in effect, it could take up to 24 hours for the actions to run. Therefore, the policy actions may take up to 48 hours to complete.
471
555
472
-
**If I update an existing policy, how long does it take for the actions to run?**
473
-
The updated policy takes up to 24 hours to go into effect. Once the policy is in effect, it could take up to 24 hours for the actions to run. Therefore, the policy actions may take up to 48 hours to complete.
556
+
**I manually rehydrated an archived blob, how do I prevent it from being moved back to the Archive tier temporarily?**
474
557
475
-
**I manually rehydrated an archived blob, how do I prevent it from being moved back to the Archive tier temporarily?**
476
558
When a blob is moved from one access tier to another, its last modification time doesn't change. If you manually rehydrate an archived blob to hot tier, it would be moved back to archive tier by the lifecycle management engine. Disable the rule that affects this blob temporarily to prevent it from being archived again. Re-enable the rule when the blob can be safely moved back to archive tier. You may also copy the blob to another location if it needs to stay in hot or cool tier permanently.
0 commit comments