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/logs/data-retention-archive.md
+70-1Lines changed: 70 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,8 @@ If you change the archive settings on a table with existing data, the relevant d
53
53
54
54
You can set a Log Analytics workspace's default retention in the Azure portal to 30, 31, 60, 90, 120, 180, 270, 365, 550, and 730 days. You can apply a different setting to specific tables by [configuring retention and archive at the table level](#configure-retention-and-archive-at-the-table-level). If you're on the *free* tier, you need to upgrade to the paid tier to change the data retention period.
55
55
56
+
# [Portal](#tab/portal-3)
57
+
56
58
To set the default workspace retention:
57
59
58
60
1. From the **Log Analytics workspaces** menu in the Azure portal, select your workspace.
@@ -63,6 +65,73 @@ To set the default workspace retention:
63
65
64
66
1. Move the slider to increase or decrease the number of days, and then select **OK**.
65
67
68
+
# [API](#tab/api-3)
69
+
70
+
To set the retention and archive duration for a table, call the [Workspaces - Update API](/rest/api/azureml/workspaces/update):
The request body includes the values in the following table.
79
+
80
+
|Name | Type | Description |
81
+
| --- | --- | --- |
82
+
|properties.retentionInDays | integer | The workspace data retention in days. Allowed values are per pricing plan. See pricing tiers documentation for details. |
83
+
84
+
**Example**
85
+
86
+
This example sets the workspace's retention to the workspace default of 30 days.
To set the retention and archive duration for a table, run the [az monitor log-analytics workspace update](/cli/azure/monitor/log-analytics/workspace/#az-monitor-log-analytics-workspace-update) command and pass the `--retention-time` parameter.
119
+
120
+
This example sets the table's interactive retention to 30 days, and the total retention to two years, which means that the archive duration is 23 months:
Use the [Set-AzOperationalInsightsWorkspace](/powershell/module/az.operationalinsights/Set-AzOperationalInsightsWorkspace) cmdlet to set the retention for a workspace. This example sets the workspace's retention to 30 days:
## Configure retention and archive at the table level
67
136
68
137
By default, all tables in your workspace inherit the workspace's interactive retention setting and have no archive. You can modify the retention and archive settings of individual tables, except for workspaces in the legacy Free Trial pricing tier.
@@ -90,7 +159,7 @@ To set the retention and archive duration for a table in the Azure portal:
90
159
91
160
# [API](#tab/api-1)
92
161
93
-
To set the retention and archive duration for a table, call the **Tables - Update** API:
162
+
To set the retention and archive duration for a table, call the [Tables - Update API](/rest/api/loganalytics/tables/update):
0 commit comments