An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
Historical records remain in Workspace 1 under its table-level retention policy after routing changes, but records outside analytics retention require a search job or restore rather than a normal Logs query.
Access historical logs
For direct access:
- In the Azure portal, open Log Analytics workspaces → Workspace 1 → Logs.
- Select the table that contains the resource logs:
-
AzureDiagnosticswhen the diagnostic setting uses Azure Diagnostics mode. - The applicable dedicated table when it uses resource-specific mode.
-
- Set the time picker to the required historical interval and filter by
_ResourceId.
Example:
AzureDiagnostics
| where TimeGenerated between (datetime(2026-01-01) .. datetime(2026-02-01))
| where _ResourceId =~ "/subscriptions/[Subscription ID] ID]/resourceGroups/[Resource Group] Group]/providers/<provider>/<type>/<resource>"
| order by TimeGenerated desc
Workspace-context access requires query permission on Workspace 1 or the relevant tables. Log Analytics Reader provides the workspace query permissions typically required for this access.^1^
You can also open Key Vault/App Service → Monitoring → Logs. This resource-context view retrieves records associated with that resource from accessible workspaces, including the old and new workspaces. It depends on _ResourceId being populated:
search *
| where isnotempty(_ResourceId)
| summarize FirstRecord=min(TimeGenerated),
LastRecord=max(TimeGenerated),
Records=count()
by Type, _ResourceId
Resource read access is sufficient only when the workspace uses Use resource or workspace permissions. If Workspace 1 uses Require workspace permissions, the user also needs workspace or table permissions. Resource-context querying supports Analytics-plan tables; Basic and Auxiliary tables must be queried with the workspace as the scope.^2^
Query both workspaces centrally
Use an explicit cross-workspace query from Azure Monitor → Logs or either workspace. The workspace() expression accepts the workspace ID or full Azure resource ID:
union withsource=SourceWorkspace
workspace("<workspace-1-id>").AzureDiagnostics,
workspace("<workspace-2-id>").AzureDiagnostics
| where TimeGenerated >= ago(90d)
| where _ResourceId =~ "<resource-id>"
| project TimeGenerated, SourceWorkspace,
ResourceProvider, ResourceType, Category, ResultType
| order by TimeGenerated desc
For resource-specific logging, replace AzureDiagnostics with the appropriate table, such as the relevant Key Vault or App Service table. Inspect both schemas before combining them if collection mode or table structure changed; align differing columns and types with project, tostring(), or other conversions.
Cross-workspace queries require query access to both workspaces, support up to 100 workspaces, and can become slower when many workspaces or regions are involved.^1^
After testing, save the query as a function or in a query pack and use it from shared workbooks. Review alert rules separately because cross-workspace alert support and function scoping have additional restrictions.
Retention checks
Before changing routing, examine Workspace 1’s retention settings:
- Open Workspace 1 → Settings → Usage and estimated costs → Data Retention.
- Check table-specific settings as well as the workspace default.
- Confirm both:
- Analytics retention: data is available to ordinary interactive queries.
- Total retention: includes any lower-cost long-term retention.
If expected records are no longer returned by an ordinary Logs query but remain within total retention, run a search job to retrieve them. For repeated interactive analysis, restore the relevant historical range. Existing unexpired data is covered if retention is increased; shortening total retention starts a 30-day grace period before removal.^3^
Recommended cutover
- Preserve Workspace 1. Do not delete it, remove required RBAC assignments, or shorten retention during the historical-access period.
- Create temporary overlap where supported. If each resource has fewer than five diagnostic settings, add a separate setting with the same categories targeting Workspace 2. A setting can contain only one Log Analytics destination, so two workspaces require separate settings; Azure Monitor permits up to five diagnostic settings per resource.^4^
- Generate recognizable test activity and verify records arrive in Workspace 2 before disabling the setting for Workspace 1.
- Inventory and update saved queries, workbooks, alerts, automation, and Microsoft Sentinel dependencies.
- Keep a saved cross-workspace query during the retention overlap. Older data remains in Workspace 1 and new data is stored in Workspace 2.^5^
- If Workspace 1 must eventually be decommissioned, export required historical tables first. An on-demand export job can export a selected table and time range to Azure Blob Storage in Parquet format; changing diagnostic settings or enabling continuous export does not copy historical records.^6^
References
- Query data across Log Analytics workspaces, applications, and resources in Azure Monitor
- Manage access to Log Analytics workspaces
- Manage data retention in a Log Analytics workspace
- Enable logging with Azure Monitor
- Relocate Azure Monitor - Log Analytics workspace to another region
- Log Analytics data export rules in Azure Monitor