Designing logging and monitoring

AZ-305 Azure Solutions ArchitectIdentity, governance and monitoringAbout 20 minutesBy Cloud Hands On

Choose where logs go, how many Log Analytics workspaces you need, and which monitoring tool answers each question.

In this lesson you'll learn

1. What you're designing

Refresher: Azure monitoring data

Metrics are numbers sampled over time, such as CPU percentage, kept for 93 days. Logs are records with many fields, queried with KQL in a Log Analytics workspace. The activity log records management actions on your subscription, such as who deleted a VM.

An architect's job isn't to click through the portal. It's to answer three design questions for the whole estate:

  1. Logging: which data must be collected, and how long it must be kept.
  2. Routing: where each type of data goes: a workspace for queries, storage for cheap archiving, or Event Hubs for other tools.
  3. Monitoring: which tool watches what, and who gets alerted.

2. Routing logs

Sources on the left: platform logs and metrics through diagnostic settings, guest OS data through the Azure Monitor Agent and data collection rules, and app telemetry through Application Insights. Destinations on the right: Log Analytics for queries, Storage for archive, Event Hubs for streaming to other tools. Platform logsresources, activity log Guest OS dataevents, counters, logs Application datarequests, traces Diagnostic settings Agent + DCR App Insights SDK Log Analyticsquery with KQL, alert Storage accountcheap long-term archive Event Hubsstream to a SIEM or tool
Each source has its own collection method. Diagnostic settings can send the same platform logs to several destinations at once.
RequirementRoute to
Query, correlate and alert on logsLog Analytics workspace
Keep logs for years at the lowest cost, rarely readStorage account (or workspace long-term retention)
Send logs to a third-party SIEM or custom app in near real timeEvent Hubs
Collect Windows events or Linux syslog from VMsAzure Monitor Agent with a data collection rule

3. How many workspaces?

Microsoft's guidance is to start with one workspace and only add more when there's a clear reason. Fewer workspaces make cross-resource queries and administration easier.

Reason to add a workspaceWhy
Data must stay in a specific geographyA workspace stores data in its own region
Different tenants or legal entitiesStrong separation of data and billing
Very different retention or cost needsRetention is set per workspace and table
Access control doesn't need extra workspaces. Use resource-context access (people see logs for resources they can read) or table-level RBAC instead.

4. Choosing a monitoring tool

QuestionTool
Is my web app slow, and which dependency is failing?Application Insights
How are my VMs performing, and what do they connect to?VM insights
Why can't VM1 reach VM2?Network Watcher
Is an Azure outage affecting my region?Service Health
Detect and respond to security threats across the estateMicrosoft Sentinel
Combine metrics, logs and text into an interactive reportAzure Monitor workbooks

Example

Larkfield Group runs 300 VMs in two regions. The security team uses Splunk. The architect recommends one Log Analytics workspace per region, because data must stay in each country. Azure Monitor Agent with data collection rules collects guest logs. Diagnostic settings send Key Vault and firewall logs to both the workspace and an Event Hub for Splunk, and an archive copy in storage meets the seven-year audit retention.

Exam traps to remember

  • Event Hubs is the answer when logs must reach an external tool. Storage is for archiving, not streaming.
  • Don't create a workspace per team just for permissions. Use resource-context or table-level access.
  • Guest OS data needs the Azure Monitor Agent. Diagnostic settings only cover platform data.
  • The activity log is kept for 90 days. Route it to a workspace or storage to keep it longer.

Test yourself: 3 check questions and exam-style practice questions on this topic are in the AZ-305 Azure Solutions Architect app.

Practise in the app

Keep going