Delete and recover an Azure Log Analytics workspace - Azure Monitor (2024)

  • Article

This article explains the concept of Azure Log Analytics workspace soft-delete and how to recover a deleted workspace in a soft-delete state. It also explains how to delete a workspace permanently instead of deleting it into a soft-delete state.

Permissions required

  • To delete a Log Analytics workspace into a soft-delete state or permanently, you need microsoft.operationalinsights/workspaces/delete permissions to the workspace, as provided by the Log Analytics Contributor built-in role, for example.
  • To recover a Log Analytics workspace in a soft-delete state, you need Microsoft.OperationalInsights/workspaces/write permissions to the workspace, as provided by the Log Analytics Contributor built-in role, for example.

Considerations when you delete a workspace

When you delete a Log Analytics workspace into a soft-delete state, a soft-delete operation is performed to allow the recovery of the workspace, including its data and connected agents, within 14 days. This process occurs whether the deletion was accidental or intentional.

After the soft-delete period, the workspace resource and its data are nonrecoverable and queued for purge completely within 30 days. The workspace name is released and you can use it to create a new workspace.

Note

If you want to override the soft-delete behavior and permanently delete your workspace, follow the steps in Delete a workspace permanently.

The soft-delete operation deletes the workspace resource, and any associated users' permission is broken. If users are associated with other workspaces, they can continue using Log Analytics with those other workspaces.

Be careful when you delete a workspace because there might be important data and configuration that might negatively affect your service operation. Review what agents, solutions, and other Azure services store their data in Log Analytics, such as:

  • Management solutions.
  • Azure Automation.
  • Agents running on Windows and Linux virtual machines.
  • Agents running on Windows and Linux computers in your environment.
  • System Center Operations Manager.

Delete a workspace into a soft-delete state

The workspace delete operation removes the workspace Azure Resource Manager resource. Its configuration and data are kept for 14 days, although it will look as if the workspace is deleted. Any agents and System Center Operations Manager management groups configured to report to the workspace remain in an orphaned state during the soft-delete period. The service provides a mechanism for recovering the deleted workspace, including its data and connected resources, essentially undoing the deletion.

Note

Installed solutions and linked services like your Azure Automation account are permanently removed from the workspace at deletion time and can't be recovered. These resources should be reconfigured after the recovery operation to bring the workspace back to its previously configured state.

  • Azure portal
  • REST API
  • PowerShell
  • CLI
  1. Sign in to the Azure portal.

  2. In the Azure portal, select All services. In the list of resources, enter Log Analytics. As you begin typing, the list filters based on your input. Select Log Analytics workspaces.

  3. In the list of Log Analytics workspaces, select a workspace. Select Delete.

  4. A confirmation page appears that shows the data ingestion to the workspace over the past week.

  5. Enter the name of the workspace to confirm and then select Delete.

Recover a workspace in a soft-delete state

When you delete a Log Analytics workspace accidentally or intentionally, the service places the workspace in a soft-delete state and makes it inaccessible to any operation. The name of the deleted workspace is preserved during the soft-delete period. It can't be used to create a new workspace. After the soft-delete period, the workspace is nonrecoverable and scheduled for permanent deletion, and its name is released and can be used when creating a new workspace.

You can recover your workspace during the soft-delete period, including its data, configuration, and connected agents. The workspace recovery is performed by re-creating the Log Analytics workspace with the details of the deleted workspace, including:

  • Subscription ID
  • Resource group name
  • Workspace name
  • Region

Important

If your workspace was deleted as part of a resource group delete operation, you must first re-create the resource group.

The workspace and all its data are brought back after the recovery operation. However, solutions and linked services were permanently removed from the workspace when it was deleted into a soft-delete state. These resources should be reconfigured to bring the workspace to its previously configured state. After you recover the workspace, some of the data might not be available for query until the associated solutions are reinstalled and their schemas are added to the workspace.

  • Azure portal
  • REST API
  • PowerShell
  • CLI
  1. Sign in to the Azure portal.

  2. In the Azure portal, select All services. In the list of resources, enter Log Analytics. As you begin typing, the list filters based on your input. Select Log Analytics workspaces. You see the list of workspaces you have in the selected scope.

  3. Select Open recycle bin on the top left menu to open a page with workspaces in a soft-delete state that can be recovered.

  4. Select the workspace. Then select Recover to recover the workspace.

Delete a workspace permanently

The soft-delete method might not fit in some scenarios, such as development and testing, where you need to repeat a deployment with the same settings and workspace name. In such cases, you can permanently delete your workspace and "override" the soft-delete period. The permanent workspace delete operation releases the workspace name. You can create a new workspace by using the same name.

Important

  • Use the permanent workspace delete operation with caution because it's irreversible. You won't be able to recover your workspace and its data.
  • If the workspace you want to delete permanently is in a soft-delete state, you must first recover the workspace before you can delete it permanently.
  • Azure portal
  • REST API
  • PowerShell
  • CLI

To permanently delete a workspace by using the Azure portal:

  1. Sign in to the Azure portal.

  2. In the Azure portal, select All services. In the list of resources, enter Log Analytics. As you begin typing, the list filters based on your input. Select Log Analytics workspaces.

  3. In the list of Log Analytics workspaces, select a workspace. Select Delete.

  4. A confirmation page appears that shows the data ingestion to the workspace over the past week.

  5. Select the Delete the workspace permanently checkbox.

  6. Enter the name of the workspace to confirm and then select Delete.

Troubleshooting

Use the following section to troubleshoot issues with deleting or recovering a Log Analytics workspace.

I'm not sure if the workspace I deleted can be recovered

If you aren't sure if a deleted workspace is in a soft-delete state and can be recovered, in the Azure portal, select Open recycle bin on the Log Analytics workspaces page to see a list of soft-deleted workspaces per subscription. Permanently deleted workspaces aren't included in the list.

Resolve the "This workspace name is already in use" or "conflict" error message

If you receive one of these error messages when you create a workspace, it could be because:

  • The workspace name isn't available because it's being used by someone in your organization or another customer.

  • The workspace was deleted in the last 14 days and its name was kept reserved for the soft-delete period. To resolve, follow these steps:

    1. Recover your workspace in a soft-delete state, which allows you to delete it permanently.
    2. Permanently delete the workspace you recovered. When you delete a workspace permanently, its name is no longer reserved.
    3. Create a new workspace by using the same workspace name.

    After the deletion call is successfully completed on the back end, you can restore the workspace and finish the permanent delete operation by using one of the methods suggested earlier.

I'm receiving 204 response code with "Resource not found" when deleting a workspace

If you get a 204 response code with "Resource not found" when you delete a workspace, consecutive retries operations might have occurred. The 204 code is an empty response, which usually means that the resource doesn't exist, so the delete finished without doing anything.

I'm receiving error code 404 when attempting to recover my workspace

If you deleted your resource group and your workspace was included, you can see the deleted workspace on the Open recycle bin page in the Azure portal. The recovery operation will fail with the error code 404 because the resource group doesn't exist. Re-create your resource group and try the recovery again.

Next steps

If you need to create a new Log Analytics workspace, see Create a Log Analytics workspace.

Delete and recover an Azure Log Analytics workspace - Azure Monitor (2024)

FAQs

Delete and recover an Azure Log Analytics workspace - Azure Monitor? ›

Solution 1: Recover the Log Analytics workspace

If it has been less than 14 days (the default soft-delete period) since the workspace was deleted, recover the workspace. If it hasn't been 14 days, the workspace can't be recreated with the same name.

Could not retrieve the log analytics workspace from arm Azure? ›

Solution 1: Recover the Log Analytics workspace

If it has been less than 14 days (the default soft-delete period) since the workspace was deleted, recover the workspace. If it hasn't been 14 days, the workspace can't be recreated with the same name.

What is the solution in Azure Log Analytics Workspace? ›

Workspace configuration options let you manage all of your log data in one workspace to meet the operations, analysis, and auditing needs of different personas in your organization through: Azure Monitor features, such as built-in insights experiences, alerts, and automatic actions.

How do I retrieve my Azure logs? ›

Other methods to retrieve activity log events

You can also access activity log events by using the following methods: Use the Get-AzLog cmdlet to retrieve the activity log from PowerShell. See Azure Monitor PowerShell samples. Use az monitor activity-log to retrieve the activity log from the CLI.

What is the difference between Azure monitor Workspace and Log Analytics Workspace? ›

In conclusion, Azure Monitor and Log Analytics collectively offer a robust solution for monitoring Azure resources. While Azure Monitor provides a lot of features including aggregation of logs, real-time insights and performance metrics, Log Analytics allows advanced query capabilities and extensive log data analysis.

How do I recover a deleted Log Analytics workspace? ›

  1. Sign in to the Azure portal.
  2. In the Azure portal, select All services. In the list of resources, enter Log Analytics. ...
  3. Select Open recycle bin on the top left menu to open a page with workspaces in a soft-delete state that can be recovered.
  4. Select the workspace. Then select Recover to recover the workspace.
Aug 12, 2024

How do I monitor Log Analytics workspace? ›

To access Azure Log Analytics, you need to sign in to the Azure portal with your Azure account. Once you're signed in, you can access Log Analytics by selecting it from the list of services in the portal. To use Log Analytics, you need to create a Log Analytics workspace in your Azure subscription.

How do I uninstall Azure Log Analytics agent? ›

To remove the Log Analytics agent from an Azure VM, you can follow these steps:
  1. Sign in to the Azure portal.
  2. In the Azure portal, select Virtual Machines.
  3. From the list, select the VM that has the Log Analytics agent installed.
  4. On the left, select Extensions. ...
  5. On the extension properties page, select Uninstall.
Oct 11, 2023

How do I change my Log Analytics workspace in Azure? ›

  1. Open the Log Analytics workspaces menu and then select your workspace.
  2. On the Overview page, select change next to either Resource group or Subscription name.
  3. A new page opens with a list of resources related to the workspace. ...
  4. Select a destination Subscription and Resource group.
4 days ago

Do I need Log Analytics workspace? ›

We recommend that you send all log data to one Log Analytics workspace, unless you have specific business needs that require you to create multiple workspaces, as described in Design a Log Analytics workspace architecture. This article explains how to create a Log Analytics workspace.

How do I retrieve data from Azure? ›

Source
  1. On the lower ribbon of your KQL database, select Get Data. In the Get data window, the Source tab is selected.
  2. Select the data source from the available list. In this example, you're ingesting data from Azure storage.
May 21, 2024

Can Azure logs be deleted? ›

An Azure table holds logs from an Azure resource or data required by an Azure service or solution and can't be deleted. When you stop streaming data from the resource, service, or solution, data remains in the workspace until the end of the retention period defined for the table.

What are the different types of logs in Azure Monitor? ›

We will focus on Azure Monitor logs in this article. Within Microsoft Azure, there are two types of logs: Platform logs: the native logs of the Azure platform, made up of activity logs and resource logs. Application logs: the logs developers send from applications to Azure Monitor Logs.

What is the benefit of log analytics workspace in Azure? ›

Log Analytics is a tool in the Azure portal to edit and run log queries from data collected by Azure Monitor logs and interactively analyze their results. You can use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide various insights into your data.

What is the Azure log analytics solution? ›

Log Analytics is a tool in the Azure portal that's used to edit and run log queries against data in the Azure Monitor Logs store. You might write a simple query that returns a set of records and then use features of Log Analytics to sort, filter, and analyze them.

How many log analytics workspace should I have? ›

A single Log Analytics workspace might be sufficient for many environments that use Azure Monitor and Microsoft Sentinel. But many organizations create multiple workspaces to optimize costs and better meet different business requirements.

How do I connect my Azure VM to log analytics workspace? ›

Create an Azure Log Analytics workspace and add a Virtual Machine
  1. Login to the Azure Portal.
  2. Search and select Log Analytics workspaces.
  3. Click Create Log Analytics workspace.
  4. Configure: ...
  5. Click OK.
  6. Now that you have created your Log Analytics workspace, let's join a VM to this new work space.
Mar 22, 2020

How do I provide access to log analytics workspace in Azure? ›

Select the Azure subscription that's associated with the Azure Log Analytics workspace and linked to the Services Hub account you want to add users to. Click Access Control, then Add. Next, select a Role and add the email address of the person you want to add. Once done, click Save.

How do I get data from Azure log analytics? ›

The following methods let you query data using Log Analytics query language, which is the same for Azure Data Explorer.
  1. Use Azure Data Explorer to query data in Azure Data Lake.
  2. Use Azure Data Explorer to ingest data from a Storage Account.
  3. Use Log Analytics workspace to query ingested data using Logs Ingestion API .

How can you retrieve diagnostic logs from an Azure storage account? ›

The diagnostics logs are saved in a blob container named $logs in your storage account. You can view the log data using a storage explorer like the Microsoft Azure Storage Explorer, or programmatically using the storage client library or PowerShell.

Top Articles
How to create ERC-721 Token? | ERC-721 Token Development
8 Types of Accounting: Careers, Degrees, and Salaries
Lengua With A Tilde Crossword
Noaa Charleston Wv
855-392-7812
Craigslist Cars Augusta Ga
Tj Nails Victoria Tx
Acts 16 Nkjv
Hay day: Top 6 tips, tricks, and cheats to save cash and grow your farm fast!
Nyuonsite
Optum Medicare Support
Cvs Devoted Catalog
Craigslist Alabama Montgomery
R/Afkarena
2015 Honda Fit EX-L for sale - Seattle, WA - craigslist
Maplestar Kemono
Directions To 401 East Chestnut Street Louisville Kentucky
Stardew Expanded Wiki
3476405416
Water Trends Inferno Pool Cleaner
Sef2 Lewis Structure
C&T Wok Menu - Morrisville, NC Restaurant
Encyclopaedia Metallum - WikiMili, The Best Wikipedia Reader
Mals Crazy Crab
Chicago Based Pizza Chain Familiarly
Villano Antillano Desnuda
What Is a Yurt Tent?
'Insidious: The Red Door': Release Date, Cast, Trailer, and What to Expect
Miles City Montana Craigslist
Kacey King Ranch
Mercedes W204 Belt Diagram
Sun Haven Pufferfish
Upstate Ny Craigslist Pets
Tgh Imaging Powered By Tower Wesley Chapel Photos
W B Crumel Funeral Home Obituaries
Polk County Released Inmates
Final Exam Schedule Liberty University
Scanning the Airwaves
Paperless Employee/Kiewit Pay Statements
2020 Can-Am DS 90 X Vs 2020 Honda TRX90X: By the Numbers
Clima De 10 Días Para 60120
What Is The Optavia Diet—And How Does It Work?
Brown launches digital hub to expand community, career exploration for students, alumni
Yourcuteelena
Hampton In And Suites Near Me
The Pretty Kitty Tanglewood
10 Best Tips To Implement Successful App Store Optimization in 2024
Bluebird Valuation Appraiser Login
Osrs Vorkath Combat Achievements
Philasd Zimbra
Comenity/Banter
Latest Posts
Article information

Author: Jeremiah Abshire

Last Updated:

Views: 5624

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Jeremiah Abshire

Birthday: 1993-09-14

Address: Apt. 425 92748 Jannie Centers, Port Nikitaville, VT 82110

Phone: +8096210939894

Job: Lead Healthcare Manager

Hobby: Watching movies, Watching movies, Knapping, LARPing, Coffee roasting, Lacemaking, Gaming

Introduction: My name is Jeremiah Abshire, I am a outstanding, kind, clever, hilarious, curious, hilarious, outstanding person who loves writing and wants to share my knowledge and understanding with you.