0
votes

I'm using Azure Application Insights REST API to get data and want to filter on cloud/roleName. Filter on cloud/roleName is not working. I tried in https://dev.applicationinsights.io/apiexplorer and it will show "Unexpected error occurred" message. open this url for more details.

https://dev.applicationinsights.io/apiexplorer/events?appId=DEMO_APP&apiKey=DEMO_KEY&eventType=requests&$filter=startswith(cloud%2FroleName%2C%20%27fabrikam%27)%20%20

how can I will apply filter on cloud/roleName? If I will add one more filter then it will work. This url is working https://dev.applicationinsights.io/apiexplorer/events?appId=DEMO_APP&apiKey=DEMO_KEY&eventType=requests&$filter=startswith(cloud%2FroleName%2C%20%27fabrikam%27)%20and%20(request%2FresultCode%20ne%20%27200%27%20)

1
That's weird. How about using get query and querying a real application insights? - Ivan Yang
You can post your solution as an answer:). - Ivan Yang

1 Answers

-1
votes

I'm using QueryAsync method and running kql query. it's working fine but it will return data as table or IEnumerable<IDictionary<string, string>>, so it will be extra work to parse the data into strongly type.