Study guide
9.2 Log Analytics, KQL, and Operational Queries
AZ-104 Microsoft Azure Administrator Study Guide Exam
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Orientation and Microsoft Learn Source Control
1.1 Current AZ-104 Exam Facts 1.2 Administrator Role and Candidate Profile 1.3 Skills Outline and Weighted Study Map 1.4 Exam Duration, Question Types, Labs, and Learn Access 1.5 Scoring, Retakes, Renewal, and Account Choice 1.6 Using the Practice Bank, Labs, and Error Log
2 Chapter 2: Identity, RBAC, and Governance Foundations
2.1 Microsoft Entra Users, Groups, and Properties 2.2 Licenses, External Users, and SSPR 2.3 Azure RBAC Built-In Roles and Scopes 2.4 Role Assignment Interpretation and Deny Effects 2.5 Management Groups, Subscriptions, and Resource Groups 2.6 Azure Policy, Locks, Tags, and Governance Controls 2.7 Identity and Governance Case Lab
3 Chapter 3: Subscriptions, Policy, Costs, and Resource Organization
3.1 Subscription Design and Management Groups 3.2 Resource Groups, Lifecycle, and Move Operations 3.3 Tagging Strategy and Cost Allocation 3.4 Budgets, Alerts, and Azure Advisor Cost Recommendations 3.5 Policy, Initiative, Assignment, and Remediation 3.6 Resource Locks, RBAC, Policy, and Tags Combined 3.7 Governance and Cost Case Lab
4 Chapter 4: Storage Accounts, Access, and Data Protection
4.1 Storage Account Design, Redundancy, and Encryption 4.2 Storage Firewalls, Private Access, and Network Rules 4.3 SAS Tokens, Stored Access Policies, and Access Keys 4.4 Identity-Based Access for Azure Files 4.5 Blob Tiers, Lifecycle, Soft Delete, and Versioning 4.6 Azure Files, Snapshots, File Sync, and AzCopy 4.7 Storage Case Lab
5 Chapter 5: Compute, Virtual Machines, Scale Sets, and Bicep
5.1 ARM Templates, Bicep, and Deployment Workflow 5.2 Create, Configure, and Manage Virtual Machines 5.3 VM Disks, Sizes, Encryption, and Host Settings 5.4 Availability Zones, Sets, and VM Scale Sets 5.5 Move VMs Across Resource Groups, Subscriptions, and Regions 5.6 Backup, Restore, and Operational Maintenance for VMs 5.7 VM Compute Case Lab
6 Chapter 6: Containers, App Service, and Platform Compute
6.1 Azure Container Registry and Image Workflow 6.2 Azure Container Instances and Container Apps 6.3 Container Sizing, Scaling, and Environment Choices 6.4 App Service Plan, Apps, and Runtime Configuration 6.5 App Service Certificates, TLS, Custom Domains, and Networking 6.6 App Service Backups, Deployment Slots, and Scaling 6.7 Platform Compute Case Lab
7 Chapter 7: Virtual Networking, Routing, and Secure Access
7.1 VNet, Subnet, and Address Space Design 7.2 VNet Peering and Cross-Network Connectivity 7.3 Public IP Addresses and NAT Patterns 7.4 User-Defined Routes and Effective Routes 7.5 NSGs, ASGs, and Effective Security Rules 7.6 Azure Bastion, Service Endpoints, and Private Endpoints 7.7 Secure Networking Case Lab
8 Chapter 8: Name Resolution, Load Balancing, and Connectivity Troubleshooting
8.1 Azure DNS, Private DNS, and Name Resolution 8.2 Public and Internal Load Balancer Design 8.3 Backend Pools, Health Probes, and Load Balancing Rules 8.4 Load Balancing Troubleshooting Workflow 8.5 Network Watcher: IP Flow, Next Hop, and Connection Troubleshoot 8.6 Hybrid Connectivity, VPN, ExpressRoute, and DNS Considerations 8.7 Connectivity Troubleshooting Case Lab
9 Chapter 9: Monitoring, Alerting, Backup, and Site Recovery
9.1 Azure Monitor Metrics, Logs, and Diagnostic Settings 9.2 Log Analytics, KQL, and Operational Queries 9.3 Alert Rules, Action Groups, and Alert Processing Rules 9.4 VM, Storage, and Network Insights 9.5 Recovery Services Vault, Backup Vault, and Backup Policies 9.6 Azure Site Recovery, Failover, and Replication 9.7 Monitoring and Recovery Case Lab
10 Chapter 10: AZ-104 Integration and Troubleshooting Case Labs
10.1 Domain Weight Triage and Study Prioritization 10.2 Identity, Storage, and Compute Integrated Cases 10.3 Networking, Monitoring, and Security Integrated Cases 10.4 Migration, Move, Backup, and Recovery Cases 10.5 Permissions, Network, and Storage Troubleshooting Chain 10.6 Microsoft Learn Lookup Strategy Under Time Pressure 10.7 Full-Domain Case Lab
11 Chapter 11: Final Review, Exam Experience, Renewal, and Career Path
11.1 Final Two-Week Study Plan 11.2 Hands-On Lab Checklist and Command Review 11.3 Exam Day, Pearson VUE, Breaks, and Learn Access 11.4 Retake Plan, Score Report, and Weak-Domain Repair 11.5 Renewal Assessment and Annual Certification Maintenance 11.6 After AZ-104: AZ-305, AZ-400, SC-500, and Job Paths
9.2 Log Analytics, KQL, and Operational Queries
Key Takeaways Explain This Topic AI
KQL queries start with a table, filter early with where, shape columns with project, and aggregate with summarize.
TimeGenerated is the primary timestamp used to control the analysis window in Log Analytics.
Operational KQL should answer a specific support question, such as what failed, where it failed, and whether it is still happening.
Joins, parse, extend, bin, and render are useful for correlation, extraction, time grouping, and visualization.
AZ-104 usually tests practical query interpretation rather than advanced data science.
Last updated: May 2026
KQL mental model
Kusto Query Language, or KQL, is a pipeline language. A query normally starts with a table, then each pipe character sends the current result set to the next operation. For AZ-104, the most important habit is to filter early, summarize intentionally, and project only the columns needed to answer the operational question.
- A basic pattern looks like this: AzureActivity
- | where TimeGenerated > ago(24h)
- | where ActivityStatusValue == "Failed"
- | project TimeGenerated, ResourceGroup, ResourceProviderValue, OperationNameValue, Caller, ActivityStatusValue
- | order by TimeGenerated desc
This query asks for failed control plane activity in the last day. It uses TimeGenerated for the time window, where to reduce the data, project to keep useful columns, and order by to put recent events first. If a question asks why a deployment failed or who attempted a change, this is the kind of query you should recognize.
KQL is case-sensitive in some operators and functions. == is case-sensitive. =~ is case-insensitive. has is usually better than contains for tokenized text search because it can be more efficient and semantically cleaner. Exam questions generally avoid obscure syntax, but they may expect you to identify the query that counts failures or filters the correct time range.
Common operators
- Operator Purpose Example
- where Filter rows where TimeGenerated > ago(1h)
- project Select or rename columns project TimeGenerated, Computer, CounterValue
- extend Add calculated columns extend Percent = CounterValue * 100
- summarize Aggregate rows summarize Count=count() by ResourceGroup
- bin Group time into intervals by bin(TimeGenerated, 5m)
- order by Sort results order by Count desc
- join Combine tables join kind=leftouter (...) on ResourceId
- render Visualize result render timechart
- A useful metric-like log query groups records into time buckets: AzureActivity
- | where TimeGenerated > ago(6h)
- | where ActivityStatusValue in ("Failed", "Succeeded")
- | summarize Events=count() by ActivityStatusValue, bin(TimeGenerated, 15m)
- | render timechart
This helps an administrator see whether failures are isolated or part of a larger deployment issue.
VM operational queries
VM monitoring has multiple sources. Platform metrics can show CPU percentage, but guest-level logs and performance counters require Azure Monitor Agent and data collection rules. Depending on configuration, you may query tables such as Perf , InsightsMetrics , Heartbeat , Event , or Syslog .
- Heartbeat is a simple availability clue: Heartbeat
- | where TimeGenerated > ago(30m)
- | summarize LastHeartbeat=max(TimeGenerated) by Computer, _ResourceId
- | extend MinutesSinceHeartbeat = datetime_diff("minute", now(), LastHeartbeat)
- | where MinutesSinceHeartbeat > 10
- | order by MinutesSinceHeartbeat desc
This does not prove the application is healthy. It only shows that the monitoring agent has not reported recently. Use it to separate monitoring-agent silence from platform availability questions.
- A Windows event investigation might start like this: Event
- | where TimeGenerated > ago(2h)
- | where EventLevelName in ("Error", "Critical")
- | project TimeGenerated, Computer, EventLog, Source, EventID, RenderedDescription
- | order by TimeGenerated desc
- A Linux syslog investigation might use: Syslog
- | where TimeGenerated > ago(2h)
- | where SeverityLevel in ("err", "crit", "alert", "emerg")
- | project TimeGenerated, Computer, Facility, ProcessName, SyslogMessage
- | order by TimeGenerated desc
- Storage and network queries
Storage diagnostic logs can support troubleshooting that metrics alone cannot. If users report intermittent authorization failures, summarize by status and caller address: StorageBlobLogs
- | where TimeGenerated > ago(1h)
- | where StatusCode in (401, 403)
- | summarize Failures=count() by StatusCode, AuthenticationType, CallerIpAddress, bin(TimeGenerated, 5m)
- | order by TimeGenerated desc
The exact table depends on the resource and diagnostic configuration. The exam will often give table names in the choices. Choose the query that filters the relevant time range and status code instead of one that counts unrelated successful traffic.
For network security group flow logs or traffic analytics, the table names and schema depend on the enabled feature version. The operational goal is the same: filter by source, destination, port, direction, and action, then summarize to identify denied flows. A troubleshooting query should answer whether the network blocked traffic, whether traffic never arrived, or whether a later layer failed.
Alert query design
A log alert query should return a numeric result that can be evaluated. A support query may return rows for humans. Those are different shapes. For a log alert that fires when more than five failed deployments occur in ten minutes, write a query that counts failures: AzureActivity
- | where TimeGenerated > ago(10m)
- | where ActivityStatusValue == "Failed"
- | where OperationNameValue has "deployments"
- | summarize FailedDeployments=count()
Then configure the alert condition so it fires when FailedDeployments is greater than 5. If a query returns many columns and raw rows, it may be useful for investigation but awkward for a numeric alert rule.
Troubleshooting bad queries
When a query returns no data, confirm the table has data before debugging the filters. Start with the table name and a short time window: AzureActivity
| take 10
Then add where TimeGenerated > ago(24h) , then add one filter at a time. Check the time picker in the portal because it can override or interact with query expectations. Confirm column names from the schema pane. If you search text with exact case and get no result, try a case-insensitive operator such as =~ or search a broader field.
When a query is slow, reduce the time range, filter early, avoid unnecessary contains , project fewer columns, and summarize before joining. For AZ-104, performance tuning is not deep, but the administrator should know that querying seven years of raw logs interactively is not the same design as exporting logs for compliance retention.
Scenario recognition
If a question says "show a chart of average CPU by VM every five minutes," a metric chart or metric query may be enough. If it says "show failed administrative operations by caller," use AzureActivity . If it says "find VMs whose monitoring agent stopped reporting," query Heartbeat . If it says "count 403 blob operations by IP," use the storage resource log table after diagnostic settings are configured. If it says "build an alert from a complex count of log records," shape the KQL query to return a numeric result.