Skip to content

Commit bfd75e4

Browse files
committed
updated
1 parent a127230 commit bfd75e4

File tree

2 files changed

+57
-22
lines changed

2 files changed

+57
-22
lines changed

articles/time-series-insights/time-series-insights-manage-reference-data-csharp.md

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

1616
# Manage GA reference data for an Azure Time Series Insights environment using C#
1717

1818
This article demonstrates how to combine C#, [MSAL.NET](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet), and Azure Active Directory to make programmatic API requests to the Azure Time Series Insights GA [Reference Data Management API](https://docs.microsoft.com/rest/api/time-series-insights/ga-reference-data-api).
1919

20-
## Prerequisites
20+
## Summary
21+
22+
The sample code below demonstrates the following features:
23+
24+
* Acquiring an access token using [MSAL.NET](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet) **PublicClientApplication**.
25+
* Sequential CREATE, READ, UPDATE, and DELETE operations against the GA [Reference Data Management API](https://docs.microsoft.com/rest/api/time-series-insights/ga-reference-data-api).
26+
* Common response codes including [common error codes](https://docs.microsoft.com/rest/api/time-series-insights/ga-reference-data-api#validation-and-error-handling).
27+
28+
The Reference Data Management API processes each item individually and an error with one item does not prevent the others from successfully completing. For example, if your request has 100 items and one item has an error, then 99 items are written and one is rejected.
29+
30+
## Prerequisites and setup
2131

2232
Complete the following steps before you compile and run the sample code:
2333

@@ -292,16 +302,6 @@ namespace CsharpTsiMsalGaSample
292302
}
293303
```
294304

295-
## Summary
296-
297-
The sample code above demonstrates the following features:
298-
299-
* Acquiring an access token using [MSAL.NET](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet) **PublicClientApplication**.
300-
* Sequential CREATE, READ, UPDATE, and DELETE operations against the GA [Reference Data Management API](https://docs.microsoft.com/rest/api/time-series-insights/ga-reference-data-api).
301-
* Common response codes including [common error codes](https://docs.microsoft.com/rest/api/time-series-insights/ga-reference-data-api#validation-and-error-handling).
302-
303-
The Reference Data Management API processes each item individually and an error with one item does not prevent the others from successfully completing. For example, if your request has 100 items and one item has an error, then 99 items are written and one is rejected.
304-
305305
## Next steps
306306

307307
- Read the GA [Reference Data Management API](https://docs.microsoft.com/rest/api/time-series-insights/ga-reference-data-api) reference documentation.

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

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

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

18-
This C# example demonstrates how to query data from the Azure Time Series Insights GA environment.
18+
This C# example demonstrates how to use the [GA Query APIs](https://docs.microsoft.com/rest/api/time-series-insights/ga-query) to query data from Azure Time Series Insights GA environments.
1919

20-
The sample shows several basic examples of Query API usage:
20+
## Summary
2121

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, see [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. 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.
22+
The sample code below demonstrates the following features:
23+
24+
1. How to acquire an access token through Azure Active Directory using [Microsoft.IdentityModel.Clients.ActiveDirectory](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/).
25+
1. How to pass that acquired access token in the `Authorization` header of subsequent Query API requests.
26+
1. The sample calls each of the core Query APIs demonstrating:
27+
1. HTTP requests made to the [Get Environments API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environments-api) to return the list of environments the user has access to.
28+
1. HTTP requests made to the [Get Environment Availability API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-availability-api).
29+
1. HTTP request made to the [Get Environment Metadata API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-metadata-api) to retrieve environment metadata.
30+
1. Both HTTP requests made to the [Get Environments Events API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-events-api) and WSS messaging to the [Get Environment Events Streamed API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-events-streamed-api)
31+
1. Both HTTP requests to the [Get Environment Aggregates API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-aggregates-api) and WSS messaging to the [Get Environment Aggregates Streamed API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-aggregates-streamed-api)
2632

2733
> [!NOTE]
2834
> The example code is available at [https://github.com/Azure-Samples/Azure-Time-Series-Insights](https://github.com/Azure-Samples/Azure-Time-Series-Insights/tree/master/csharp-tsi-ga-sample).
2935
30-
## Project Dependencies
36+
## Prerequisites and setup
37+
38+
Complete the following steps before you compile and run the sample code:
39+
40+
1. [Provision a GA Azure Time Series Insights](https://docs.microsoft.com/azure/time-series-insights/time-series-insights-get-started) environment.
41+
42+
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).
43+
44+
1. Install the required project dependencies.
45+
46+
1. Edit the sample code below by replacing each **#DUMMY#** with the appropriate environment identifier.
47+
48+
1. Execute the code inside Visual Studio.
49+
50+
> [!TIP]
51+
> * View other GA 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-ga-sample).
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 two required dependencies:
60+
61+
* [Microsoft.IdentityModel.Clients.ActiveDirectory](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/) - 5.2.6 package.
62+
* [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json) - 12.0.3 package.
63+
64+
Add the packages using [NuGet 2.12+](https://www.nuget.org/):
3165

32-
Add NuGet packages `Microsoft.IdentityModel.Clients.ActiveDirectory` and `Newtonsoft.Json`.
66+
* `dotnet add package Newtonsoft.Json --version 12.0.3`
67+
* `dotnet add package Microsoft.IdentityModel.Clients.ActiveDirectory --version 5.2.6`
3368

34-
## C# example
69+
## C# sample code
3570

3671
[!code-csharp[csharpquery-example](~/samples-tsi/csharp-tsi-ga-sample/Program.cs)]
3772

0 commit comments

Comments
 (0)