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.

Considerations when you delete a workspace

When you delete a Log Analytics workspace, 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 Permanent workspace delete.

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.

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.

Soft-delete behavior

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.

You can delete a workspace by using PowerShell, the REST API, or the Azure portal.

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. If you want to permanently delete the workspace and remove the option to later recover it, select the Delete the workspace permanently checkbox.

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

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

PowerShell

PS C:\>Remove-AzOperationalInsightsWorkspace -ResourceGroupName "resource-group-name" -Name "workspace-name"

Permanent workspace delete

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.

To permanently delete a workspace by using the Azure portal, select the Delete the workspace permanently checkbox before you select Delete.

To permanently delete a workspace by using PowerShell, add a -ForceDelete tag to permanently delete your workspace. The -ForceDelete option is currently available with Az.OperationalInsights 2.3.0 or higher.

PS C:\>Remove-AzOperationalInsightsWorkspace -ResourceGroupName "resource-group-name" -Name "workspace-name" -ForceDelete

Recover a workspace

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, it's scheduled for permanent deletion, and its name is released and can be used to create a new workspace.

You can recover your workspace during the soft-delete period, including its data, configuration, and connected agents. You must have Contributor permissions to the subscription and resource group where the workspace was located before the soft-delete operation. 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.

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. You see the list of workspaces you have in the selected scope.

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

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

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

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

PowerShell

PS C:\>Select-AzSubscription "subscription-name-the-workspace-was-in"PS C:\>Restore-AzOperationalInsightsWorkspace -ResourceGroupName "resource-group-name-the-workspace-was-in" -Name "deleted-workspace-name" -Location "region-name-the-workspace-was-in"

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. These resources should be reconfigured to bring the workspace to its previously configured state. Some of the data might not be available for query after the workspace recovery until the associated solutions are reinstalled and their schemas are added to the workspace.

Troubleshooting

You must have at least Log Analytics Contributor permissions to delete a workspace.

  • If you aren't sure if a deleted workspace is in a soft-delete state and can be recovered, 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.

  • If you get the error message "This workspace name is already in use" or "conflict" 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 override the soft-delete and permanently delete your workspace to create a new workspace with the same name, follow these steps to recover the workspace first and then perform a permanent delete:

      1. Recover your workspace.
      2. Permanently delete your workspace.
      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.

  • 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.

  • If you deleted your resource group and your workspace was included, you can see the deleted workspace on the Open recycle bin page. 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.

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

FAQs

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

You can delete the logs by going to the log analytics workspace of the corresponding sentinel instance. Click on the three dots of the required custom logs to be deleted.

How do I delete data from Azure Log Analytics? ›

You can delete the logs by going to the log analytics workspace of the corresponding sentinel instance. Click on the three dots of the required custom logs to be deleted.

How do I remove old Log Analytics agent? ›

Sign on to the computer with an account that has administrative rights. Open Control Panel. Select Microsoft Monitoring Agent and then select the Azure Log Analytics tab. If you're removing a workspace, select it and then select Remove.

Is Log Analytics workspace part of Azure monitor? ›

An Azure Log Analytics Workspace is a logical storage unit in Azure where all log data generated by Azure Monitors are stored. Azure Log Analytics Workspace makes it easier for us to manage the log data that is collected from various data sources like Azure Virtual Machines.

Can I recover deleted resources in Azure? ›

To recover a deleted storage account from the Azure portal, follow these steps: Navigate to the list of your storage accounts in the Azure portal. Select the Restore button to open the Restore deleted account pane. Select the subscription for the account that you want to recover from the Subscription drop-down.

How do I recover a deleted Log Analytics workspace? ›

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. ...
  3. Select Recover 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.
Feb 13, 2023

How do I delete data from Analytics? ›

Data deletion requests (Universal Analytics)
  1. Sign in to Google Analytics..
  2. Click Admin, and navigate to the relevant property.
  3. In the PROPERTY column, click Data Deletion Requests. ...
  4. To make a new request, click Create Data Deletion Request.
  5. Select the Start and End dates.

How do I remove a server from Log Analytics workspace? ›

Open MMA settings on server, disconnect from Log Analytics Workspace and then remove agent and shutdown server or removal of MMA agent without disconnecting from Workspace is enough?

How do I disable Azure Log Analytics workspace? ›

Disable monitoring and keep the workspace
  1. Sign in to the Azure portal.
  2. In the Azure portal, select Virtual Machines.
  3. From the list, select a VM.
  4. On the left, select Extensions. ...
  5. On the extension properties page, select Uninstall.
  6. On the Extensions page, select MicrosoftMonitoringAgent.
Apr 27, 2023

How long does Log Analytics keep logs? ›

By default Application Insights and Log Analytics has a data retention of 90 days. You can opt to extend the retention up to 730 days.

What is the difference between Azure Monitor and Azure Log Analytics? ›

Azure Monitor builds on top of Azure Log Analytics, the platform service that gathers log and metrics data from all your resources. The easiest way to think about Azure Monitor vs Log Analytics is that Azure Monitor is the marketing name, whereas Azure Log Analytics is the technology that powers it.

What is the difference between Azure Monitor and Azure Log Analytics workspace? ›

Log Analytics workspaces contain logs and metrics data from multiple Azure resources, whereas Azure Monitor workspaces currently contain only metrics related to Prometheus.

Is Azure Monitor same as Log Analytics? ›

Monitor is the brand, and Log Analytics is one of the solutions. Log Analytics and Application Insights have been consolidated into Azure Monitor to provide a single integrated experience for monitoring Azure resources and hybrid environments.

Can Azure activity logs be deleted? ›

Activity log events are retained in Azure for 90 days and then deleted. There's no charge for entries during this time regardless of volume.

How do I recover deleted files from Azure? ›

Go to Backup center and select Backup Instances from the menu, with the datasource type selected as Azure Storage (Azure Files). Select the file share you wish to do an item level recovery for. The backup item menu appears with a File Recovery option. After you select File Recovery, the Restore pane opens.

Where can I find deleted items in Azure? ›

You restore deleted work items or permanently delete them from the web portal Recycle Bin. Choose Boards>Work Items and then choose the Recycle Bin.

Where is Log Analytics workspace data stored? ›

Log Analytics records

All data collected by Log Analytics is stored in the OMS repository as records. Records collected by different data sources will have their own set of properties and be identified by their Type property.

Can I recover deleted activity log data? ›

The easiest method is to do a system restore. If the internet history was deleted recently, then system restore will recover it. To get system restore up and running you can go to the “start” menu and do a search for system restore which will take you to the feature.

Where are Log Analytics logs stored? ›

All logs are stored in block blobs in a container named $logs , which is automatically created when Storage Analytics is enabled for a storage account. The $logs container is located in the blob namespace of the storage account, for example: http://<accountname>.blob.core.windows.net/$logs .

Can Analytics data be deleted? ›

You need the Editor role to make data-deletion requests for a Google Analytics property. If you need to delete data from the Analytics servers for any reason, then you can use a data-deletion request to issue a request for its removal.

How do you Delete a data field? ›

Delete a field from a query

In the query design grid, select the field that you want to delete, and then press DEL.

What is deletion of data? ›

Deletion of Data

Clearing. Clearing is the process of eradicating the data on media before reusing the media in an environment that provides an acceptable level of protection for the data that was on the media before clearing.

How do I remove a server from monitoring? ›

To remove a server:
  1. Go to Configuration > Monitored Servers, and in the row for the server you want to remove, select Remove server from the Actions list: ...
  2. The Remove Servers box is displayed, with the servers to be removed highlighted in the list:
Mar 15, 2023

What is Log Analytics workspace? ›

A Log Analytics workspace is a unique environment for log data from Azure Monitor and other Azure services, such as Microsoft Sentinel and Microsoft Defender for Cloud. Each workspace has its own data repository and configuration but might combine data from multiple services.

How do I clear server log files? ›

To delete a server log file:
  1. In the menu, click Administration > Log Files .
  2. Click the tab of the server to which the log file belongs. Front-end Server Log. ...
  3. In the Actions column of the log file you want to delete, click. . ...
  4. Click No to avoid deleting the log file; or click Yes to remove the log file from the list.

How do I delete Azure monitors? ›

Delete an Azure Monitor workspace

Open the Azure Monitor workspaces menu in the Azure portal. Select your workspace. Select Delete.

How do I change my VM Log Analytics workspace? ›

To configure multiple workspaces, on the Monitor menu, select Virtual Machines. Then select the Workspace configuration tab. Set the filter values to display a list of existing workspaces. Select the checkbox next to each workspace to enable it and then select Configure selected.

How do I disable Azure monitor AKS? ›

Use the az aks disable-addons command to disable Container insights. The command removes the agent from the cluster nodes. It doesn't remove the solution or the data already collected and stored in your Azure Monitor resource. To reenable monitoring for your cluster, see Enable monitoring by using the Azure CLI.

How long does Azure monitor keep logs? ›

You can keep data in interactive retention between 4 and 730 days. You can set the archive period for a total retention time of up to 2,556 days (seven years). To set the retention and archive duration for a table in the Azure portal: From the Log Analytics workspaces menu, select Tables.

How long does Azure retain logs? ›

Audit records for operations in Azure Active Directory, Exchange Online, SharePoint Online, and OneDrive for Business, are retained for one year by default.

What is the default retention period for Log Analytics workspace? ›

By default, a Log Analytics workspace has a retention period of 30 days. Retention is calculated on the ingestion date for data, so if a workspace uses the default retention period, it means that Azure removes data from the workspace 30 days after its ingestion.

What is the difference between log monitoring and Log Analytics? ›

Whereas log monitoring is the process of tracking logs, log analytics evaluates logs in context to understand their significance. This includes troubleshooting issues with software, services, applications, and any infrastructure with which they interact.

What are the three main functions of Azure monitor? ›

Collect, analyze, and act on telemetry data from your cloud and hybrid environments. Azure Monitor supports your operations at scale by helping you maximize the performance and availability of your resources and proactively identify problems.

What is difference between Log Analytics workspace and application insights? ›

It's probably easiest to think of Log Analytics as being the raw database and tables for Log data and App Insights is a set of views aimed at providing useful views on your applications' telemetry data.

What is Azure Monitor and Log Analytics? ›

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 difference between monitoring and analytics? ›

TL;DR: Monitoring is the process of observing systems and testing whether they function correctly. Analytics is the process of turning data (usually behavioral data) into insights.

What are the two main kinds of data Azure Monitor works with? ›

All data collected by Azure Monitor fits into one of two fundamental types: metrics and logs.

Do you need Log Analytics workspace? ›

You need a Log Analytics workspace if you collect data from: Azure resources in your subscription. On-premises computers monitored by System Center Operations Manager. Device collections from Configuration Manager.

What is the difference between application insights and Azure Monitor? ›

Application Insights is an extension of Azure Monitor and provides application performance monitoring (APM) features. APM tools are useful to monitor applications from development, through test, and into production in the following ways: Proactively understand how an application is performing.

What is the new name of Azure Log Analytics? ›

The Log Analytics menu in the Azure portal was renamed to Log Analytics workspaces. It's where you create new workspaces and configure data sources.

What is the difference between audit log and activity log in Azure? ›

The activity log includes information like when a resource is modified or a virtual machine is started. Audit Logs - All resource logs that record customer interactions with data or the settings of the service. Next time, do not forget to include a link to the documentation you are referring to.

How do I archive Azure activity logs? ›

Archive logs to an Azure storage account

Sign in to the Azure portal. Select Azure Active Directory > Monitoring > Audit logs. Select Export Data Settings.

How is data deleted in Azure? ›

Data destruction: When customers delete data or leave Azure, Microsoft follows strict standards for deleting data, as well as the physical destruction of decommissioned hardware. Microsoft executes a complete deletion of data on customer request and on contract termination.

Is there a recycle bin in Azure? ›

To recycle deleted objects, Navigate to Azure AD tab → Azure AD → Recycle Bin. Select the tenant that contains the object to be restored in the Tenant drop-down box. Mark the check-box against the objects that you would like to restore.

How do I recover a deleted secret in Azure? ›

List, recover or purge soft deleted secrets, keys, and certificates
  1. Log in to the Azure portal.
  2. Select your key vault.
  3. Select the blade corresponding to the secret type you want to manage (keys, secrets, or certificates).
  4. At the top of the screen, click on "Manage deleted (keys, secrets, or certificates)
Mar 7, 2023

How do I recover permanently deleted files from the cloud? ›

In iCloud Drive on iCloud.com, click Recently Deleted in the sidebar. Click Recover All, or select each file you want to recover, then click Recover.

How can I retrieve deleted items? ›

Open the Start menu and type "Restore your files with File History" in the search bar. Select the Restore your files with File History option. Navigate to the location where the deleted folder or file was located. Select the folder or file you want to restore.

Where is recover deleted items? ›

Right-click the file or folder, and then select Restore previous versions. You'll see a list of available previous versions of the file or folder. The list will include files saved on a backup (if you're using Windows Backup to back up your files) as well as restore points, if both types are available.

How do I delete a dataset in Azure? ›

You can unregister datasets from your workspace by selecting each dataset and selecting Unregister. To delete a dataset, go to the storage account by using the Azure portal or Azure Storage Explorer and manually delete those assets.

How do I delete data from Azure database? ›

Using Azure Data Studio (preview)

In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance. Expand Databases, right-click the database to delete, and then select Delete.

How do I delete items from Azure? ›

You can delete or destroy a work item with the az boards work-item delete command. To get started, see Get started with Azure DevOps CLI. You can restore work items you delete, but you can't restore work items you choose to destroy.

Where are Azure Monitor logs stored? ›

Logs in Azure Monitor are stored in a Log Analytics workspace that's based on Azure Data Explorer, which provides a powerful analysis engine and rich query language.

How long does Azure Monitor keep logs? ›

You can keep data in interactive retention between 4 and 730 days. You can set the archive period for a total retention time of up to 2,556 days (seven years). To set the retention and archive duration for a table in the Azure portal: From the Log Analytics workspaces menu, select Tables.

How long does Azure Log Analytics store logs? ›

By default Application Insights and Log Analytics has a data retention of 90 days. You can opt to extend the retention up to 730 days.

How do I delete a dataset in workspace? ›

Delete a dashboard, report, dataset, or workbook
  1. In your workspace, select the All tab.
  2. Select More options (...) next to the asset you want to delete, and choose Delete.
  3. Select Delete to confirm the deletion.
Jan 18, 2023

How do I delete an activity in Azure data Factory? ›

Search for Delete in the pipeline Activities pane, and drag a Delete activity to the pipeline canvas. Select the new Delete activity on the canvas if it is not already selected, and its Source tab, to edit its details. Select an existing or create a new Dataset specifying the files to be deleted.

How do you clear a dataset? ›

To delete a dataset:
  1. If the dataset belongs to you, find the dataset on your profile page under My Assets.
  2. Select the ellipse menu in the row for that dataset.
  3. Select "Delete."
Feb 20, 2023

What is the difference between drop database and DELETE database? ›

The DELETE command deletes one or more existing records from the table in the database. The DROP Command drops the complete table from the database.

What is the difference between DELETE and truncate? ›

The DELETE command is used to delete particular records from a table. The TRUNCATE command is used to delete the complete data from the table. It is a DML command. The DELETE command acquires the lock on every deleting record; thus, it requires more locks and resources.

How do I restore a dropped database in Azure? ›

To recover a deleted database to the deletion time by using the Azure portal, open the server's overview page and select Deleted databases. Select a deleted database that you want to restore, and then enter the name for the new database that will be created with data restored from the backup.

How do I undo a delete device on Azure? ›

Once hard deleted, objects cannot be recovered. Instead you need to recreate and reconfigure.

Where is Azure recycle bin? ›

To recycle deleted objects, Navigate to Azure AD tab → Azure AD → Recycle Bin.

How do I force delete a resource in Azure? ›

To delete a resource group, you need access to the delete action for the Microsoft. Resources/subscriptions/resourceGroups resource. The only permission required to delete a resource group is permission to the delete action for deleting resource groups.

Top Articles
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 6755

Rating: 5 / 5 (60 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.