Thanks for posting your question in the Microsoft Q&A forum.
There are a few potential reasons why your alert might not be firing despite seeing the row when you run the query manually.
- Ensure that the alert rule is properly configured with the correct threshold and frequency. check if the alert condition is set to "Number of results" greater than 0.
- The alert evaluation might be using a different time range than what you're using when running the query manually.
- Ensure you're using a "Log Analytics" alert rule type, which is designed for custom log queries.
- To potentially improve the alert's reliability, you could modify the query to focus on the most recent data:
Heartbeat | summarize TimeGenerated=max(TimeGenerated) by Computer, _ResourceId | extend Duration = datetime_diff('minute', now(), TimeGenerated) | where Duration > 7 | project Computer, _ResourceId, MinutesSinceLastHeartbeat = Duration
- Enable diagnostic settings for your Alert Rules to send logs to a Log Analytics workspace.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful