Application Insights SDK Retrieve Custom Events Data

HUGO AGUIRRE MARQUEZ 21 Reputation points
2021-09-14T21:35:26.007+00:00

Hello,
I have an event called "Search Term" and one of his properties is "search" which contains the phrase that the user typed.
I want to analyze the data in the backend and create a list of the most popular searches in the site, but I didn't find a way to retrieve the custom event data through the SDK (the only method that I saw to consume data is GetMetric).
Is there a way to do it?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,825 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,302 questions
{count} votes

1 additional answer

Sort by: Most helpful
  1. Monalla-MSFT 11,961 Reputation points
    2021-09-28T19:29:52.697+00:00

    @Hugo Aguirre - Thanks for reaching out and for providing the solution that worked for you.

    Here is another SDK that you can take a look at.

    A C# SDK is made available for querying an Application Insights app. It supports the full query language.

    The SDK is available via NuGet here: https://www.nuget.org/packages/Microsoft.Azure.ApplicationInsights.Query

    Additionally, you can leverage the Microsoft.Rest.ClientRuntime.Azure.Authentication package for easier authentication with AAD in lieu of providing your own implementation of ServiceClientCredentials.

    Here is the doc for your reference : CSharp-Sdk

    Hope this helps.

    If the above response helped, please feel free to "Accept as Answer" so it can be beneficial to the community.

    0 comments No comments