Log Analytics Workspace
A Log Analytics workspace is the central data store in Azure Monitor where log and telemetry data is collected, retained, and queried with KQL. It backs alerts, dashboards, workbooks, and Microsoft Sentinel.
Log Analytics Workspace
Resources send diagnostic logs, performance counters, and application telemetry into tables inside a workspace. Everything is queried with KQL, so one query can join infrastructure logs with application traces. The workspace is also the unit for access control, retention settings, and billing by ingested data.
How Do You Control Log Analytics Cost?
Cost is driven by ingestion volume and retention, so tune both.
- Table plans: Analytics for full querying, Basic for cheap high-volume logs with limited query features, and Auxiliary for rarely queried data.
- Retention: Default interactive retention is 30 days, adjustable per table, with long-term retention available at lower cost for compliance.
- Commitment tiers: A fixed daily commitment lowers the per-GB price at high volume.
- Daily cap: A safeguard against runaway ingestion, though it stops collection when reached.
How Do You Create a Workspace?
az monitor log-analytics workspace create \ --resource-group mumbai-prod-rg --workspace-name mumbai-prod-logs \ --location centralindia --retention-time 90Why It Matters in Production
A security team at a company like Razorpay can send diagnostics from every production resource into one regional workspace, so an incident spanning several services is investigated with a single KQL query.
Common MistakeCreating a workspace per team or subscription with no strategy. You lose cross-resource correlation and pay for duplicated settings, so consolidate by region or organisation boundary.
TipMove noisy, low-value logs such as verbose flow logs to the Basic table plan, and keep high-value security tables on Analytics.
Frequently Asked Questions
Do I need one workspace or many?
Fewer is usually better for correlation and cost. Use separate workspaces only for real needs such as data residency, different retention or access rules, or separate tenants.
How do I control who can read which logs?
Use workspace-level or table-level Azure RBAC, and resource-context access so people see only logs from resources they can already access.
How is a workspace related to Application Insights?
Modern Application Insights is workspace-based, so its telemetry is stored in a Log Analytics workspace alongside other data.