Skip to content

Commit 87d1ae2

Browse files
authored
Merge pull request #103135 from KingdomOfEnds/tsi-refresh
updated csharp docs
2 parents fd6c0de + 14f2194 commit 87d1ae2

File tree

2 files changed

+53
-17
lines changed

2 files changed

+53
-17
lines changed

articles/time-series-insights/time-series-insights-query-data-csharp.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: cshankar
99
ms.devlang: csharp
1010
ms.workload: big-data
1111
ms.topic: conceptual
12-
ms.date: 01/31/2020
12+
ms.date: 02/03/2020
1313
ms.custom: seodec18
1414
---
1515

@@ -45,13 +45,9 @@ The sample code below demonstrates the following features:
4545
Complete the following steps before you compile and run the sample code:
4646

4747
1. [Provision a GA Azure Time Series Insights](https://docs.microsoft.com/azure/time-series-insights/time-series-insights-get-started) environment.
48-
4948
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-
5149
1. Install the required project dependencies.
52-
5350
1. Edit the sample code below by replacing each **#DUMMY#** with the appropriate environment identifier.
54-
5551
1. Execute the code inside Visual Studio.
5652

5753
## Project dependencies
@@ -65,7 +61,9 @@ The sample code has two required dependencies:
6561
* [Microsoft.IdentityModel.Clients.ActiveDirectory](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/) - 3.13.9 package.
6662
* [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json) - 9.0.1 package.
6763

68-
Add the packages using [NuGet 2.12+](https://www.nuget.org/):
64+
Download the packages in Visual Studio 2019 by selecting the **Build** > **Build Solution** option.
65+
66+
Alternatively, add the packages using [NuGet 2.12+](https://www.nuget.org/):
6967

7068
* `dotnet add package Newtonsoft.Json --version 9.0.1`
7169
* `dotnet add package Microsoft.IdentityModel.Clients.ActiveDirectory --version 3.13.9`

articles/time-series-insights/time-series-insights-update-query-data-csharp.md

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,68 @@ manager: cshankar
99
ms.devlang: csharp
1010
ms.workload: big-data
1111
ms.topic: conceptual
12-
ms.date: 12/05/2019
12+
ms.date: 02/03/2020
1313
ms.custom: seodec18
1414
---
1515

1616
# Query data from the Azure Time Series Insights Preview environment using C#
1717

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.
1919

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).
2122
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
2624

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:
31+
32+
* [Preview Environments API](https://docs.microsoft.com/rest/api/time-series-insights/preview#preview-environments-apis)
33+
* [Get Environments Availability API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/query/getavailability) and [Get Event Schema API](https://docs.microsoft.com/rest/api/time-series-insights/dataaccess(preview)/query/geteventschema)
34+
* [Preview Query API](https://docs.microsoft.com/rest/api/time-series-insights/preview#query-apis)
35+
* [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:
64+
65+
* `dotnet add package Microsoft.IdentityModel.Clients.ActiveDirectory --version 4.5.1`
2966

30-
## C# example
67+
## C# sample code
3168

3269
[!code-csharp[csharpquery-example](~/samples-tsi/csharp-tsi-preview-sample/DataPlaneClientSampleApp/Program.cs)]
3370

3471
> [!NOTE]
35-
> The code sample above can be run without altering the default environment values.
72+
> * The code sample can be executed without altering the default environment variables.
73+
> * The code sample will compile to a .NET executable console app.
3674
3775
## Next steps
3876

0 commit comments

Comments
 (0)