Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (31 sloc) 2.27 KB
title description ms.service services author ms.author manager reviewer ms.devlang ms.workload ms.topic ms.date ms.custom
Query data from an Azure Time Series Insights GA environment using C# code | Microsoft Docs
This article describes how to query data from an Azure Time Series Insights environment by coding a custom app written in the C# (C-sharp) .NET language.
time-series-insights
time-series-insights
ashannon7
dpalled
cshankar
jasonwhowell, kfile, tsidocs
csharp
big-data
conceptual
10/03/2019
seodec18

Query data from the Azure Time Series Insights GA environment using C#

This C# example demonstrates how to query data from the Azure Time Series Insights GA environment.

The sample shows several basic examples of Query API usage:

  1. As a preparation step, acquire the access token through the Azure Active Directory API. Pass this token in the Authorization header of every Query API request. For setting up non-interactive applications, see Authentication and authorization. Also, ensure all the constants defined at the beginning of the sample are correctly set.
  2. The list of environments that the user has access to is obtained. One of the environments is picked up as the environment of interest, and further data is queried for this environment.
  3. As an example of HTTPS request, availability data is requested for the environment of interest.
  4. As an example of web socket request, event aggregates data is requested for the environment of interest. Data is requested for the whole availability time range.

[!NOTE] The example code is available at https://github.com/Azure-Samples/Azure-Time-Series-Insights.

Project Dependencies

Add NuGet packages Microsoft.IdentityModel.Clients.ActiveDirectory and Newtonsoft.Json.

C# example

[!code-csharpcsharpquery-example]

Next steps

You can’t perform that action at this time.