Move a Log Analytics workspace to a different subscription or resource group

This article explains how to move a Log Analytics workspace to another resource group or subscription in the same region. Moving a Log Analytics workspace in the same region does not affect your log data or data retention settings.

To move a workspace to a different region instead, see Relocate a Log Analytics workspace to another region. A cross-region move requires creating a new workspace because workspace data doesn't move across regions.

Tip

To learn more about how to move Azure resources through the Azure portal, PowerShell, the Azure CLI, or the REST API, see Move resources to a new resource group or subscription.

Prerequisites

  • The subscription or resource group where you want to move your Log Analytics workspace must be located in the same region as the Log Analytics workspace you're moving.

  • No services can remain linked to the workspace when you move it. Before the move, delete solutions that rely on linked services, including an Azure Automation account. Remove these solutions before you can unlink your Automation account. Data collection for the solutions stops and their tables are removed from the UI, but data remains in the workspace for the retention period defined for the table. When you add solutions back after the move, ingestion is restored and tables become visible with data. Linked services include:

    • Update management
    • Change tracking
    • Start/Stop VMs during off-hours
    • Microsoft Defender for Cloud
  • Connected Log Analytics agents and Azure Monitor Agent remain connected to the workspace after the move with no interruption to ingestion.

  • Update resource paths after a workspace move for Azure or external resources that point to the workspace, such as Azure Monitor alert rules, third-party applications, and custom scripts.

Permissions required

Action Permissions required
Verify the Microsoft Entra tenant. Microsoft.AzureActiveDirectory/b2cDirectories/read permissions, as provided by the Log Analytics Reader built-in role, for example.
Delete a solution. Microsoft.OperationsManagement/solutions/delete permissions on the solution, as provided by the Log Analytics Contributor built-in role, for example.
Remove alert rules for the Start/Stop VMs solution. microsoft.insights/scheduledqueryrules/delete permissions, as provided by the Monitoring Contributor built-in role, for example.
Unlink the Automation account Microsoft.OperationalInsights/workspaces/linkedServices/delete permissions on the linked Log Analytics workspace, as provided by the Log Analytics Contributor built-in role, for example.
Move a Log Analytics workspace. Microsoft.OperationalInsights/workspaces/delete and Microsoft.OperationalInsights/workspaces/write permissions on the Log Analytics workspace, as provided by the Log Analytics Contributor built-in role, for example.

Considerations

  • It can take Azure Resource Manager a few hours to complete. Solutions might be unresponsive during the operation.
  • Your log data and data retention settings remain unaffected.
  • Managed solutions that are installed in the workspace move as well.
  • Managed solutions are workspace objects and can't be moved independently.
  • Azure regenerates workspace keys (both primary and secondary) with a workspace move operation. If you keep a copy of your workspace keys in Azure Key Vault, update them with the new keys generated after the workspace is moved.

Verify the Microsoft Entra tenant

The workspace source and destination subscriptions must exist within the same Microsoft tenant. Use Azure PowerShell to verify that both subscriptions have the same Entra tenant ID.

Find your Microsoft Entra tenant for the source and destination subscriptions.

Delete solutions

  1. Open the menu for the resource group where any solutions are installed.
  2. Select the solutions to remove.
  3. Select Delete Resources and then confirm the resources to be removed by selecting Delete. Screenshot that shows deleting solutions.

Remove alert rules for the Start/Stop VMs solution

To remove the Start/Stop VMs solution, you also need to remove the alert rules created by the solution.

  1. Open the Monitor menu and then select Alerts.

  2. Select Manage alert rules.

  3. Select the following three alert rules, and then select Delete:

    • AutoStop_VM_Child
    • ScheduledStartStop_Parent
    • SequencedStartStop_Parent Screenshot that shows deleting rules.

See Delete a standalone Automation account linked to workspace.

Move your workspace

For a move between resource groups in the same subscription, use that subscription as the destination too. Include any related resources that must move with the workspace.

  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. Select the resources to move to the same destination subscription and resource group as the workspace.

  4. Select a destination Subscription and Resource group. If you're moving the workspace to another resource group in the same subscription, you won't see the Subscription option.

  5. Select OK to move the workspace and selected resources.

    Screenshot that shows the Overview pane in the Log Analytics workspace with options to change the resource group and subscription name.

Important

After the move operation, removed solutions and the Automation account link should be reconfigured to bring the workspace back to its previous state.