Logging and Monitoring Design
AZ-305 AZ-305 · Design identity, governance, and monitoring solutions
You cannot operate what you cannot see. Monitoring design for AZ-305 is about building an observability platform: collecting the right telemetry from every layer, routing it to the right store, and turning it into alerts and dashboards that humans can act on. The exam tests the Azure Monitor data platform in depth — workspaces, diagnostic settings, data collection rules, alert types — and expects you to design for scale, cost, and retention requirements.
Azure Monitor and the Log Analytics workspace
Azure Monitor is the platform; the Log Analytics workspace is where log data is stored and queried with Kusto Query Language (KQL). Metrics (numerical time-series values like CPU percentage) live in the metrics database and are retained for 93 days; logs (text records like events and traces) live in the workspace with configurable retention — the default is 90 days, extendable to years, with archive options for long-term retention at lower cost. Workspace design is a real architectural decision: a single central workspace simplifies querying and alerting across the estate, while multiple workspaces can isolate data by region, compliance boundary, or billing. Microsoft's general guidance favours centralisation unless a concrete requirement (data residency, chargeback, or a regulatory boundary) forces separation. Data collection rules (DCRs) define what the Azure Monitor Agent collects from VMs and which workspace it goes to — one DCR can target many machines, and different DCRs can send different data to different workspaces. The legacy Log Analytics agent is retired, so all new designs use the Azure Monitor Agent.
Diagnostic settings: routing platform logs
Azure resources emit platform logs — resource logs (operations within the resource), activity logs (control-plane operations on the resource), and metrics. By default these logs go nowhere permanent; diagnostic settings route them to a Log Analytics workspace, a storage account, or an event hub. Design rules: send logs to a workspace for querying and alerting; send to a storage account for cheap long-term archival (often with lifecycle management to cool/archive tiers); send to an event hub when a third-party SIEM or streaming pipeline consumes them. Use Azure Policy (DeployIfNotExists) to ensure diagnostic settings are enabled on every resource of a given type — manual configuration does not scale. Note that diagnostic settings are per-resource, so the policy approach is the only reliable way to guarantee coverage. For cost control, be selective about log categories: enabling every category on every resource is the fastest way to an enormous Log Analytics bill.
Application Insights and distributed tracing
Application Insights (now workspace-based, storing data in a Log Analytics workspace) monitors live applications: request rates, response times, failure rates, dependencies, exceptions, and custom events. It supports distributed tracing across microservices, so a slow request can be followed from the front door through each service. Design points: use sampling to control ingestion volume on high-traffic apps (adaptive sampling keeps representative data while capping cost); use availability tests (URL ping and multi-step web tests) to detect outages from outside; and use live metrics for real-time troubleshooting during incidents. When a scenario describes a microservices app with performance problems nobody can localise, Application Insights with distributed tracing is the answer.
Alerts: the right signal, the right action
Azure Monitor alerts come in types matched to the data: metric alerts fire on threshold breaches (CPU above 90 percent for five minutes); log alerts run a KQL query on a schedule and fire when the result matches a condition; activity log alerts fire on control-plane events (a VM deleted, a role assigned); resource health alerts fire when Azure reports a platform problem. Action groups define what happens when an alert fires: email, SMS, voice call, webhook, Logic App, or automation runbook. Design guidance: alert on symptoms that affect users (availability, latency, error rate) rather than on every infrastructure blip; use alert processing rules (formerly suppression rules) to silence alerts during maintenance windows; and route alerts to the team that owns the service — action groups per service, not one global group. For high-severity alerts, consider automatic remediation: an alert can trigger a Logic App or runbook that restarts a service or scales out, before a human is even paged.
Dashboards, workbooks, and SIEM
Azure dashboards pin metrics and queries for at-a-glance views; Azure Workbooks combine text, queries, parameters, and visualisations into interactive reports — ideal for operations reviews and post-incident analysis. For security monitoring at scale, Microsoft Sentinel is Azure's cloud-native SIEM: it ingests logs from Azure, Microsoft 365, and third-party sources into a Log Analytics workspace, applies analytics rules to detect threats, and orchestrates investigation and response with playbooks (Logic Apps). Sentinel is the answer when a scenario asks for centralised security event analysis, threat hunting, or automated incident response across hybrid sources. Remember its cost driver: ingestion volume — use data collection rules and filtering to ingest what matters.
Cost and retention design
Monitoring cost is dominated by log ingestion and retention. Control it by: collecting only needed log categories; using basic logs (cheaper, lower-query-performance tier) for high-volume verbose logs; setting table-level retention (different tables, different retention); archiving old data to storage; and using sampling in Application Insights. Retention requirements often come from compliance: if a regulator requires seven years of audit logs, the design is workspace retention plus archival to a storage account with immutability policies — not seven years of hot workspace retention.
Workspace strategy at scale
As an estate grows, workspace design becomes a genuine architecture decision. A single central workspace simplifies cross-resource queries, alerting, and Sentinel deployment, and it is Microsoft's general recommendation. Multiple workspaces are justified by concrete requirements: data residency (logs must stay in a specific region), chargeback (separate bills per business unit), access isolation (different teams must not see each other's logs), or retention differences (one workload needs seven years, another needs 30 days). Cross-workspace queries can join data across workspaces when centralisation is not possible, and Azure Lighthouse lets a central operations team manage monitoring across tenants. For access control, use table-level RBAC and resource-context access so teams see only their own data. A common exam trap is recommending a workspace per resource group or per application — that fragments querying and alerting and multiplies management overhead. Centralise by default, split only for a stated requirement, and document the reason.
Exam traps to watch for
- Routing all platform logs to a storage account and expecting to query them easily — storage is for archival; Log Analytics is for querying and alerting.
- Using the retired Log Analytics agent in a new design — the Azure Monitor Agent with data collection rules is the current approach.
- Enabling every log category on every resource — ingestion cost explodes; collect what you need and use basic logs for verbose data.
- Alerting on infrastructure metrics instead of user-facing symptoms — alert on availability, latency, and error rate first.
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.A company must retain Azure activity logs for seven years for regulatory compliance, but only needs to query the most recent 90 days interactively. What is the most cost-effective design?
Explanation: The workspace gives fast interactive querying for 90 days, while the storage account provides cheap long-term archival for the remaining seven years — the standard compliance pattern. Option B is wrong because seven years of hot workspace retention is far more expensive than archival storage. Option C is wrong because an event hub is a streaming pipe, not a retention store. Option D is wrong because manual monthly exports are unreliable and unqueryable at scale.
Exam objective: AZ-305 Domain 1: Design solutions for logging and monitoring
Q2.An operations team needs to be notified immediately when any virtual machine in the production subscription is deleted. Which alert type should the architect recommend?
Explanation: VM deletion is a control-plane operation recorded in the activity log, so an activity log alert on that event fires immediately and precisely. Option A is wrong because CPU metrics have nothing to do with deletion. Option B is wrong because a scheduled log query is delayed and indirect when a purpose-built alert type exists. Option C is wrong because resource health alerts report Azure platform health, not user-initiated deletions.
Exam objective: AZ-305 Domain 1: Design solutions for logging and monitoring
Q3.A microservices application on AKS is experiencing intermittent slow responses, but no single service shows high CPU or memory use. What should the architect recommend to find the cause?
Explanation: Distributed tracing follows individual requests across service boundaries, revealing which hop in the chain is slow — exactly what is needed when no single service looks unhealthy. Option B is wrong because cluster logs in storage do not trace requests across services. Option A is wrong because node CPU is not the problem and would not localise the slow hop. Option C is wrong because longer retention does not add request-level visibility.
Exam objective: AZ-305 Domain 1: Design solutions for logging and monitoring
Q4.A company has hundreds of Azure resources and wants to guarantee that diagnostic settings are enabled on every new Key Vault and storage account. What is the most reliable approach?
Explanation: A DeployIfNotExists policy automatically deploys diagnostic settings on existing resources that lack them and on every new resource of those types — guaranteed coverage at scale. Option B is wrong because manual processes are unreliable across hundreds of resources. Option A is wrong because workspaces are destinations, not a mechanism to enable settings. Option D is wrong because Defender for Cloud assesses security posture; it does not configure diagnostic settings.
Exam objective: AZ-305 Domain 1: Design solutions for logging and monitoring
Q5.A security team wants to collect security events from Azure, Microsoft 365, and on-premises firewalls in one place, run threat-detection rules over them, and automate incident response. Which service should the architect recommend?
Explanation: Microsoft Sentinel is Azure's cloud-native SIEM: it centralises security data from Azure, Microsoft 365, and third-party sources, applies analytics rules for threat detection, and automates response with playbooks. Option D is wrong because workbooks are interactive reports, not a SIEM. Option A is wrong because availability tests check whether a URL responds, not security events. Option B is wrong because Service Health reports Azure platform incidents, not customer security telemetry.
Exam objective: AZ-305 Domain 1: Design solutions for logging and monitoring
Q6.A high-traffic web application generates enormous Application Insights telemetry, and the ingestion cost is now a problem. What should the architect recommend to control cost while keeping representative data?
Explanation: Adaptive sampling reduces the volume of ingested telemetry while keeping a statistically representative sample, directly controlling cost without losing visibility. Option C is wrong because it removes all application monitoring. Option A is wrong because longer retention increases cost rather than reducing it. Option B is wrong because an event hub is a different destination, not a volume control, and would break Application Insights features.
Exam objective: AZ-305 Domain 1: Design solutions for logging and monitoring
Q7.An operations team wants a single interactive report that combines text explanations, KQL query results, and charts for their weekly operations review. Which Azure Monitor feature should the architect recommend?
Explanation: Workbooks combine text, parameters, KQL queries, and visualisations into interactive reports — built for exactly this operations-review use case. Option C is wrong because dashboards pin tiles for at-a-glance views but lack text, parameters, and interactivity. Option A is wrong because alerts notify on conditions; they are not reports. Option D is wrong because data export rules move data out of the workspace rather than presenting it.
Exam objective: AZ-305 Domain 1: Design solutions for logging and monitoring
Q8.A company runs VMs across three regions and needs to collect different log sets from production VMs than from development VMs, sending each to its own workspace. Which mechanism should the architect recommend?
Explanation: Data collection rules define what the Azure Monitor Agent collects and where it sends it; separate DCRs for production and development give each environment its own log set and destination workspace. Option B is wrong because a single DCR cannot send different data to different workspaces. Option D is wrong because diagnostic settings on a VNet collect network logs, not VM logs. Option A is wrong because an Audit policy only reports compliance; it does not collect logs.
Exam objective: AZ-305 Domain 1: Design solutions for logging and monitoring
Q9.During a planned maintenance window, an on-call engineer is woken by alerts for services that are intentionally offline. What should the architect recommend to prevent this in future windows?
Explanation: Alert processing rules can suppress alert notifications during a defined maintenance window while keeping the alert rules themselves intact — the standard approach. Option B is wrong because deleting and recreating rules is error-prone and risks losing configuration. Option C is wrong because disabling the workspace would stop all monitoring and data collection. Option A is wrong because the engineer still needs alerts outside maintenance windows.
Exam objective: AZ-305 Domain 1: Design solutions for logging and monitoring