You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/time-series-insights/time-series-insights-query-data-csharp.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ manager: cshankar
9
9
ms.devlang: csharp
10
10
ms.workload: big-data
11
11
ms.topic: conceptual
12
-
ms.date: 01/31/2020
12
+
ms.date: 02/03/2020
13
13
ms.custom: seodec18
14
14
---
15
15
@@ -45,13 +45,9 @@ The sample code below demonstrates the following features:
45
45
Complete the following steps before you compile and run the sample code:
46
46
47
47
1.[Provision a GA Azure Time Series Insights](https://docs.microsoft.com/azure/time-series-insights/time-series-insights-get-started) environment.
48
-
49
48
1. Configure your Azure Time Series Insights environment for Azure Active Directory as described in [Authentication and authorization](time-series-insights-authentication-and-authorization.md).
50
-
51
49
1. Install the required project dependencies.
52
-
53
50
1. Edit the sample code below by replacing each **#DUMMY#** with the appropriate environment identifier.
54
-
55
51
1. Execute the code inside Visual Studio.
56
52
57
53
## Project dependencies
@@ -65,7 +61,9 @@ The sample code has two required dependencies:
Copy file name to clipboardExpand all lines: articles/time-series-insights/time-series-insights-update-query-data-csharp.md
+49-11Lines changed: 49 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,30 +9,68 @@ manager: cshankar
9
9
ms.devlang: csharp
10
10
ms.workload: big-data
11
11
ms.topic: conceptual
12
-
ms.date: 12/05/2019
12
+
ms.date: 02/03/2020
13
13
ms.custom: seodec18
14
14
---
15
15
16
16
# Query data from the Azure Time Series Insights Preview environment using C#
17
17
18
-
This C# example demonstrates how to query data from the Azure Time Series Insights Preview environment.
18
+
This C# example demonstrates how to query data from the [Preview Data Access APIs](https://docs.microsoft.com/rest/api/time-series-insights/preview) in Azure Time Series Insights Preview environments.
19
19
20
-
The sample shows several basic examples of Query API usage:
20
+
> [!TIP]
21
+
> View Preview C# code samples at [https://github.com/Azure-Samples/Azure-Time-Series-Insights](https://github.com/Azure-Samples/Azure-Time-Series-Insights/tree/master/csharp-tsi-preview-sample).
21
22
22
-
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, read [Authentication and authorization](time-series-insights-authentication-and-authorization.md). Also, ensure all the constants defined at the beginning of the sample are correctly set.
23
-
1. 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.
24
-
1. As an example of HTTPS request, availability data is requested for the environment of interest.
25
-
1. Provides an example of SDK auto-generation support from [Azure AutoRest](https://github.com/Azure/AutoRest).
23
+
## Summary
26
24
27
-
> [!NOTE]
28
-
> The example code as well as the steps to compile and run it are available at [https://github.com/Azure-Samples/Azure-Time-Series-Insights](https://github.com/Azure-Samples/Azure-Time-Series-Insights/tree/master/csharp-tsi-preview-sample).
25
+
The sample code below demonstrates the following features:
26
+
27
+
* Support for SDK auto-generation from [Azure AutoRest](https://github.com/Azure/AutoRest).
28
+
* How to acquire an access token through Azure Active Directory using [Microsoft.IdentityModel.Clients.ActiveDirectory](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/).
29
+
* How to pass that acquired access token in the `Authorization` header of subsequent Data Access API requests.
30
+
* The sample provides a console interface demonstrating how HTTP requests are made to the:
*[Get Events API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/query/execute#getevents), [Get Series API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/query/execute#getseries), and [Get Aggregate Series API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/query/execute#aggregateseries)
36
+
*[Time Series Model APIs](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/query/execute#aggregateseries)
37
+
*[Get Hierarchies API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/timeserieshierarchies/get) and [Hierarchies Batch API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/timeserieshierarchies/executebatch)
38
+
*[Get Types API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/timeseriestypes/get) and [Types Batch API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/timeseriestypes/executebatch)
39
+
*[Get Instances API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/timeseriesinstances/get) and [Instances Batch API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/timeseriesinstances/executebatch)
40
+
* Advanced [Search](https://docs.microsoft.com/rest/api/time-series-insights/preview#search-features) and [TSX](https://docs.microsoft.com/rest/api/time-series-insights/preview#time-series-expression-and-syntax) capabilities.
41
+
42
+
## Prerequisites and setup
43
+
44
+
Complete the following steps before you compile and run the sample code:
45
+
46
+
1.[Provision a Preview Azure Time Series Insights](https://docs.microsoft.com/azure/time-series-insights/time-series-insights-update-how-to-manage#create-the-environment) environment.
47
+
1. Configure your Azure Time Series Insights environment for Azure Active Directory as described in [Authentication and authorization](time-series-insights-authentication-and-authorization.md).
48
+
1. Run the [GenerateCode.bat](https://github.com/Azure-Samples/Azure-Time-Series-Insights/blob/master/csharp-tsi-preview-sample/DataPlaneClient/GenerateCode.bat) as specified in the [Readme.md](https://github.com/Azure-Samples/Azure-Time-Series-Insights/blob/master/csharp-tsi-preview-sample/DataPlaneClient/Readme.md) to generate the Time Series Insights Preview client dependencies.
49
+
1. Open the `TSIPreviewDataPlaneclient.sln` solution and set `DataPlaneClientSampleApp` as the default project in Visual Studio.
50
+
1. Install the required project dependencies using the steps described [below](#project-dependencies) and compile the example to an executable `.exe` file.
51
+
1. Run the `.exe` file by double-clicking on it.
52
+
53
+
## Project dependencies
54
+
55
+
It's recommended that you use the newest version of Visual Studio:
56
+
57
+
*[Visual Studio 2019](https://visualstudio.microsoft.com/vs/) - Version 16.4.2+
58
+
59
+
The sample code has several required dependencies which can be viewed in the [packages.config](https://github.com/Azure-Samples/Azure-Time-Series-Insights/blob/master/csharp-tsi-preview-sample/DataPlaneClientSampleApp/packages.config) file.
60
+
61
+
Download the packages in Visual Studio 2019 by selecting the **Build** > **Build Solution** option.
62
+
63
+
Alternatively, add each package using [NuGet 2.12+](https://www.nuget.org/). For example:
0 commit comments