Task 09: Log Analytics Workspace
DOCUMENT CATEGORY: Runbook
SCOPE: Log Analytics Workspace deployment
PURPOSE: Establish centralized monitoring and logging
MASTER REFERENCE: Microsoft Learn - Log Analytics
Status: Active
Overview
This task creates a Log Analytics workspace that serves as the centralized log destination for all management infrastructure — VMs, networking resources, Key Vault, and eventually the Azure Local cluster itself. Diagnostic settings for other resources will reference this workspace.
Execution Target: Azure-Only (control-plane API operation) Tab Profile: 3 tabs — Azure Portal · PowerShell · Azure CLI
Module: azurelocal-toolkit
File: log.tf
Mode: Management
Components Created
| Resource | Name Pattern | Purpose |
|---|---|---|
| Log Analytics Workspace | log-azrlmgmt-{env}-{region}-01 | Centralized log collection |
Workspace Configuration
| Setting | Value | Source |
|---|---|---|
| Name | log-azrlmgmt-{env}-{region}-01 | landing_zone.log_analytics.name |
| SKU | PerGB2018 | no key (the script or Azure decides it) |
| Retention | 90 days | operations.monitoring.retention_days |
Prerequisites
- Resource group exists
- Log Analytics contributor role on target resource group
Values from infrastructure.yml
The values for this task come from infrastructure.yml (schema 5). Every key, with its type, default and example, is in the variables reference.
Single Subscription Model
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Customer subscription | landing_zone.subscriptions[].id |
| Resource Group | rg-azrlmgmt-{env}-{region}-01 | operations.monitoring.workspace_resource_group |
| Workspace Name | log-azrlmgmt-{env}-{region}-01 | landing_zone.log_analytics.name |
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
When to use: Learning Azure Local, single deployment, prefer visual interface
Procedure
- Create Log Analytics Workspace:
- Search for Log Analytics workspaces → + Create
| Field | Value | Source |
|-------|-------|--------|
| Name |
log-azrlmgmt-{env}-{region}-01|landing_zone.log_analytics.name| | Subscription | Target subscription |landing_zone.subscriptions[].id| | Resource Group | Management RG |operations.monitoring.workspace_resource_group| | Region | Your region |azure.location|
- Configure Pricing Tier (optional):
- Go to Usage and estimated costs → Select Pay-As-You-Go (Per GB 2018)
- Configure Retention:
- Go to Usage and estimated costs → Data Retention → Set to value from config
| Field | Value | Source |
|-------|-------|--------|
| Retention | 90 days |
operations.monitoring.retention_days|
- Review + create: Verify → Click Create
Validation
- Workspace provisioning state: Succeeded
- SKU is PerGB2018
- Retention set to configured value
- Workspace ID can be retrieved
Links
PowerShell
No script in this task. The toolkit has no task folder for it. The workspace is created in stage 05 (operational foundations) by
scripts/deploy/05-operational-foundations/phase-02-monitoring-observability/task-01-configure-log-analytics-workspace/powershell/Deploy-LogAnalyticsWorkspace.ps1. It creates the one workspace ofoperations.monitoringfrominfrastructure.yml. Or follow the steps in the other tab of this page.
Azure CLI
No script in this task. The toolkit has no task folder for it. The workspace is created in stage 05 (operational foundations) by
scripts/deploy/05-operational-foundations/phase-02-monitoring-observability/task-01-configure-log-analytics-workspace/azurecli/Deploy-LogAnalyticsWorkspace.azcli.ps1, the Azure CLI variant of the PowerShell script. It creates the one workspace ofoperations.monitoringfrominfrastructure.yml. Or follow the steps in the other tab of this page.
Requires: PowerShell 7 and the Azure CLI, signed in with az login --tenant <azure.tenant_id>.
Validation
- Workspace provisioned
- SKU: PerGB2018
- Retention: 90 days (or configured value)
- Workspace ID retrievable
CAF/WAF Landing Zone Model
In the CAF/WAF model, the Log Analytics workspace is deployed in the Management subscription for centralized observability.
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Management subscription | landing_zone.subscriptions[].id |
| Resource Group | rg-azrlmgmt-{env}-{region}-01 | operations.monitoring.workspace_resource_group |
| Workspace Name | log-azrlmgmt-{env}-{region}-01 | landing_zone.log_analytics.name |
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
Follow the same procedure as Single Subscription → Azure Portal, targeting the Management subscription.
Validation
- Workspace in Management subscription
- Cross-subscription diagnostic settings can target this workspace
PowerShell
No script in this task. The toolkit has no task folder for it. The workspace is created in stage 05 (operational foundations) by
scripts/deploy/05-operational-foundations/phase-02-monitoring-observability/task-01-configure-log-analytics-workspace/powershell/Deploy-LogAnalyticsWorkspace.ps1. It creates the one workspace ofoperations.monitoringfrominfrastructure.yml. Or follow the steps in the other tab of this page.
Azure CLI
No script in this task. The toolkit has no task folder for it. The workspace is created in stage 05 (operational foundations) by
scripts/deploy/05-operational-foundations/phase-02-monitoring-observability/task-01-configure-log-analytics-workspace/azurecli/Deploy-LogAnalyticsWorkspace.azcli.ps1, the Azure CLI variant of the PowerShell script. It creates the one workspace ofoperations.monitoringfrominfrastructure.yml. Or follow the steps in the other tab of this page.
Requires: PowerShell 7 and the Azure CLI, signed in with az login --tenant <azure.tenant_id>.
Validation
- Workspace in Management subscription
- Diagnostic settings from other subscriptions can send logs here
Troubleshooting
| Issue | Root Cause | Remediation |
|---|---|---|
| Workspace name already taken | Names are globally unique | Choose a different name or check for soft-deleted workspace |
| Data not appearing | Diagnostic settings not configured | Configure diagnostic settings on source resources |
| Retention change not applied | UI caching | Refresh portal; verify via CLI |
| Cost unexpectedly high | High data ingestion volume | Review data collection rules and reduce unnecessary tables |
Alternatives
The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.
Navigation
| Previous | Up | Next |
|---|---|---|
| Task 08: Arc Gateway | Manual Deployment Index | Task 10: Key Vault |
Version Control
- Created: 2025-09-15 by Hybrid Cloud Solutions
- Last Updated: 2026-03-03 by Hybrid Cloud Solutions
- Version: 4.0.0
- Tags: azure-local, log-analytics, monitoring, observability
- Keywords: Log Analytics, Azure Monitor, workspace, logging, diagnostics, retention
- Author: Hybrid Cloud Solutions
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2025-03-25 | Azure Local Cloud | Initial release |