Hi all,
I'm having an issue with this which I think is permissions related. Alert isn't firing even though the MI has reader access to Log Analytics and the resources I'm querying (see below) When I run the query it works fine.....
arg("").Resources
| where type == 'microsoft.compute/virtualmachines'
| where tolower(tostring(tags.is_live)) == "t" or tolower(tostring(tags.is_live)) == "test" // Send alert if the is_live
| project TResourceID=tolower(id), tags
| join (Heartbeat
| where TimeGenerated > ago(12h)
| summarize LastCall = max(TimeGenerated) by Computer, _ResourceId
//| where LastCall < ago(15m)
| where LastCall < ago(5m)
| project
HResourceID = _ResourceId
,Computer
,LastCall
)
on $left.TResourceID == $right.HResourceID
| project Computer, HResourceID, TResourceID,tags, LastCall
Any ideas?