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/energy-data-services/how-to-manage-users.md
+57-40Lines changed: 57 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,57 +10,72 @@ ms.custom: template-how-to
10
10
---
11
11
12
12
# How to manage users
13
-
In this article, you'll know how to manage users in Azure Data Manager for Energy. It uses the [entitlements API](https://community.opengroup.org/osdu/platform/security-and-compliance/entitlements/-/tree/master/)and acts as a group-based authorization system for data partitions within Azure Data Manager for Energy instance. For more information about Azure Data Manager for Energy entitlements, see [entitlement services](concepts-entitlements.md).
13
+
In this article, you'll learn how to manage users and their memberships in OSDU groups in Azure Data Manager for Energy. [Entitlements APIs](https://community.opengroup.org/osdu/platform/security-and-compliance/entitlements/-/tree/master/)are used to add or remove users to OSDU groups and to check the entitlements when the user tries to access the OSDU services or data. For more information about OSDU groups, see [entitlement services](concepts-entitlements.md).
14
14
15
15
16
16
## Prerequisites
17
+
1. Create an Azure Data Manager for Energy instance using the tutorial at [How to create Azure Data Manager for Energy instance](quickstart-create-microsoft-energy-data-services-instance.md).
18
+
2. Generate the access token needed to call the Entitlements APIs.
19
+
3. Get various parameters of your instance such as client-id, client-secret, etc.
20
+
4. Keep all these parameter values handy as they will be needed for executing different user management requests via the Entitlements API.
17
21
18
-
Create an Azure Data Manager for Energy instance using the tutorial at [How to create Azure Data Manager for Energy instance](quickstart-create-microsoft-energy-data-services-instance.md).
19
-
20
-
You will need to pass parameters for generating the access token, which you'll need to make valid calls to the Entitlements API of your Azure Data Manager for Energy instance. You will also need these parameters for different user management requests to the Entitlements API. Hence Keep the following values handy for these actions.
21
-
22
+
## Fetch Parameters
22
23
#### Find `tenant-id`
23
-
Navigate to the Microsoft Entra account for your organization. One way to do so is by searching for "Microsoft Entra ID" in the Azure portal's search bar. Once there, locate `tenant-id` under the basic information section in the *Overview* tab. Copy the `tenant-id` and paste in an editor to be used later.
24
+
1. Navigate to the Microsoft Entra account for your organization. You can search for "Microsoft Entra ID" in the Azure portal's search bar.
25
+
2. Locate `tenant-id` under the basic information section in the *Overview* tab.
26
+
3. Copy the `tenant-id` and paste it into an editor to be used later.
24
27
25
28
:::image type="content" source="media/how-to-manage-users/azure-active-directory.png" alt-text="Screenshot of search for Microsoft Entra I D.":::
26
29
27
30
:::image type="content" source="media/how-to-manage-users/tenant-id.png" alt-text="Screenshot of finding the tenant-id.":::
28
31
29
32
#### Find `client-id`
30
-
Often called `app-id`, it's the same value that you used to register your application during the provisioning of your [Azure Data Manager for Energy instance](quickstart-create-microsoft-energy-data-services-instance.md). You'll find the `client-id` in the *Essentials* pane of Azure Data Manager for Energy *Overview* page. Copy the `client-id` and paste in an editor to be used later.
33
+
It's the same value that you used to register your application during the provisioning of your [Azure Data Manager for Energy instance](quickstart-create-microsoft-energy-data-services-instance.md). It is often referred to as `app-id`.
34
+
35
+
1. Find the `client-id` in the *Essentials* pane of Azure Data Manager for Energy *Overview* page.
36
+
2. Copy the `client-id` and paste it into an editor to be used later.
37
+
3. Currently, one Azure Data Manager for Energy instance allows one app-id to be as associated with one instance.
31
38
32
39
> [!IMPORTANT]
33
-
> The 'client-id' that is passed as values in the entitlement API calls needs to be the same which was used for provisioning of your Azure Data Manager for Energy instance.
40
+
> The 'client-id' that is passed as values in the entitlement API calls needs to be the same that was used for provisioning your Azure Data Manager for the Energy instance.
34
41
35
42
:::image type="content" source="media/how-to-manage-users/client-id-or-app-id.png" alt-text="Screenshot of finding the client-id for your registered App.":::
36
43
37
44
#### Find `client-secret`
38
-
Sometimes called an application password, a `client-secret` is a string value your app can use in place of a certificate to identity itself. Navigate to *App Registrations*. Once there, open 'Certificates & secrets' under the *Manage* section. Create a `client-secret` for the `client-id` that you used to create your Azure Data Manager for Energy instance, you can add one now by clicking on *New Client Secret*. Record the secret's `value` for use in your client application code.
45
+
A `client-secret` is a string value your app can use in place of a certificate to identify itself. It is sometimes referred to as an application password.
46
+
47
+
1. Navigate to *App Registrations*.
48
+
2. Open 'Certificates & secrets' under the *Manage* section.
49
+
3. Create a `client-secret` for the `client-id` that you used to create your Azure Data Manager for Energy instance.
50
+
4. Add one now by clicking on *New Client Secret*.
51
+
5. Record the secret's `value` for later use in your client application code.
52
+
6. The Service Principal [SPN] of the app id and client secret has the Infra Admin access to the instance.
39
53
40
54
> [!CAUTION]
41
-
> Don't forget to record the secret's value for use in your client application code. This secret value is never displayed again after you leave this page at the time of creation of 'client secret'.
55
+
> Don't forget to record the secret's value. This secret value is never displayed again after you leave this page of 'client secret' creation.
42
56
43
57
:::image type="content" source="media/how-to-manage-users/client-secret.png" alt-text="Screenshot of finding the client secret.":::
44
58
45
-
#### Find the `url`for your Azure Data Manager for Energy instance
46
-
Navigate to your Azure Data Manager for Energy *Overview* page on Azure portal. Copy the URI from the essentials pane.
59
+
#### Find the `URL` for your Azure Data Manager for Energy instance
60
+
1. Navigate to your Azure Data Manager for Energy *Overview* page on the Azure portal.
61
+
2. Copy the URI from the essentials pane.
47
62
48
-
:::image type="content" source="media/how-to-manage-users/endpoint-url.png" alt-text="Screenshot of finding the url from Azure Data Manager for Energy instance.":::
63
+
:::image type="content" source="media/how-to-manage-users/endpoint-url.png" alt-text="Screenshot of finding the URL from Azure Data Manager for Energy instance.":::
49
64
50
-
#### Find the `data-partition-id`for your group
51
-
You have two ways to get the list of data-partitions in your Azure Data Manager for Energy instance.
52
-
- One option is to navigate *Data Partitions* menu item under the Advanced section of your Azure Data Manager for Energy UI.
65
+
#### Find the `data-partition-id`
66
+
1.You have two ways to get the list of datapartitions in your Azure Data Manager for Energy instance. '
67
+
2. One option is to navigate the*Data Partitions* menu item under the Advanced section of your Azure Data Manager for Energy UI.
53
68
54
69
:::image type="content" source="media/how-to-manage-users/data-partition-id.png" alt-text="Screenshot of finding the data-partition-id from the Azure Data Manager for Energy instance.":::
55
70
56
-
- Another option is by clicking on the *view* below the *data partitions* field in the essentials pane of your Azure Data Manager for Energy *Overview* page.
71
+
3. Another option is to click on the *view* below the *data partitions* field in the essentials pane of your Azure Data Manager for Energy *Overview* page.
57
72
58
73
:::image type="content" source="media/how-to-manage-users/data-partition-id-second-option.png" alt-text="Screenshot of finding the data-partition-id from the Azure Data Manager for Energy instance overview page.":::
59
74
60
75
:::image type="content" source="media/how-to-manage-users/data-partition-id-second-option-step-2.png" alt-text="Screenshot of finding the data-partition-id from the Azure Data Manager for Energy instance overview page with the data partitions.":::
61
76
## Generate access token
62
77
63
-
You need to generate access token to use entitlements API. Run the below curl command in Azure Cloud Bash after replacing the placeholder values with the corresponding values found earlier in the pre-requisites step.
78
+
1. Run the below curl command in Azure Cloud Bash after replacing the placeholder values with the corresponding values found earlier in the above steps.
64
79
65
80
**Request format**
66
81
@@ -84,31 +99,32 @@ curl --location --request POST 'https://login.microsoftonline.com/<tenant-id>/oa
84
99
"access_token": "abcdefgh123456............."
85
100
}
86
101
```
87
-
Copy the `access_token` value from the response. You'll need it to pass as one of the headers in all calls to the Entitlements API of your Azure Data Manager for Energy instance.
88
-
89
-
## User management activities
102
+
2. Copy the `access_token` value from the response. You'll need it to pass as one of the headers in all calls to the Entitlements APIs.
90
103
91
-
You can manage users' access to your Azure Data Manager for Energy instance or data partitions. As a prerequisite for this step, you need to find the 'object-id' (OID) of the user(s) first. If you are managing an application's access to your instance or data partition, then you must find and use the application ID (or client ID) instead of the OID.
104
+
## Fetch OID
105
+
`object-id` (OID) is the Microsoft Entra user Object ID.
92
106
93
-
You'll need to input the `object-id` (OID) of the users (or the application or client ID if managing access for an application) as parameters in the calls to the Entitlements API of your Azure Data Manager for Energy Instance. `object-id` (OID) is the Microsoft Entra user Object ID.
107
+
1. Find the 'object-id' (OID) of the user(s) first. If you are managing an application's access, you must find and use the application ID (or client ID) instead of the OID.
108
+
2. Input the `object-id` (OID) of the users (or the application or client ID if managing access for an application) as parameters in the calls to the Entitlements API of your Azure Data Manager for Energy Instance.
94
109
95
110
:::image type="content" source="media/how-to-manage-users/azure-active-directory-object-id.png" alt-text="Screenshot of finding the object-id from Microsoft Entra I D.":::
96
111
97
112
:::image type="content" source="media/how-to-manage-users/profile-object-id.png" alt-text="Screenshot of finding the object-id from the profile.":::
98
113
99
-
###Get the list of all available groups
114
+
## Get the list of all available groups
100
115
101
-
Run the below curl command in Azure Cloud Bash to get all the groups that are available for your Azure Data Manager for Energy instance and its data partitions.
116
+
Run the below curl command in Azure Cloud Bash to get all the groups that are available for your Azure Data Manager for the Energy instance and its data partitions.
102
117
103
118
```bash
104
119
curl --location --request GET "https://<URI>/api/entitlements/v2/groups/" \
105
120
--header 'data-partition-id: <data-partition>' \
106
121
--header 'Authorization: Bearer <access_token>'
107
122
```
108
123
109
-
###Add user(s) to a users group
124
+
## Add user(s) to a OSDU group
110
125
111
-
Run the below curl command in Azure Cloud Bash to add user(s) to the "Users" group using Entitlement service.
126
+
1. Run the below curl command in Azure Cloud Bash to add the user(s) to the "Users" group using the Entitlement service.
127
+
2. The value to be sent for the param **"email"** is the **Object_ID (OID)** of the user and not the user's email.
112
128
113
129
```bash
114
130
curl --location --request POST 'https://<URI>/api/entitlements/v2/groups/users@<data-partition-id>.dataservices.energy/members' \
@@ -121,8 +137,6 @@ Run the below curl command in Azure Cloud Bash to add user(s) to the "Users" gro
121
137
}'
122
138
```
123
139
124
-
The value to be sent for the param **"email"** is the **Object_ID (OID)** of the user and not the user's email
125
-
126
140
**Sample request**
127
141
128
142
Consider an Azure Data Manager for Energy instance named "medstest" with a data partition named "dp1"
@@ -146,10 +160,14 @@ Consider an Azure Data Manager for Energy instance named "medstest" with a data
146
160
"role": "MEMBER"
147
161
}
148
162
```
163
+
> [!IMPORTANT]
164
+
> The app-id is the default OWNER of all the groups.
165
+
:::image type="content" source="media/how-to-manage-users/appid.png" alt-text="Screenshot of app-d in Microsoft Entra ID.":::
149
166
150
-
###Add user(s) to an entitlements group
167
+
## Add user(s) to an entitlements group
151
168
152
-
Run the below curl command in Azure Cloud Bash to add user(s) to an entitlement group using Entitlement service.
169
+
1. Run the below curl command in Azure Cloud Bash to add the user(s) to an entitlement group using the Entitlement service.
170
+
2. The value to be sent for the param **"email"** is the **Object_ID (OID)** of the user and not the user's email.
153
171
154
172
```bash
155
173
curl --location --request POST 'https://<URI>/api/entitlements/v2/groups/service.search.user@<data-partition-id>.dataservices.energy/members' \
@@ -161,11 +179,11 @@ Run the below curl command in Azure Cloud Bash to add user(s) to an entitlement
161
179
"role": "MEMBER"
162
180
}'
163
181
```
164
-
The value to be sent for the param **"email"** is the **Object_ID (OID)** of the user and not the user's email
182
+
165
183
166
184
**Sample request**
167
185
168
-
Consider an Azure Data Manager for Energy instance named "medstest" with a data partition named "dp1"
186
+
Consider an Azure Data Manager for Energy instance named "medstest" with a data partition named "dp1".
169
187
170
188
```bash
171
189
curl --location --request POST 'https://medstest.energy.azure.com/api/entitlements/v2/groups/[email protected]/members' \
@@ -187,9 +205,9 @@ Consider an Azure Data Manager for Energy instance named "medstest" with a data
187
205
}
188
206
```
189
207
190
-
###Get entitlements groups for a given user
208
+
## Get entitlements groups for a given user
191
209
192
-
Run the below curl command in Azure Cloud Bash to get all the groups associated with the user.
210
+
1.Run the below curl command in Azure Cloud Bash to get all the groups associated with the user.
193
211
194
212
```bash
195
213
curl --location --request GET 'https://<URI>/api/entitlements/v2/members/<OBJECT_ID>/groups?type=none' \
@@ -227,11 +245,10 @@ Consider an Azure Data Manager for Energy instance named "medstest" with a data
227
245
}
228
246
```
229
247
230
-
### Delete entitlement groups of a given user
231
-
232
-
Run the below curl command in Azure Cloud Bash to delete a given user to your Azure Data Manager for Energy instance data partition.
248
+
## Delete entitlement groups of a given user
233
249
234
-
As stated above, **DO NOT** delete the OWNER of a group unless you have another OWNER that can manage users in that group.
250
+
1. Run the below curl command in Azure Cloud Bash to delete a given user from a given data partition.
251
+
2. As stated above, **DO NOT** delete the OWNER of a group unless you have another OWNER who can manage users in that group.
0 commit comments