How to fix issue related ScopeResourceId

Mironiuc, Sergiu 0 Reputation points
2023-06-23T15:44:16.7033333+00:00

Hello,

I'm creating an alert that is querying the exceptions.

I use in the bicep template, microsoft.insights/scheduledqueryrules@2022-06-05.

In the template the 'scope' property is mandatory, but the generated query is not valid

exceptions 
| where timestamp >= (datetime(2023-06-23T09:39:13.0000000Z) - 120m) and cloud_RoleName contains 'app-yms-web' 
| project timestamp, outerType, outerMessage, cloud_RoleName, method, customDimensions 
| order by timestamp desc
| where tostring(ScopeResourceId) == @'/subscriptions/135ef97c-33b8-46fd-a22d-1888f9f2992f/resourceGroups/rg-yms-dev-weu-01/providers/Microsoft.Insights/components/appi-yms-dev-weu-01'

The error is following:

'where' operator: Failed to resolve scalar expression named 'ScopeResourceId'

How can I solve this issue?

Thanks in advance for any tips :)

Community Center | Not monitored
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.