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
Follow these instructions to assign a role using the Microsoft Graph API in [Graph Explorer](https://aka.ms/ge).
161
+
Follow these instructions to assign a role using the Microsoft Graph PIM API.
162
162
163
163
### Assign a role
164
164
165
-
In this example, a security principal with objectID `f8ca5a85-489a-49a0-b555-0a6d81e56f0d` is assigned the Billing Administrator role (role definition ID `b0f54661-2d74-4c50-afa3-1ec803f12efe`) at tenant scope. If you want to see the list of immutable role template IDs of all built-in roles, see [Azure AD built-in roles](permissions-reference.md).
166
-
167
-
1. Sign in to the [Graph Explorer](https://aka.ms/ge).
168
-
2. Select **POST** as the HTTP method from the dropdown.
169
-
3. Select the API version to **v1.0**.
170
-
4. Use the [Create unifiedRoleAssignment](/graph/api/rbacapplication-post-roleassignments) API to assign roles. Add following details to the URL and Request Body and select **Run query**.
165
+
In this example, a security principal with objectID `f8ca5a85-489a-49a0-b555-0a6d81e56f0d` is assigned the Billing Administrator role (role definition ID `b0f54661-2d74-4c50-afa3-1ec803f12efe`) at tenant scope. To see the list of immutable role template IDs of all built-in roles, see [Azure AD built-in roles](permissions-reference.md).
171
166
172
167
```http
173
168
POST https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments
In this example, a security principal with objectID `f8ca5a85-489a-49a0-b555-0a6d81e56f0d` is assigned a time-bound eligible role assignment to Billing Administrator (role definition ID `b0f54661-2d74-4c50-afa3-1ec803f12efe`) for 180 days.
181
+
#### Assign a time-bound eligible role assignment
187
182
188
-
1. Sign in to the [Graph Explorer](https://aka.ms/ge).
189
-
2. Select **POST** as the HTTP method from the dropdown.
190
-
3. Select the API version to **beta**.
191
-
4. Use the [Create unifiedRoleEligibilityScheduleRequest](/graph/api/unifiedroleeligibilityschedulerequest-post-unifiedroleeligibilityschedulerequests) API to assign roles using PIM. Add following details to the URL and Request Body and select **Run query**.
183
+
In this example, a security principal with objectID `f8ca5a85-489a-49a0-b555-0a6d81e56f0d` is assigned a time-bound eligible role assignment to Billing Administrator (role definition ID `b0f54661-2d74-4c50-afa3-1ec803f12efe`) for 180 days.
192
184
193
185
```http
194
-
POST https://graph.microsoft.com/beta/rolemanagement/directory/roleEligibilityScheduleRequests
186
+
POST https://graph.microsoft.com/v1.0/rolemanagement/directory/roleEligibilityScheduleRequests
To activate the role assignment, use the [Create unifiedRoleAssignmentScheduleRequest](/graph/api/unifiedroleassignmentschedulerequest-post-unifiedroleassignmentschedulerequests) API.
228
+
#### Activate a role assignment
229
+
230
+
To activate the role assignment, use the [Create roleAssignmentScheduleRequests](/graph/api/rbacapplication-post-roleeligibilityschedulerequests) API.
235
231
236
232
```http
237
-
POST https://graph.microsoft.com/beta/roleManagement/directory/roleAssignmentScheduleRequests
233
+
POST https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignmentScheduleRequests
238
234
Content-type: application/json
239
235
240
236
{
241
-
"action": "SelfActivate",
237
+
"action": "selfActivate",
242
238
"justification": "activating role assignment for admin privileges",
For more information about managing Azure AD roles through the PIM API in Microsoft Graph, see [Overview of role management through the privileged identity management (PIM) API](/graph/api/resources/privilegedidentitymanagementv3-overview).
246
+
249
247
## Next steps
250
248
251
249
-[List Azure AD role assignments](view-assignments.md)
0 commit comments