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/azure-monitor/essentials/migrate-to-azure-storage-lifecycle-policy.md
+15-17Lines changed: 15 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.author: edbaynash
6
6
ms.service: azure-monitor
7
7
ms.topic: how-to
8
8
ms.reviewer: lualderm
9
-
ms.date: 08/16/2023
9
+
ms.date: 09/02/2024
10
10
11
11
#Customer intent: As a dev-ops administrator I want to migrate my retention setting from diagnostic setting retention storage to Azure Storage lifecycle management so that it continues to work after the feature has been deprecated.
12
12
---
@@ -23,43 +23,41 @@ For logs sent to a Log Analytics workspace, retention is set for each table on t
23
23
> - March 31, 2023 – The Diagnostic Settings Storage Retention feature will no longer be available to configure new retention rules for log data. This includes using the portal, CLI PowerShell, and ARM and Bicep templates. If you have configured retention settings, you'll still be able to see and change them in the portal.
24
24
> - September 30, 2025 – All retention functionality for the Diagnostic Settings Storage Retention feature will be disabled across all environments.
25
25
26
-
27
-
28
26
## Prerequisites
29
27
30
28
An existing diagnostic setting logging to a storage account.
31
29
32
-
## Migration Procedures
33
-
30
+
## Migration procedures
34
31
35
32
## [Azure portal](#tab/portal)
33
+
36
34
To migrate your diagnostics settings retention rules, follow the steps below:
37
35
38
36
1. Go to the Diagnostic Settings page for your logging resource and locate the diagnostic setting you wish to migrate
39
37
1. Set the retention for your logged categories to *0*
40
38
1. Select **Save**
41
-
:::image type="content" source="./media/retention-migration/diagnostics-setting.png" alt-text="A screenshot showing a diagnostics setting page.":::
1. Navigate to the storage account you're logging to
44
42
1. Under **Data management**, select **Lifecycle Management** to view or change lifecycle management policies
45
43
1. Select List View, and select **Add a rule**
46
-
:::image type="content" source="./media/retention-migration/lifecycle-management.png" alt-text="A screenshot showing the lifecycle management screen for a storage account.":::
44
+
:::image type="content" source="./media/retention-migration/lifecycle-management.png" lightbox="./media/retention-migration/lifecycle-management.png" alt-text="A screenshot showing the lifecycle management screen for a storage account.":::
47
45
1. Enter a **Rule name**
48
46
1. Under **Rule Scope**, select **Limit blobs with filters**
49
47
1. Under **Blob Type**, select **Append Blobs** and **Base blobs** under **Blob subtype**.
50
48
1. Select **Next**
51
-
:::image type="content" source="./media/retention-migration/lifecycle-management-add-rule-details.png" alt-text="A screenshot showing the details tab for adding a lifecycle rule.":::
49
+
:::image type="content" source="./media/retention-migration/lifecycle-management-add-rule-details.png" lightbox="./media/retention-migration/lifecycle-management-add-rule-details.png" alt-text="A screenshot showing the details tab for adding a lifecycle rule.":::
52
50
53
51
1. Set your retention time, then select **Next**
54
-
:::image type="content" source="./media/retention-migration/lifecycle-management-add-rule-base-blobs.png" alt-text="A screenshot showing the Base blobs tab for adding a lifecycle rule.":::
52
+
:::image type="content" source="./media/retention-migration/lifecycle-management-add-rule-base-blobs.png" lightbox="./media/retention-migration/lifecycle-management-add-rule-base-blobs.png" alt-text="A screenshot showing the Base blobs tab for adding a lifecycle rule.":::
55
53
56
54
1. On the **Filters** tab, under **Blob prefix** set path or prefix to the container or logs you want the retention rule to apply to. The path or prefix can be at any level within the container and will apply to all blobs under that path or prefix.
57
-
For example, for *all* insight activity logs, use the container *insights-activity-logs* to set the retention for all of the log in that container logs.
55
+
For example, for *all* insight activity logs, use the container *insights-activity-logs* to set the retention for all of the logs in that container.
58
56
To set the rule for a specific webapp app, use *insights-activity-logs/ResourceId=/SUBSCRIPTIONS/\<your subscription Id\>/RESOURCEGROUPS/\<your resource group\>/PROVIDERS/MICROSOFT.WEB/SITES/\<your webapp name\>*.
59
57
60
58
Use the Storage browser to help you find the path or prefix.
61
-
The example below shows the prefix for a specific web app: **insights-activity-logs/ResourceId=/SUBSCRIPTIONS/d05145d-4a5d-4a5d-4a5d-5267eae1bbc7/RESOURCEGROUPS/rg-001/PROVIDERS/MICROSOFT.WEB/SITES/appfromdocker1*.
62
-
To set the rule for all resources in the resource group, use *insights-activity-logs/ResourceId=/SUBSCRIPTIONS/d05145d-4a5d-4a5d-4a5d-5267eae1bbc7/RESOURCEGROUPS/rg-001*.
59
+
The example below shows the prefix for a specific web app: **insights-activity-logs/ResourceId=/SUBSCRIPTIONS/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/RESOURCEGROUPS/rg-001/PROVIDERS/MICROSOFT.WEB/SITES/appfromdocker1*.
60
+
To set the rule for all resources in the resource group, use *insights-activity-logs/ResourceId=/SUBSCRIPTIONS/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e7/RESOURCEGROUPS/rg-001*.
63
61
:::image type="content" source="./media/retention-migration/blob-prefix.png" alt-text="A screenshot showing the Storage browser and resource path." lightbox="./media/retention-migration/blob-prefix.png":::
64
62
65
63
1. Select **Add** to save the rule.
@@ -68,7 +66,7 @@ To set the rule for a specific webapp app, use *insights-activity-logs/ResourceI
68
66
69
67
## [CLI](#tab/cli)
70
68
71
-
Use the [az storage account management-policy create](/cli/azure/storage/account/management-policy#az-storage-account-management-policy-create) command to create a lifecycle management policy. You must still set the retention in your diagnostic settings to *0*. See the Azure portal section above for more information.
69
+
Use the [az storage account management-policy create](/cli/azure/storage/account/management-policy#az-storage-account-management-policy-create) command to create a lifecycle management policy. You must still set the retention in your diagnostic settings to *0*. For more information, see the migration procedures for the Azure Portal.
72
70
73
71
74
72
@@ -99,7 +97,7 @@ The sample policy definition file below sets the retention for all blobs in the
@@ -114,15 +112,15 @@ The sample policy definition file below sets the retention for all blobs in the
114
112
115
113
## [Templates](#tab/templates)
116
114
117
-
Apply the following template to create a lifecycle management policy. You must still set the retention in your diagnostic settings to *0*. See the Azure portal section above for more information.
115
+
Apply the following template to create a lifecycle management policy. You must still set the retention in your diagnostic settings to *0*. For more information, see the migration procedures for the Azure Portal.
118
116
119
117
```azurecli
120
118
121
119
az deployment group create --resource-group <resource group name> --template-file <template file>
122
120
123
121
```
124
122
125
-
The following template sets the retention for storage account *azmonstorageaccount001* for all blobs in the container *insights-activity-logs* for all resources for the subscription ID *ABCD1234-5849-ABCD-1234-9876543210AB*.
123
+
The following template sets the retention for storage account *azmonstorageaccount001* for all blobs in the container *insights-activity-logs* for all resources for the subscription ID *aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e*.
126
124
127
125
```json
128
126
{
@@ -153,7 +151,7 @@ The following template sets the retention for storage account *azmonstorageaccou
0 commit comments