Skip to content

Commit 250ad5d

Browse files
authored
Merge pull request #233461 from rolyon/rolyon-aadroles-assignments-groups-update
[Azure AD roles] Refactor assign roles to groups
2 parents 2a927a3 + 7ca5c90 commit 250ad5d

23 files changed

+190
-149
lines changed

.openpublishing.redirection.active-directory.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7234,7 +7234,7 @@
72347234
{
72357235
"source_path_from_root": "/articles/active-directory/active-directory-privileged-identity-management-how-to-add-role-to-user.md",
72367236
"redirect_url": "/azure/active-directory/privileged-identity-management/pim-how-to-add-role-to-user",
7237-
"redirect_document_id": true
7237+
"redirect_document_id": false
72387238
},
72397239
{
72407240
"source_path_from_root": "/articles/active-directory/active-directory-privileged-identity-management-how-to-change-default-settings.md",
@@ -7551,6 +7551,11 @@
75517551
"redirect_url": "/azure/active-directory/roles/view-assignments",
75527552
"redirect_document_id": false
75537553
},
7554+
{
7555+
"source_path_from_root": "/articles/active-directory/roles/groups-pim-eligible.md",
7556+
"redirect_url": "/azure/active-directory/privileged-identity-management/pim-how-to-add-role-to-user",
7557+
"redirect_document_id": true
7558+
},
75547559
{
75557560
"source_path_from_root": "/articles/active-directory/users-groups-roles/directory-administrative-units.md",
75567561
"redirect_url": "/azure/active-directory/roles/administrative-units",
@@ -7668,8 +7673,8 @@
76687673
},
76697674
{
76707675
"source_path_from_root": "/articles/active-directory/users-groups-roles/roles-groups-pim-eligible.md",
7671-
"redirect_url": "/azure/active-directory/roles/groups-pim-eligible",
7672-
"redirect_document_id": true
7676+
"redirect_url": "/azure/active-directory/privileged-identity-management/pim-how-to-add-role-to-user",
7677+
"redirect_document_id": false
76737678
},
76747679
{
76757680
"source_path_from_root": "/articles/active-directory/users-groups-roles/roles-groups-remove-assignment.md",

articles/active-directory/roles/TOC.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
href: groups-create-eligible.md
5555
- name: Assign roles to groups
5656
href: groups-assign-role.md
57-
- name: Make a group eligible for a role in PIM
58-
href: groups-pim-eligible.md
5957
- name: Assign roles with scope using PowerShell
6058
href: custom-assign-powershell.md
6159
- name: Assign roles using Microsoft Graph

articles/active-directory/roles/assign-roles-different-scopes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.collection: M365-identity-device-management
1616
---
1717
# Assign Azure AD roles at different scopes
1818

19-
In Azure Active Directory (Azure AD), you typically assign Azure AD roles so that they apply to the entire tenant. However, you can also assign Azure AD roles for different resources, such as administrative units or application registrations. For example, you could assign the Helpdesk Administrator role so that it just applies to a particular administrative unit and not the entire tenant. The resources that a role assignment applies to is also call the scope. This article describes how to assign Azure AD roles at tenant, administrative unit, and application registration scopes. For more information about scope, see [Overview of RBAC in Azure AD](custom-overview.md#scope).
19+
In Azure Active Directory (Azure AD), you typically assign Azure AD roles so that they apply to the entire tenant. However, you can also assign Azure AD roles for different resources, such as administrative units or application registrations. For example, you could assign the Helpdesk Administrator role so that it just applies to a particular administrative unit and not the entire tenant. The resources that a role assignment applies to is also called the scope. This article describes how to assign Azure AD roles at tenant, administrative unit, and application registration scopes. For more information about scope, see [Overview of RBAC in Azure AD](custom-overview.md#scope).
2020

2121
## Prerequisites
2222

@@ -36,7 +36,7 @@ This section describes how to assign roles at the tenant scope.
3636

3737
1. Select **Azure Active Directory** > **Roles and administrators** to see the list of all available roles.
3838

39-
![Roles and administrators page in Azure Active Directory.](./media/manage-roles-portal/roles-and-administrators.png)
39+
![Roles and administrators page in Azure Active Directory.](./media/common/roles-and-administrators.png)
4040

4141
1. Select a role to see its assignments. To help you find the role you need, use **Add filters** to filter the roles.
4242

articles/active-directory/roles/custom-overview.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: active-directory
88
ms.workload: identity
99
ms.subservice: roles
1010
ms.topic: overview
11-
ms.date: 10/06/2021
11+
ms.date: 04/10/2023
1212
ms.author: rolyon
1313
ms.reviewer: abhijeetsinha
1414
ms.custom: it-pro
@@ -18,15 +18,17 @@ ms.collection: M365-identity-device-management
1818

1919
# Overview of role-based access control in Azure Active Directory
2020

21-
This article describes how to understand Azure Active Directory (Azure AD) role-based access control. Azure AD roles allow you to grant granular permissions to your admins, abiding by the principle of least privilege. Azure AD built-in and custom roles operate on concepts similar to those you will find in [the role-based access control system for Azure resources](../../role-based-access-control/overview.md) (Azure roles). The [difference between these two role-based access control systems](../../role-based-access-control/rbac-and-directory-admin-roles.md) is:
21+
This article describes how to understand Azure Active Directory (Azure AD) role-based access control. Azure AD roles allow you to grant granular permissions to your admins, abiding by the principle of least privilege. Azure AD built-in and custom roles operate on concepts similar to those you find in [the role-based access control system for Azure resources](../../role-based-access-control/overview.md) (Azure roles). The [difference between these two role-based access control systems](../../role-based-access-control/rbac-and-directory-admin-roles.md) is:
2222

2323
- Azure AD roles control access to Azure AD resources such as users, groups, and applications using the Microsoft Graph API
2424
- Azure roles control access to Azure resources such as virtual machines or storage using Azure Resource Management
2525

2626
Both systems contain similarly used role definitions and role assignments. However, Azure AD role permissions can't be used in Azure custom roles and vice versa.
2727

2828
## Understand Azure AD role-based access control
29-
Azure AD supports 2 types of roles definitions:
29+
30+
Azure AD supports two types of roles definitions:
31+
3032
* [Built-in roles](./permissions-reference.md)
3133
* [Custom roles](./custom-create.md)
3234

@@ -62,7 +64,7 @@ The following diagram shows an example of a role assignment. In this example, Ch
6264

6365
### Security principal
6466

65-
A security principal represents a user, group, or service principal that is assigned access to Azure AD resources. A user is an individual who has a user profile in Azure Active Directory. A group is a new Microsoft 365 or security group with the isAssignableToRole property set to true (currently in preview). A service principal is an identity created for use with applications, hosted services, and automated tools to access Azure AD resources.
67+
A security principal represents a user, group, or service principal that is assigned access to Azure AD resources. A user is an individual who has a user profile in Azure Active Directory. A group is a new Microsoft 365 or security group that has been set as a [role-assignable group](groups-concept.md). A service principal is an identity created for use with applications, hosted services, and automated tools to access Azure AD resources.
6668

6769
### Role definition
6870

@@ -89,9 +91,17 @@ If you specify an Azure AD resource as a scope, it can be one of the following:
8991

9092
For more information, see [Assign Azure AD roles at different scopes](assign-roles-different-scopes.md).
9193

94+
## Role assignment options
95+
96+
Azure AD provides multiple options for assigning roles:
97+
98+
- You can assign roles to users directly, which is the default way to assign roles. Both built-in and custom Azure AD roles can be assigned to users, based on access requirements. For more information, see [Assign Azure AD roles to users](manage-roles-portal.md).
99+
- With Azure AD Premium P1, you can create role-assignable groups and assign roles to these groups. Assigning roles to a group instead of individuals allows for easy addition or removal of users from a role and creates consistent permissions for all members of the group. For more information, see [Assign Azure AD roles to groups](groups-assign-role.md).
100+
- With Azure AD Premium P2, you can use Azure AD Privileged Identity Management (Azure AD PIM) to provide just-in-time access to roles. This feature allows you to grant time-limited access to a role to users who require it, rather than granting permanent access. It also provides detailed reporting and auditing capabilities. For more information, see [Assign Azure AD roles in Privileged Identity Management](../privileged-identity-management/pim-how-to-add-role-to-user.md).
101+
92102
## License requirements
93103

94-
Using built-in roles in Azure AD is free, while custom roles requires an Azure AD Premium P1 license. To find the right license for your requirements, see [Comparing generally available features of the Free and Premium editions](https://www.microsoft.com/security/business/identity-access-management/azure-ad-pricing).
104+
Using built-in roles in Azure AD is free, while custom roles require an Azure AD Premium P1 license. To find the right license for your requirements, see [Comparing generally available features of the Free and Premium editions](https://www.microsoft.com/security/business/identity-access-management/azure-ad-pricing).
95105

96106
## Next steps
97107

articles/active-directory/roles/groups-assign-role.md

Lines changed: 118 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Assign Azure AD roles to groups
3-
description: Assign Azure AD roles to role-assignable groups in the Azure portal, PowerShell, or Graph API.
3+
description: Assign Azure AD roles to role-assignable groups in the Azure portal, PowerShell, or Microsoft Graph API.
44
services: active-directory
55
author: rolyon
66
manager: amycolannino
77
ms.service: active-directory
88
ms.workload: identity
99
ms.subservice: roles
1010
ms.topic: how-to
11-
ms.date: 02/04/2022
11+
ms.date: 04/10/2023
1212
ms.author: rolyon
1313
ms.reviewer: vincesm
1414
ms.custom: it-pro
@@ -18,62 +18,111 @@ ms.collection: M365-identity-device-management
1818

1919
# Assign Azure AD roles to groups
2020

21-
This section describes how an IT admin can assign Azure Active Directory (Azure AD) role to an Azure AD group.
21+
To simplify role management, you can assign Azure AD roles to a group instead of individuals. This article describes how to assign Azure AD roles to [role-assignable groups](groups-concept.md) using the Azure portal, PowerShell, or Microsoft Graph API.
2222

2323
## Prerequisites
2424

25-
- Azure AD Premium P1 or P2 license
26-
- Privileged Role Administrator or Global Administrator
27-
- AzureAD module when using PowerShell
25+
- Azure AD Premium P1 license
26+
- [Privileged Role Administrator](./permissions-reference.md#privileged-role-administrator) role
27+
- Microsoft.Graph module when using [Microsoft Graph PowerShell](/powershell/microsoftgraph/installation?branch=main)
28+
- AzureAD module when using [Azure AD PowerShell](/powershell/azure/active-directory/overview?branch=main)
2829
- Admin consent when using Graph explorer for Microsoft Graph API
2930

3031
For more information, see [Prerequisites to use PowerShell or Graph Explorer](prerequisites.md).
3132

3233
## Azure portal
3334

34-
Assigning a group to an Azure AD role is similar to assigning users and service principals except that only groups that are role-assignable can be used. In the Azure portal, only groups that are role-assignable are displayed.
35+
Assigning an Azure AD role to a group is similar to assigning users and service principals except that only groups that are role-assignable can be used.
3536

36-
1. Sign in to the [Azure portal](https://portal.azure.com).
37+
> [!TIP]
38+
> These steps apply to customers that have an Azure AD Premium P1 license. If you have an Azure AD Premium P2 license in your tenant, you should instead follow steps in [Assign Azure AD roles in Privileged Identity Management](../privileged-identity-management/pim-how-to-add-role-to-user.md).
3739
38-
1. Select **Azure Active Directory** > **Roles and administrators** and select the role you want to assign.
40+
1. Sign in to the [Azure portal](https://portal.azure.com) or [Microsoft Entra admin center](https://entra.microsoft.com).
3941

40-
1. On the ***role name*** page, select > **Add assignment**.
42+
1. Select **Azure Active Directory** > **Roles and administrators** to see the list of all available roles.
4143

42-
![Add the new role assignment](./media/groups-assign-role/add-assignment.png)
44+
:::image type="content" source="media/common/roles-and-administrators.png" alt-text="Screenshot of Roles and administrators page in Azure Active Directory." lightbox="media/common/roles-and-administrators.png":::
4345

44-
1. Select the group. Only the groups that can be assigned to Azure AD roles are displayed.
46+
1. Select the role name to open the role. Don't add a check mark next to the role.
4547

46-
[![Only groups that are assignable are shown for a new role assignment.](./media/groups-assign-role/eligible-groups.png "Only groups that are assignable are shown for a new role assignment.")](./media/groups-assign-role/eligible-groups.png#lightbox)
48+
:::image type="content" source="media/common/role-select-mouse.png" alt-text="Screenshot that shows selecting a role." lightbox="media/common/role-select-mouse.png":::
4749

48-
1. Select **Add**.
50+
1. Select **Add assignments**.
4951

50-
For more information on assigning role permissions, see [Assign administrator and non-administrator roles to users](../fundamentals/active-directory-users-assign-role-azure-portal.md).
52+
If you see something different from the following screenshot, you might have Azure AD Premium P2. For more information, see [Assign Azure AD roles in Privileged Identity Management](../privileged-identity-management/pim-how-to-add-role-to-user.md).
53+
54+
:::image type="content" source="media/groups-assign-role/add-assignments.png" alt-text="Screenshot of Add assignments pane to assign role to users or groups." lightbox="media/groups-assign-role/add-assignments.png":::
55+
56+
1. Select the group you want to assign to this role. Only role-assignable groups are displayed.
57+
58+
If group isn't listed, you will need to create a role-assignable group. For more information, see [Create a role-assignable group in Azure Active Directory](groups-create-eligible.md).
59+
60+
1. Select **Add** to assign the role to the group.
5161

5262
## PowerShell
5363

54-
### Create a group that can be assigned to role
64+
# [Microsoft Graph PowerShell](#tab/ms-powershell)
65+
66+
### Create a role-assignable group
67+
68+
Use the [New-MgGroup](/powershell/module/microsoft.graph.groups/new-mggroup?branch=main) command to create a role-assignable group.
69+
70+
```powershell
71+
Connect-MgGraph -Scopes "Group.ReadWrite.All","RoleManagement.ReadWrite.Directory"
72+
$group = New-MgGroup -DisplayName "Contoso_Helpdesk_Administrators" -Description "This group has Helpdesk Administrator built-in role assigned to it in Azure AD." -MailEnabled:$false -SecurityEnabled -MailNickName "contosohelpdeskadministrators" -IsAssignableToRole:$true
73+
```
74+
75+
### Get the role definition you want to assign
76+
77+
Use the [Get-MgRoleManagementDirectoryRoleDefinition](/powershell/module/microsoft.graph.devicemanagement.enrolment/get-mgrolemanagementdirectoryroledefinition?branch=main) command to get a role definition.
78+
79+
```powershell
80+
$roleDefinition = Get-MgRoleManagementDirectoryRoleDefinition -Filter "displayName eq 'Helpdesk Administrator'"
81+
```
82+
83+
### Create a role assignment
84+
85+
Use the [New-MgRoleManagementDirectoryRoleAssignment](/powershell/module/microsoft.graph.devicemanagement.enrolment/new-mgrolemanagementdirectoryroleassignment?branch=main) command to assign the role.
86+
87+
```powershell
88+
$roleAssignment = New-MgRoleManagementDirectoryRoleAssignment -DirectoryScopeId '/' -RoleDefinitionId $roleDefinition.Id -PrincipalId $group.Id
89+
```
90+
91+
# [Azure AD PowerShell](#tab/aad-powershell)
92+
93+
### Create a role-assignable group
94+
95+
Use the [New-AzureADMSGroup](/powershell/module/azuread/new-azureadmsgroup?branch=main) command to create a role-assignable group.
5596

5697
```powershell
5798
$group = New-AzureADMSGroup -DisplayName "Contoso_Helpdesk_Administrators" -Description "This group is assigned to Helpdesk Administrator built-in role in Azure AD." -MailEnabled $false -SecurityEnabled $true -MailNickName "contosohelpdeskadministrators" -IsAssignableToRole $true
5899
```
59100

60-
### Get the role definition for the role you want to assign
101+
### Get the role definition you want to assign
102+
103+
Use the [Get-AzureADMSRoleDefinition](/powershell/module/azuread/get-azureadmsroledefinition?branch=main) command to get a role definition.
61104

62105
```powershell
63106
$roleDefinition = Get-AzureADMSRoleDefinition -Filter "displayName eq 'Helpdesk Administrator'"
64107
```
65108

66109
### Create a role assignment
67110

111+
Use the [New-AzureADMSRoleAssignment](/powershell/module/azuread/new-azureadmsroleassignment?branch=main) command to assign the role.
112+
68113
```powershell
69114
$roleAssignment = New-AzureADMSRoleAssignment -DirectoryScopeId '/' -RoleDefinitionId $roleDefinition.Id -PrincipalId $group.Id
70115
```
71116

117+
---
118+
72119
## Microsoft Graph API
73120

74-
### Create a group that can be assigned Azure AD role
121+
### Create a role-assignable group
75122

76-
Use the [Create group](/graph/api/group-post-groups) API to create a group.
123+
Use the [Create group](/graph/api/group-post-groups?branch=main) API to create a role-assignable group.
124+
125+
**Request**
77126

78127
```http
79128
POST https://graph.microsoft.com/v1.0/groups
@@ -91,28 +140,74 @@ POST https://graph.microsoft.com/v1.0/groups
91140
}
92141
```
93142

94-
### Get the role definition
143+
**Response**
144+
145+
```http
146+
HTTP/1.1 201 Created
147+
```
148+
149+
### Get the role definition you want to assign
150+
151+
Use the [List unifiedRoleDefinitions](/graph/api/rbacapplication-list-roledefinitions?branch=main) API to get a role definition.
95152

96-
Use the [List unifiedRoleDefinitions](/graph/api/rbacapplication-list-roledefinitions) API to get a role definition.
153+
**Request**
97154

98155
```http
99156
GET https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions?$filter = displayName eq 'Helpdesk Administrator'
100157
```
101158

159+
**Response**
160+
161+
```json
162+
{
163+
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#roleManagement/directory/roleDefinitions",
164+
"value": [
165+
{
166+
"id": "729827e3-9c14-49f7-bb1b-9608f156bbb8",
167+
"description": "Can reset passwords for non-administrators and Helpdesk Administrators.",
168+
"displayName": "Helpdesk Administrator",
169+
"isBuiltIn": true,
170+
"isEnabled": true,
171+
"resourceScopes": [
172+
"/"
173+
],
174+
175+
...
176+
177+
```
178+
102179
### Create the role assignment
103180

104-
Use the [Create unifiedRoleAssignment](/graph/api/rbacapplication-post-roleassignments) API to assign the role.
181+
Use the [Create unifiedRoleAssignment](/graph/api/rbacapplication-post-roleassignments?branch=main) API to assign the role.
182+
183+
**Request**
105184

106185
```http
107186
POST https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments
108187

109188
{
110189
"@odata.type": "#microsoft.graph.unifiedRoleAssignment",
111-
"principalId": "<Object Id of Group>",
190+
"principalId": "<Object ID of Group>",
191+
"roleDefinitionId": "<ID of role definition>",
192+
"directoryScopeId": "/"
193+
}
194+
```
195+
196+
**Response**
197+
198+
```json
199+
HTTP/1.1 201 Created
200+
Content-type: application/json
201+
{
202+
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#roleManagement/directory/roleAssignments/$entity",
203+
"id": "<Role assignment ID>",
112204
"roleDefinitionId": "<ID of role definition>",
205+
"principalId": "<Object ID of Group>",
113206
"directoryScopeId": "/"
114207
}
208+
115209
```
210+
116211
## Next steps
117212

118213
- [Use Azure AD groups to manage role assignments](groups-concept.md)

0 commit comments

Comments
 (0)