> ## Documentation Index
> Fetch the complete documentation index at: https://help.nops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Move Older Log Analytics Data to Long-Term Retention

> Keep only recent Log Analytics data in interactive retention and move older data to cheaper long-term retention.

Log Analytics bills data kept in interactive (analytics) retention beyond the free period per GB each month. Long-term retention keeps the same data for much less, but it can only be read with search jobs or a restore. nOps finds workspaces that pay for interactive retention every day and estimates the saving from keeping only the free period interactive and moving the rest to long-term retention, with the same total retention.

| | |
| - | - |
| **Cloud** | Microsoft Azure |
| **Category** | Management and governance |
| **Service** | Log Analytics |
| **Action** | Modify |
| **Effort** | Low |
| **Restart needed** | No |
| **Can be rolled back** | Yes |
| **Analysis window** | Last 7 days |
| **Source** | nOps |

## Why it matters

Interactive retention is often raised to meet a compliance period, even though queries, alerts and dashboards only look at the last few weeks. Long-term retention meets the same requirement at a lower price.

## How nOps finds it

nOps reads your pay-as-you-go Log Analytics billing. A workspace is flagged when it was billed for interactive data retention on at least 13 of the last 14 complete days. The saving is the retention cost over the last 7 days, scaled to a month, times the difference between the public list prices of long-term retention and interactive retention in the workspace's region. It must be at least \$5 a month. Workspaces whose retention is mostly covered by credits or commitments are left out.

## Before you start

Know how far back your queries, alert rules, workbooks and dashboards read each table. Permission to change table settings in the workspace.

## How to implement

1. For each large table, check how many days of data your queries, alerts and workbooks actually use.
2. In the Azure portal, open the workspace, go to **Tables**, select the table and choose **Manage table**.
3. Set **Interactive retention** to what your queries need (for example, the free period) and keep **Total retention** at your required period. Or run `az monitor log-analytics workspace table update --resource-group MY_RG --workspace-name MY_WORKSPACE --name MYTABLE --retention-time 30 --total-retention-time 365`.
4. If retention is set in Terraform, Bicep or ARM templates, update them too so a later deployment does not change it back.

## Risks and considerations

* Data in long-term retention cannot be queried directly. You read it with a search job (billed per GB scanned) or a restore (billed per GB per day).
* Alerts or workbooks that look back further than the new interactive period stop seeing the older data.
* You can raise interactive retention again later. Data already moved to long-term retention becomes interactive again only for the period you set.

## FAQs

> [accordion] Does this delete any data?
>
> No. Total retention stays the same. Only the part of it that can be queried directly gets shorter.

## Related

* [Dismiss Restored Log Analytics Tables](https://help.nops.io/inform/supported-recommendations/dismiss-restored-log-analytics-tables)
* [Use a Log Analytics Dedicated Cluster Commitment Tier](https://help.nops.io/inform/supported-recommendations/use-a-log-analytics-dedicated-cluster-commitment-tier)
* [Move Azure Log Analytics Workspace to a Commitment Tier](https://help.nops.io/inform/supported-recommendations/move-azure-log-analytics-workspace-to-a-commitment-tier)
* [Supported recommendations](https://help.nops.io/inform/supported-recommendations.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.