Summary: Modify the retention value to save data for up to two years in Log Analytics.
Good morning everyone, Richard Rundle here, and today I want to talk about how you can choose to keep your data for up to two years in Log Analytics.
Our paid pricing plans include 30 days of data retention, but you can now increase that retention to be up to 730 days (two years)!
We’re still in the process of building the user interface (UI) and adding support for setting this through PowerShell, but we know many of you are eager to keep your data for longer. This post shows how to use Azure Resource Explorer to make the change.
Change data retention
You need to be on the Standalone or OMS pricing plan to be able to change your retention. If you are on the Free pricing plan, your retention is fixed at 7 days. If you have a workspace created prior to October 1, your retention is fixed at 30 days if you are on the Standard plan, or 365 days if you are on the Premium plan.
To move from the default of 30 days retention to a longer retention, use the following steps:
- Open https://resources.azure.com and login with the credentials you use to login to portal.azure.com
- T expand subscriptions, click the + (plus) symbol in the left pane.
- To expand the subscription click the + symbol.
- To expand resourceGroups, click the + symbol.
- Expand the resource group that contains your Log Analytics workspace. In the Azure portal, when you select your Log Analytics workspace, the properties page show you the name of the resource group.
- Expand Microsoft.OperationalInsights. If you don’t see Microsoft.OperationalInsights, there are no workspaces in this resource group. Refer to step 5 to find which resource group your workspace is in.
- Click the name of your workspace. If you don’t see your workspace, make sure that you selected the resource group. Refer to step 5 to find which resource group your workspace is in.
- To change to Read/Write mode, click Read/Write at the top of the page.
- To change to Edit mode, click the Edit button. The Get button will change its name to PUT, and the blue button will change to Cancel.
- To change the value for retentionInDays, select the text and typing a new value.
- Click the green PUT button to make the change.
- Verify that new retention value is shown.
There are two errors that you might see.
The value provided for retention is invalid
This error means that you’ve tried to change the retention on a Free, Standard, or Premium plan. You can only change the retention if the plan is Standalone or OMS. (The OMS tier will show as “pernode” in the following UI):
You can’t do this operation because you are in ‘Read Only’ mode.
This will occur if you skip Step 8.
If you are creating a new workspace by using Azure Resource Manager templates, see Manage Log Analytics using Azure Resource Manager templates to learn how to specify the length of time that you’d like to retain data.
That is all I have for you today. I would like to hear any feedback you have.
Please feel free to send me an e-mail at Richard.Rundle@microsoft.com with questions, comments, and suggestions.
Microsoft Operations Management Team