Skip to content

Commit 353e5f1

Browse files
authored
Merge pull request #103003 from KingdomOfEnds/tsi-refresh
Refreshed C# articles
2 parents 1ebed7e + bc28b08 commit 353e5f1

File tree

2 files changed

+65
-23
lines changed

2 files changed

+65
-23
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: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,76 @@ 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+
* 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+
26+
* How to pass that acquired access token in the `Authorization` header of subsequent Query API requests.
27+
28+
* The sample calls each of the GA Query APIs demonstrating how HTTP requests are made to the:
29+
* [Get Environments API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environments-api) to return the environments the user has access to
30+
* [Get Environment Availability API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-availability-api)
31+
* [Get Environment Metadata API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-metadata-api) to retrieve environment metadata
32+
* [Get Environments Events API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-events-api)
33+
* [Get Environment Aggregates API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-aggregates-api)
34+
35+
* How to interact with the GA Query APIs using WSS to message the:
36+
37+
* [Get Environment Events Streamed API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-events-streamed-api)
38+
* [Get Environment Aggregates Streamed API](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api#get-environment-aggregates-streamed-api)
2639

2740
> [!NOTE]
2841
> 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).
2942
30-
## Project Dependencies
43+
## Prerequisites and setup
44+
45+
Complete the following steps before you compile and run the sample code:
46+
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+
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+
1. Install the required project dependencies.
52+
53+
1. Edit the sample code below by replacing each **#DUMMY#** with the appropriate environment identifier.
54+
55+
1. Execute the code inside Visual Studio.
56+
57+
> [!TIP]
58+
> * 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).
59+
60+
## Project dependencies
61+
62+
It's recommended that you use the newest version of Visual Studio:
63+
64+
* [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) - Version 16.4.2+
65+
66+
The sample code has two required dependencies:
67+
68+
* [Microsoft.IdentityModel.Clients.ActiveDirectory](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/) - 3.13.9 package.
69+
* [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json) - 9.0.1 package.
70+
71+
Add the packages using [NuGet 2.12+](https://www.nuget.org/):
3172

32-
Add NuGet packages `Microsoft.IdentityModel.Clients.ActiveDirectory` and `Newtonsoft.Json`.
73+
* `dotnet add package Newtonsoft.Json --version 9.0.1`
74+
* `dotnet add package Microsoft.IdentityModel.Clients.ActiveDirectory --version 3.13.9`
3375

34-
## C# example
76+
## C# sample code
3577

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

3880
## Next steps
3981

4082
- To learn more about querying, read the [Query API reference](https://docs.microsoft.com/rest/api/time-series-insights/ga-query-api).
4183

42-
- Read how to [connect a JavaScript app using the client SDK](https://github.com/microsoft/tsiclient) to Time Series Insights.
84+
- Read how to [connect a JavaScript app using the client SDK](https://github.com/microsoft/tsiclient) to Time Series Insights.

0 commit comments

Comments
 (0)