Monitoring and Observability Monitoring template-specs-upgraded premium field-manual-template-specs

Scheduled query alert

A scheduled query alert is an Azure Monitor alert built from a KQL query that runs again and again on a defined cadence. Instead of waiting for a metric threshold, it searches logs for a pattern, count, missing signal, or abnormal value. The rule decides whether the query result should fire an alert, then sends notifications or automation through action groups. It is useful when the condition you care about lives in logs, not in a simple platform metric.

Aliases
log search alert, Azure Monitor scheduled query rule, scheduledQueryRules, KQL alert, Log Analytics alert
Difficulty
advanced
CLI mappings
6
Last verified
2026-05-23

Microsoft Learn

Microsoft Learn describes Azure Monitor log search alert rules as alert rules that run a Log Analytics KQL query on a schedule. The rule evaluates returned data against configured conditions, then triggers action groups or alert processing when those conditions are met.

Microsoft Learn: Create Azure Monitor log search alert rules2026-05-23

Technical context

In Azure architecture, a scheduled query alert is a control-plane alert rule that evaluates data from Log Analytics workspaces, Application Insights, or supported resource logs. The rule defines scope, query text, evaluation frequency, lookback window, threshold, dimensions, severity, and action groups. It sits between observability data and incident response. The quality of the KQL query matters as much as the alert settings, because Azure Monitor repeatedly executes the query and turns its result shape into alert instances, noise, or silence.

Why it matters

Scheduled query alerts matter because many production failures are only visible when logs are interpreted together. A failed payment spike, missing ingestion heartbeat, suspicious admin action, or slow dependency pattern may not have a native metric that tells the full story. KQL lets operators express that logic directly, but bad scheduled query alerts can become expensive, noisy, late, or blind. The alert must use the right time window, threshold, grouping dimensions, and action group. A good rule catches a meaningful condition before users escalate it. A weak rule trains teams to ignore alerts or misses the incident entirely. before outages.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

In Azure Monitor Alerts, a log search alert appears as a scheduled query rule with scope, condition, frequency, severity, action group, enabled state, and target resource.

Signal 02

In ARM or Bicep templates, Microsoft.Insights scheduledQueryRules resources store KQL, frequency, window size, threshold, severity, and action settings for repeatable deployment reviews and drift audits.

Signal 03

In Azure CLI output, az monitor scheduled-query show exposes rule criteria, target scopes, dimensions, severity, enabled state, and action group IDs during validation reviews before release.

Signal 04

In incident timelines, fired alert history shows when the KQL query crossed threshold, which resource or dimension matched, and which action group received notification successfully.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Alert when failed payments exceed a threshold by region, using KQL to group application logs by processor and error code.
  • Detect missing ingestion heartbeats when an expected table or device stream stops sending records for a defined window.
  • Trigger operations review when privileged resource changes appear in activity logs outside approved deployment hours.
  • Find slow dependency patterns by querying request and dependency tables together instead of relying on a single metric.
  • Monitor custom business SLIs, such as abandoned checkouts or delayed orders, that are emitted only as application logs.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

SaaS billing platform catches processor failures before customers complain

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A subscription billing platform learned about payment processor outages from support tickets. Native metrics showed request volume but not the specific failure pattern hidden in application logs.

Business/Technical Objectives
  • Detect processor-specific payment failures within ten minutes.
  • Route alerts to the payments squad, not the general infrastructure queue.
  • Avoid paging for small test transactions or expected sandbox errors.
  • Keep the KQL rule exportable for audit and release review.
Solution Using Scheduled query alert

The operations team created an Azure Monitor scheduled query alert against the Application Insights workspace. The KQL filtered production payment attempts, excluded sandbox merchants, grouped failures by processor and error code, and fired only when failures exceeded both a count and percentage threshold. The rule evaluated every five minutes with a fifteen-minute lookback to absorb ingestion delay. An action group sent incidents to the payments on-call channel and opened a ticket with the processor name embedded in the payload. CLI commands listed the rule, exported the KQL, and verified action group IDs during weekly monitoring reviews.

Results & Business Impact
  • Mean time to detect processor incidents fell from 47 minutes to eight minutes.
  • False pages dropped by 38 percent after sandbox traffic and low-volume processors were filtered.
  • Payment rollback decisions started with processor-specific evidence instead of support anecdotes.
  • Quarterly audit reviews used exported alert JSON instead of screenshots from the portal.
Key Takeaway for Glossary Readers

Scheduled query alerts are powerful when the detection logic requires application context that normal platform metrics cannot express.

Case study 02

Water utility finds silent telemetry gaps across remote pump stations

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A water utility collected pump-station telemetry through IoT gateways. Failures were quiet because a disconnected station simply stopped writing records to Log Analytics.

Business/Technical Objectives
  • Alert when any critical station stopped sending telemetry for 20 minutes.
  • Separate true silence from scheduled maintenance windows.
  • Include station ID and region in each alert for dispatch routing.
  • Reduce manual dashboard checks during overnight shifts.
Solution Using Scheduled query alert

Engineers built a scheduled query alert that joined the station inventory table with recent telemetry records. The KQL found critical stations with no records in the last 20 minutes, excluded maintenance-tagged stations, and projected station ID, region, and last-seen time as dimensions. The alert evaluated every ten minutes and used a regional action group so the right field team received the notification. Operators used CLI to confirm the rule scope, enabled state, severity, and action group after each inventory update. A workbook displayed recent alert instances beside gateway health metrics for faster triage. The final rule was tagged for plant ownership.

Results & Business Impact
  • Silent telemetry gaps were detected 52 minutes faster on average.
  • Overnight manual dashboard checks dropped from twelve per shift to three targeted reviews.
  • Field dispatch tickets included station ID and last-seen time automatically.
  • Maintenance-window false positives fell by 61 percent after inventory tags were included in KQL.
Key Takeaway for Glossary Readers

A scheduled query alert can detect absence, not just bad values, when KQL compares expected assets with actual telemetry.

Case study 03

Online education provider spots account-sharing abuse from sign-in logs

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

An online education provider saw unusual license usage but could not distinguish legitimate travel from credential sharing. The pattern was visible only after combining sign-in logs and course activity.

Business/Technical Objectives
  • Flag accounts active from three distant regions within one hour.
  • Avoid blocking users automatically without human review.
  • Send evidence to the trust team with the affected account and regions.
  • Keep alert logic versioned with other monitoring rules.
Solution Using Scheduled query alert

The trust engineering group wrote a KQL query that summarized sign-in and course-start events by account, location, and time window. A scheduled query alert ran the query every fifteen minutes, fired only when regional spread and activity count crossed thresholds, and routed to a trust-team action group rather than security operations. The alert payload included account ID, regions, and sample timestamps for review. The rule was deployed from Bicep, while Azure CLI commands listed current rules and action groups to catch portal drift. Analysts tuned thresholds using historical logs before moving the rule to production.

Results & Business Impact
  • Abuse investigations started 36 minutes sooner than the previous weekly report process.
  • Manual false reviews dropped by 29 percent after course activity was added to the query.
  • License leakage from confirmed sharing cases fell by an estimated $74,000 per quarter.
  • The trust team gained repeatable evidence without receiving full raw sign-in exports.
Key Takeaway for Glossary Readers

Scheduled query alerts turn recurring log analysis into a governed operational signal when the response needs context, routing, and review.

Why use Azure CLI for this?

After a decade around Azure operations, I use Azure CLI for scheduled query alerts because alert rules are too easy to misread in the portal. CLI lets me list every rule, export KQL, compare evaluation frequency, verify scopes, inspect severity, and confirm action groups across subscriptions. It also makes alert review repeatable in pipelines. The most common failures I see are not dramatic platform issues; they are a query scoped to the wrong workspace, a window shorter than ingestion delay, or a disabled action group nobody noticed after a reorganization. It also makes alert drift visible during platform reviews quickly.

CLI use cases

  • Inventory scheduled query alert rules by resource group before a monitoring cleanup or ownership review.
  • Export a rule's KQL, scopes, severity, enabled state, frequency, and action groups for change evidence.
  • Disable a noisy rule temporarily during a maintenance window while preserving its definition for rollback.
  • Compare action groups across similar rules to find alerts routed to old teams or unused webhooks.
  • Create a reviewed rule from pipeline inputs so portal-only alert drift does not accumulate.

Before you run CLI

  • Confirm tenant, subscription, resource group, alert rule name, monitored scope, workspace, and output format before inspecting or changing rules.
  • Check permissions for Microsoft.Insights resources, action groups, workspace read access, and any deployment pipeline identity involved.
  • Treat updates as production-affecting because disabling or changing a query can hide incidents or page the wrong responders.

What output tells you

  • enabled, severity, scopes, and evaluation settings reveal whether the rule can currently fire for the intended resources.
  • The condition and query fields show the KQL, aggregation, threshold, dimensions, and window used to decide alert state.
  • Action group IDs identify notification or automation targets that receive fired alerts and should match current ownership.

Mapped Azure CLI commands

Azure Monitor scheduled query alert operations

direct
az monitor scheduled-query list --resource-group <resource-group> --output table
az monitor scheduled-querydiscoverMonitoring and Observability
az monitor scheduled-query show --resource-group <resource-group> --name <alert-rule-name>
az monitor scheduled-querydiscoverMonitoring and Observability
az monitor scheduled-query create --resource-group <resource-group> --name <alert-rule-name> --scopes <resource-id> --condition <condition> --evaluation-frequency <duration> --window-size <duration>
az monitor scheduled-queryprovisionMonitoring and Observability
az monitor scheduled-query update --resource-group <resource-group> --name <alert-rule-name> --disabled true
az monitor scheduled-queryconfigureMonitoring and Observability
az monitor action-group show --resource-group <resource-group> --name <action-group-name>
az monitor action-groupdiscoverMonitoring and Observability
az monitor log-analytics workspace show --resource-group <resource-group> --workspace-name <workspace-name>
az monitor log-analytics workspacediscoverMonitoring and Observability

Architecture context

Architecturally, scheduled query alerts are the bridge between telemetry design and human or automated response. They depend on diagnostic settings, workspace retention, table schemas, ingestion latency, KQL quality, and action group routing. I treat them as production code: named clearly, stored as infrastructure, reviewed for cost, and tested with known-good data. They should not replace metric alerts where metrics are enough, but they are excellent for correlation, absence detection, security signals, and application-specific failure modes. The rule must fit the escalation path; otherwise, it becomes another noisy artifact in the monitoring estate. It also clarifies ownership across noisy shared workspaces.

Security

Security impact can be direct when the scheduled query alert detects privileged activity, data exfiltration patterns, failed authentication bursts, or unexpected resource changes. The rule itself also needs governance because it can expose sensitive KQL, resource scopes, dimensions, and action routing. Operators should restrict who can edit alert rules and action groups, avoid embedding secrets in webhook payloads, and verify that notification channels do not leak confidential data. A mis-scoped rule may miss suspicious activity in another workspace, while an overbroad rule can create noisy alerts that hide real threats. Alert modification should be auditable through activity logs and change controls.

Cost

Scheduled query alerts affect cost indirectly through repeated log queries, workspace ingestion, retention, action handling, and engineering time spent on noisy incidents. The alert rule is not just a notification object; it repeatedly asks Azure Monitor to scan data. Wide queries, long lookback windows, high frequency, and unnecessary cross-workspace scope can increase query load and delay evaluation. Cost also appears when noisy rules page people unnecessarily or trigger automation too often. FinOps review should examine query efficiency, table choice, evaluation cadence, alert volume, and whether an equivalent metric alert would be cheaper and faster for the same signal. over time.

Reliability

Reliability impact is direct because scheduled query alerts often provide the first actionable signal for incidents that metrics do not express. Reliable rules account for ingestion latency, query duration, evaluation frequency, lookback window, and transient log gaps. A rule that runs every minute with a one-minute window may miss delayed records, while a large window may fire repeatedly for the same event. Alert reliability also depends on action group health, suppression rules, and ownership. Good teams test rules against historical incidents, document expected result counts, and monitor whether rules stop firing because data stopped arriving rather than because the system became healthy.

Performance

Performance matters because scheduled query alerts execute KQL repeatedly under time constraints. Inefficient queries can evaluate slowly, miss the intended cadence, or add load to workspaces that already serve dashboards and investigations. Operators should avoid unnecessary joins, project only needed columns, filter early by time and resource, and test the query with realistic data volume. Query performance also affects detection latency: a slow rule can make an urgent incident visible later than expected. The best alerts use tight scopes, clear aggregation, stable dimensions, and evaluation windows that tolerate ingestion delay without scanning more data than needed. during peak load testing.

Operations

Operators manage scheduled query alerts by listing rules, reviewing KQL, checking scopes, testing queries in Log Analytics, validating action groups, and watching fired alert history. Runbooks should record why the query exists, what table schema it expects, what result count is abnormal, and who owns remediation. During troubleshooting, operators compare the query result in the workspace with the alert rule settings, then check evaluation time, dimensions, severity, mute actions, and action-group delivery. Mature teams export rules as ARM, Bicep, or Terraform so alert changes follow review and rollback rather than portal-only edits. during weekly service reviews and incident follow-ups reliably.

Common mistakes

  • Using an evaluation window shorter than log ingestion delay, causing intermittent missed alerts.
  • Writing KQL that works interactively but scans too much data or returns a shape the alert condition cannot evaluate.
  • Forgetting to review action groups, so alerts fire correctly but notify retired channels or unowned webhooks.