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-authentication-and-authorization.md
+19-21Lines changed: 19 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: 'How to authenticate and authorize by API in Azure Time Series Insights | Microsoft Docs'
2
+
title: 'Authenticate and authorize by using an API in Azure Time Series Insights | Microsoft Docs'
3
3
description: This article describes how to configure authentication and authorization for a custom application that calls the Azure Time Series Insights API.
4
4
ms.service: time-series-insights
5
5
services: time-series-insights
@@ -23,7 +23,7 @@ This article explains how to configure the authentication and authorization used
23
23
24
24
## Service principal
25
25
26
-
This and following sections describe how to configure an application to access the Time Series Insights API on behalf of the application. The application can then query or publish reference data in the Time Series Insights environment with application credentials rather than user credentials.
26
+
The following sections describe how to configure an application to access the Time Series Insights API for the application. The application can then query or publish reference data in the Time Series Insights environment with application credentials rather than user credentials.
27
27
28
28
## Best practices
29
29
@@ -32,63 +32,63 @@ When you have an application that must access Time Series Insights:
32
32
1. Set up an Azure Active Directory app.
33
33
1.[Assign data access policies](./time-series-insights-data-access.md) in the Time Series Insights environment.
34
34
35
-
Using application rather than your user credentials is desirable since:
35
+
Using application credentials rather than your user credentials is desirable because:
36
36
37
37
* You can assign permissions to the app identity that are distinct from your own permissions. Typically, these permissions are restricted to only what the app requires. For example, you can allow the app to only read data in a particular Time Series Insights environment.
38
-
* You don't have to change the app's credentials, if your responsibilities change.
39
-
* You can use a certificate or an application key to automate authentication when you're running an unattended script.
38
+
* You don't have to change the app's credentials if your responsibilities change.
39
+
* You can use a certificate or an application key to automate authentication when you run an unattended script.
40
40
41
-
The following sections demonstrate how to perform those steps through the Azure portal. The article focuses on a single-tenant application where the application is intended to run in only one organization. You'll typically use single-tenant applications for line-of-business applications that run in your organization.
41
+
The following sections demonstrate how to perform those steps through the Azure portal. The article focuses on a single-tenant application where the application is intended to run in only one organization. You typically use single-tenant applications for line-of-business applications that run in your organization.
42
42
43
-
## Set up summary
43
+
## Setup summary
44
44
45
45
The setup flow consists of three steps:
46
46
47
47
1. Create an application in Azure Active Directory.
48
48
1. Authorize this application to access the Time Series Insights environment.
49
-
1. Use the application ID and key to acquire a token from `https://api.timeseries.azure.com/`. The token can then be used to call the Time Series Insights API.
49
+
1. Use the application ID and key to acquire a token from `https://api.timeseries.azure.com/`. The token then can be used to call the Time Series Insights API.
50
50
51
51
## Detailed setup
52
52
53
53
1. In the Azure portal, select **Azure Active Directory** > **App registrations** > **New application registration**.
54
54
55
55
[](media/authentication-and-authorization/active-directory-new-application-registration.png#lightbox)
56
56
57
-
1. Give the application a name, select the type to be **Web app / API**, select any valid URI for **Sign-on URL**, and click**Create**.
57
+
1. Give the application a name, select the type to be **Web app / API**, select any valid URI for **Sign-on URL**, and select**Create**.
58
58
59
59
[](media/authentication-and-authorization/active-directory-create-web-api-application.png#lightbox)
60
60
61
-
1. Select your newly created application and copy its application ID to your favorite text editor.
61
+
1. Select your newly created application, and copy its application ID to your favorite text editor.
62
62
63
63
[](media/authentication-and-authorization/active-directory-copy-application-id.png#lightbox)
64
64
65
-
1. Select **Keys**, enter the key name, select the expiration, and click**Save**.
65
+
1. Select **Keys**, enter the key name, select the expiration, and select**Save**.
[](media/authentication-and-authorization/active-directory-application-keys-save.png#lightbox)
69
+
[](media/authentication-and-authorization/active-directory-application-keys-save.png#lightbox)
70
70
71
71
1. Copy the key to your favorite text editor.
72
72
73
73
[](media/authentication-and-authorization/active-directory-copy-application-key.png#lightbox)
74
74
75
-
1. For the Time Series Insights environment, select **Data Access Policies** and click**Add**.
75
+
1. For the Time Series Insights environment, select **Data Access Policies** and select**Add**.
76
76
77
77
[](media/authentication-and-authorization/time-series-insights-data-access-policies-add.png#lightbox)
78
78
79
-
1. In the **Select User** dialog box, paste the application name (from **step 2**) or application ID (from **step 3**).
79
+
1. In the **Select User** dialog box, paste the application name from step 2 or the application ID from step 3.
80
80
81
81
[](media/authentication-and-authorization/time-series-insights-data-access-policies-select-user.png#lightbox)
82
82
83
-
1. Select the role (**Reader**for querying data, **Contributor**for querying data and changing reference data) and click**OK**.
83
+
1. Select the role. Select **Reader**to query data or **Contributor**to query data and change reference data. Select**OK**.
84
84
85
-
[](media/authentication-and-authorization/time-series-insights-data-access-policies-select-role.png#lightbox)
85
+
[](media/authentication-and-authorization/time-series-insights-data-access-policies-select-role.png#lightbox)
86
86
87
-
1. Save the policy by clicking**OK**.
87
+
1. Save the policy by selecting**OK**.
88
88
89
-
1. Use the application ID (from **step 3**) and application key (from **step 5**) to acquire the token on behalf of the application. The token can then be passed in the `Authorization` header when the application calls the Time Series Insights API.
89
+
1. Use the application ID from step 3 and the application key from step 5 to acquire the token for the application. The token then can be passed in the `Authorization` header when the application calls the Time Series Insights API.
90
90
91
-
If you're using C#, you can use the following code to acquire the token on behalf of the application. For a complete sample, see [Query data using C#](time-series-insights-query-data-csharp.md).
91
+
If you use C#, you can use the following code to acquire the token for the application. For a complete sample, see [Query data using C#](time-series-insights-query-data-csharp.md).
92
92
93
93
```csharp
94
94
// Enter your Active Directory tenant domain name
@@ -114,7 +114,5 @@ Use the **Application ID** and **Key** in your application to authenticate with
114
114
## Next steps
115
115
116
116
-ForsamplecodethatcallstheTimeSeriesInsightsAPI, see [QuerydatausingC#](time-series-insights-query-data-csharp.md).
117
-
118
117
-ForAPIreferenceinformation, see [QueryAPIreference](/rest/api/time-series-insights/ga-query-api).
0 commit comments