We are using Azure Application Insights as primary storage for application events/exceptions/etc.
The goal is to build a custom reporting system on .net 6
. The app should connect to Azure Application Insights, execute some query and then handle retrieved events in a particular way.
There is a lot of information, how to write events to Application Insight, but mere info about querying from 3rd party app. Could someone point me in the correct way? Thanks beforehand.
You can use the REST API for this:
...a set of REST APIs created to make data collected by Application Insights easily available. Using these APIs you can build new visualizations of your application's data...
There are several APIs...:
Metrics: ...to retrieve metric data such as the number of exceptions each hour for the last day ... [via] a metric name, a timespan, time intervals, the type of aggregation (sum, average, minimum or maximum) and the property over which to segment the data...
Events: ...allows users rich capabilities to access their event data using OData ... supports $filter, $orderBy, $search, $apply, $top, $skip and $format...
Query: ...designed to enable users API access to the same data using the same queries as they do with Application Insights Analytics...