Skip to content

Commit 7c6e41a

Browse files
Merge pull request #228824 from omondiatieno/custom-roles
update powershell and graph API content
2 parents 7efc992 + d1332a2 commit 7c6e41a

File tree

3 files changed

+216
-84
lines changed

3 files changed

+216
-84
lines changed

articles/active-directory/manage-apps/configure-permission-classifications.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The minimum permissions needed to do basic sign-in are `openid`, `profile`, `ema
3030
To configure permission classifications, you need:
3131

3232
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
33-
- One of the following roles: An administrator, or owner of the service principal.
33+
- One of the following roles: A global administrator, or owner of the service principal.
3434

3535
## Manage permission classifications
3636

@@ -57,7 +57,7 @@ You can use the latest [Azure AD PowerShell](/powershell/module/azuread/?preserv
5757
Run the following command to connect to Azure AD PowerShell. To consent to the required scopes, sign in with one of the roles listed in the prerequisite section of this article.
5858

5959
```powershell
60-
Connect-AzureAD -Scopes "Application.ReadWrite.All", "Directory.ReadWrite.All", "DelegatedPermissionGrant.ReadWrite.All".
60+
Connect-AzureAD -Scopes "Policy.ReadWrite.PermissionGrant".
6161
```
6262

6363
### List the current permission classifications
@@ -134,7 +134,7 @@ You can use [Microsoft Graph PowerShell](/powershell/microsoftgraph/get-started?
134134
Run the following command to connect to Microsoft Graph PowerShell. To consent to the required scopes, sign in with one of the roles listed in the prerequisite section of this article.
135135

136136
```powershell
137-
Connect-MgGraph -Scopes "Application.ReadWrite.All", "Directory.ReadWrite.All", "DelegatedPermissionGrant.ReadWrite.All".
137+
Connect-MgGraph -Scopes "Policy.ReadWrite.PermissionGrant".
138138
```
139139

140140
### List current permission classifications for an API
@@ -208,9 +208,7 @@ Remove-MgServicePrincipalDelegatedPermissionClassification -DelegatedPermissionC
208208

209209
To configure permissions classifications for an enterprise application, sign in to [Graph Explorer](https://developer.microsoft.com/graph/graph-explorer) with one of the roles listed in the prerequisite section.
210210

211-
You need to consent to the following permissions:
212-
213-
`Application.ReadWrite.All`, `Directory.ReadWrite.All`, `DelegatedPermissionGrant.ReadWrite.All`.
211+
You need to consent to the `Policy.ReadWrite.PermissionGrant` permission.
214212

215213
Run the following queries on Microsoft Graph explorer to add a delegated permissions classification for an application.
216214

articles/active-directory/manage-apps/custom-security-attributes-apps.md

Lines changed: 171 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
---
2-
title: Assign, update, list, or remove custom security attributes for an application (Preview) - Azure Active Directory
2+
title: Manage custom security attributes for an application (Preview) - Azure Active Directory
33
description: Assign, update, list, or remove custom security attributes for an application that has been registered with your Azure Active Directory (Azure AD) tenant.
44
services: active-directory
55
author: omondiatieno
66
ms.service: active-directory
77
ms.subservice: app-mgmt
88
ms.topic: how-to
99
ms.workload: identity
10-
ms.date: 02/20/2023
10+
ms.date: 02/28/2023
1111
ms.author: jomondi
1212
ms.reviewer: rolyon
13+
zone_pivot_groups: enterprise-apps-all
14+
1315
---
1416

15-
# Assign, update, list, or remove custom security attributes for an application (Preview)
17+
# Manage custom security attributes for an application (Preview)
1618

1719
> [!IMPORTANT]
1820
> Custom security attributes are currently in PREVIEW.
@@ -26,18 +28,25 @@ To assign or remove custom security attributes for an application in your Azure
2628

2729
- Azure AD Premium P1 or P2 license
2830
- [Attribute Assignment Administrator](../roles/permissions-reference.md#attribute-assignment-administrator)
29-
- [AzureADPreview](https://www.powershellgallery.com/packages/AzureADPreview) version 2.0.2.138 or later when using PowerShell
31+
- Make sure you have existing custom security attributes. To learn how to create a security attribute, see [Add or deactivate custom security attributes in Azure AD](../fundamentals/custom-security-attributes-add.md).
32+
3033

3134
> [!IMPORTANT]
32-
> By default, [Global Administrator](../roles/permissions-reference.md#global-administrator) and other administrator roles do not have permissions to read, define, or assign custom security attributes.
35+
> By default, [Global Administrator](../roles/permissions-reference.md#global-administrator) and other administrator roles don't have permissions to read, define, or assign custom security attributes.
3336
34-
## Assign custom security attributes to an application
37+
## Assign, update, list, or remove custom attributes for an application
3538

36-
1. Sign in to the [Azure portal](https://portal.azure.com) or [Azure AD admin center](https://aad.portal.azure.com).
39+
Learn how to work with custom attributes for applications in Azure AD.
40+
### Assign custom security attributes to an application
3741

38-
1. Make sure that you have existing custom security attributes. For more information, see [Add or deactivate custom security attributes in Azure AD](../fundamentals/custom-security-attributes-add.md).
3942

40-
1. Select **Azure Active Directory** > **Enterprise applications**.
43+
:::zone pivot="portal"
44+
45+
Undertake the following steps to assign custom security attributes through the Azure portal.
46+
47+
1. Sign in to the [Azure portal](https://portal.azure.com) or [Azure AD admin center](https://aad.portal.azure.com).
48+
49+
1. Select **Azure Active Directory**, then select **Enterprise applications**.
4150

4251
1. Find and select the application you want to add a custom security attribute to.
4352

@@ -55,39 +64,39 @@ To assign or remove custom security attributes for an application in your Azure
5564
- For predefined custom security attribute values, select a value from the **Assigned values** list.
5665
- For multi-valued custom security attributes, select **Add values** to open the **Attribute values** pane and add your values. When finished adding values, select **Done**.
5766

58-
![Screenshot showing assigning a custom security attribute to an application.](./media/custom-security-attributes-apps/apps-attributes-assign.png)
67+
![Screenshot shows how to assign a custom security attribute to an application.](./media/custom-security-attributes-apps/apps-attributes-assign.png)
5968

6069
1. When finished, select **Save** to assign the custom security attributes to the application.
6170

62-
## Update custom security attribute assignment values for an application
71+
### Update custom security attribute assignment values for an application
6372

6473
1. Sign in to the [Azure portal](https://portal.azure.com) or [Azure AD admin center](https://aad.portal.azure.com).
6574

66-
1. Select **Azure Active Directory** > **Enterprise applications**.
75+
1. Select **Azure Active Directory**, then select **Enterprise applications**.
6776

6877
1. Find and select the application that has a custom security attribute assignment value you want to update.
6978

7079
1. In the Manage section, select **Custom security attributes (preview)**.
7180

7281
1. Find the custom security attribute assignment value you want to update.
7382

74-
Once you have assigned a custom security attribute to an application, you can only change the value of the custom security attribute. You can't change other properties of the custom security attribute, such as attribute set or custom security attribute name.
83+
Once you've assigned a custom security attribute to an application, you can only change the value of the custom security attribute. You can't change other properties of the custom security attribute, such as attribute set or custom security attribute name.
7584

7685
1. Depending on the properties of the selected custom security attribute, you can update a single value, select a value from a predefined list, or update multiple values.
7786

7887
1. When finished, select **Save**.
7988

80-
## Filter applications based on custom security attributes
89+
### Filter applications based on custom security attributes
8190

82-
You can filter the list of custom security attributes assigned to applications on the All applications page.
91+
You can filter the list of custom security attributes assigned to applications on the **All applications** page.
8392

8493
1. Sign in to the [Azure portal](https://portal.azure.com) or [Azure AD admin center](https://aad.portal.azure.com).
8594

86-
1. Select **Azure Active Directory** > **Enterprise applications**.
95+
1. Select **Azure Active Directory**, then select **Enterprise applications**.
8796

8897
1. Select **Add filters** to open the Pick a field pane.
8998

90-
If you don't see Add filters, click the banner to enable the Enterprise applications search preview.
99+
If you don't see **Add filters**, select the banner to enable the Enterprise applications search preview.
91100

92101
1. For **Filters**, select **Custom security attribute**.
93102

@@ -101,25 +110,28 @@ You can filter the list of custom security attributes assigned to applications o
101110

102111
1. To apply the filter, select **Apply**.
103112

104-
## Remove custom security attribute assignments from applications
113+
### Remove custom security attribute assignments from applications
105114

106115
1. Sign in to the [Azure portal](https://portal.azure.com) or [Azure AD admin center](https://aad.portal.azure.com).
107116

108-
1. Select **Azure Active Directory** > **Enterprise applications**.
117+
1. Select **Azure Active Directory**, then select **Enterprise applications**.
109118

110119
1. Find and select the application that has the custom security attribute assignments you want to remove.
111120

112-
1. In the Manage section, select **Custom security attributes (preview)**.
121+
1. In the **Manage** section, select **Custom security attributes (preview)**.
113122

114123
1. Add check marks next to all the custom security attribute assignments you want to remove.
115124

116125
1. Select **Remove assignment**.
117126

118-
## PowerShell
127+
:::zone-end
128+
129+
:::zone pivot="aad-powershell"
130+
### PowerShell
119131

120132
To manage custom security attribute assignments for applications in your Azure AD organization, you can use PowerShell. The following commands can be used to manage assignments.
121133

122-
#### Assign a custom security attribute with a multi-string value to an application (service principal)
134+
### Assign a custom security attribute with a multi-string value to an application (service principal)
123135

124136
Use the [Set-AzureADMSServicePrincipal](/powershell/module/azuread/set-azureadmsserviceprincipal) command to assign a custom security attribute with a multi-string value to an application (service principal).
125137

@@ -139,9 +151,9 @@ $attributes = @{
139151
Set-AzureADMSServicePrincipal -Id 7d194b0c-bf17-40ff-9f7f-4b671de8dc20 -CustomSecurityAttributes $attributes
140152
```
141153

142-
#### Update a custom security attribute with a multi-string value for an application (service principal)
154+
### Update a custom security attribute with a multi-string value for an application (service principal)
143155

144-
Use the [Set-AzureADMSServicePrincipal](/powershell/module/azuread/set-azureadmsserviceprincipal) command to update a custom security attribute with a multi-string value for an application (service principal).
156+
Provide the new set of attribute values that you would like to reflect on the application. In this example, we're adding one more value for project attribute.
145157

146158
- Attribute set: `Engineering`
147159
- Attribute: `Project`
@@ -159,7 +171,7 @@ $attributesUpdate = @{
159171
Set-AzureADMSServicePrincipal -Id 7d194b0c-bf17-40ff-9f7f-4b671de8dc20 -CustomSecurityAttributes $attributesUpdate
160172
```
161173

162-
#### Get the custom security attribute assignments for an application (service principal)
174+
### Get the custom security attribute assignments for an application (service principal)
163175

164176
Use the [Get-AzureADMSServicePrincipal](/powershell/module/azuread/get-azureadmsserviceprincipal) command to get the custom security attribute assignments for an application (service principal).
165177

@@ -168,51 +180,172 @@ Get-AzureADMSServicePrincipal -Select CustomSecurityAttributes
168180
Get-AzureADMSServicePrincipal -Id 7d194b0c-bf17-40ff-9f7f-4b671de8dc20 -Select "CustomSecurityAttributes, Id"
169181
```
170182

171-
## Microsoft Graph API
183+
:::zone-end
184+
185+
:::zone pivot="ms-powershell"
186+
187+
To manage custom security attribute assignments for applications in your Azure AD organization, you can use Microsoft Graph PowerShell. The following commands can be used to manage assignments.
188+
189+
### Assign a custom security attribute with a multi-string value to an application (service principal)
190+
191+
Use the [Set-AzureADMSServicePrincipal](/powershell/module/azuread/set-azureadmsserviceprincipal) command to assign a custom security attribute with a multi-string value to an application (service principal).
192+
193+
Given the values
194+
195+
- Attribute set: Engineering
196+
- Attribute: Project
197+
- Attribute data type: String
198+
- Attribute value: "Baker"
199+
200+
```powershell
201+
#Retrieve the servicePrincipal
202+
203+
$ServicePrincipal= (Get-MgServicePrincipal -Filter "displayName eq 'Microsoft Graph'").Id
204+
205+
$params = @{
206+
CustomSecurityAttributes = @{
207+
Engineering =@{
208+
"@odata.type" = "#Microsoft.DirectoryServices.CustomSecurityAttributeValue"
209+
ProjectDate ="Baker"
210+
}
211+
}
212+
}
213+
214+
Update-MgServicePrincipal -ServicePrincipalId $ServicePrincipal -BodyParameter $params
215+
```
216+
217+
### Update a custom security attribute with a multi-string value for an application (service principal)
218+
219+
Provide the new set of attribute values that you would like to reflect on the application. In this example, we're adding one more value for project attribute.
220+
221+
```powershell
222+
$params = @{
223+
CustomSecurityAttributes = @{
224+
Engineering =@{
225+
"@odata.type" = "#Microsoft.DirectoryServices.CustomSecurityAttributeValue"
226+
Project =@(
227+
"Baker"
228+
"Cascade"
229+
)
230+
}
231+
}
232+
}
233+
Update-MgServicePrincipal -ServicePrincipalId $ServicePrincipal -BodyParameter $params
234+
```
235+
236+
### Filter applications based on custom security attributes
237+
238+
This example filters a list of applications with a custom security attribute assignment that equals the specified value.
239+
240+
```powershell
241+
Get-MgServicePrincipal -CountVariable CountVar -Property "id,displayName,customSecurityAttributes" -Filter "customSecurityAttributes/Engineering/Project eq 'Baker'" -ConsistencyLevel eventual
242+
```
243+
244+
### Remove custom security attribute assignments from applications
245+
246+
In this example, we remove a custom security attribute assignment that supports multiple values.
247+
248+
```powershell
249+
$params = @{
250+
CustomSecurityAttributes = @{
251+
Engineering =@{
252+
"@odata.type" = "#Microsoft.DirectoryServices.CustomSecurityAttributeValue"
253+
Project =@(
254+
)
255+
}
256+
}
257+
}
258+
Update-MgServicePrincipal -ServicePrincipalId $ServicePrincipal -BodyParameter $params
259+
```
260+
261+
262+
:::zone-end
172263

173-
To manage custom security attribute assignments for applications in your Azure AD organization, you can use the Microsoft Graph API. The following API calls can be made to manage assignments.
264+
:::zone pivot="ms-graph"
265+
266+
To manage custom security attribute assignments for applications in your Azure AD organization, you can use the Microsoft Graph API. Make the following API calls to manage assignments.
174267

175268
For other similar Microsoft Graph API examples for users, see [Assign, update, list, or remove custom security attributes for a user](../enterprise-users/users-custom-security-attributes.md#microsoft-graph-api) and [Examples: Assign, update, list, or remove custom security attribute assignments using the Microsoft Graph API](/graph/custom-security-attributes-examples).
176269

177-
#### Assign a custom security attribute with a string value to an application (service principal)
270+
### Assign a custom security attribute with a multi-string value to an application (service principal)
178271

179-
Use the [Update servicePrincipal](/graph/api/serviceprincipal-update?view=graph-rest-beta&preserve-view=true) API to assign a custom security attribute with a string value to a user.
272+
Use the [Update servicePrincipal](/graph/api/serviceprincipal-update?view=graph-rest-beta&preserve-view=true) API to assign a custom security attribute with a string value to an application.
180273

181-
- Attribute set: `Engineering`
182-
- Attribute: `ProjectDate`
274+
Given the values
275+
276+
- Attribute set: Engineering
277+
- Attribute: Project
183278
- Attribute data type: String
184-
- Attribute value: `"2022-10-01"`
279+
- Attribute value: "Baker"
280+
281+
```http
282+
PATCH https://graph.microsoft.com/beta/servicePrincipals/{id}
283+
Content-type: application/json
284+
285+
{
286+
"customSecurityAttributes":
287+
{
288+
"Engineering":
289+
{
290+
"@odata.type":"#Microsoft.DirectoryServices.CustomSecurityAttributeValue",
291+
"[email protected]":"#Collection(String)",
292+
"Project": "Baker"
293+
}
294+
}
295+
}
296+
```
297+
298+
### Update a custom security attribute with a multi-string value for an application (service principal)
299+
300+
Provide the new set of attribute values that you would like to reflect on the application. In this example, we're adding one more value for project attribute.
185301

186302
```http
187303
PATCH https://graph.microsoft.com/beta/servicePrincipals/{id}
304+
Content-type: application/json
305+
188306
{
189307
"customSecurityAttributes":
190308
{
191309
"Engineering":
192310
{
193311
"@odata.type":"#Microsoft.DirectoryServices.CustomSecurityAttributeValue",
194-
"ProjectDate":"2022-10-01"
312+
"[email protected]":"#Collection(String)",
313+
"Project":["Baker","Cascade"]
195314
}
196315
}
197316
}
198317
```
199318

200-
#### Get the custom security attribute assignments for an application (service principal)
319+
### Filter applications based on custom security attributes
201320

202-
Use the [Get servicePrincipal](/graph/api/serviceprincipal-get?view=graph-rest-beta&preserve-view=true) API to get the custom security attribute assignments for an application (service principal).
321+
This example filters a list of applications with a custom security attribute assignment that equals the specified value.
203322

204323
```http
205-
GET https://graph.microsoft.com/beta/servicePrincipals/{id}?$select=customSecurityAttributes
324+
GET https://graph.microsoft.com/beta/servicePrincipals?$count=true&$select=id,displayName,customSecurityAttributes&$filter=customSecurityAttributes/Engineering/Project eq 'Baker'ConsistencyLevel: eventual
206325
```
207326

208-
If there are no custom security attributes assigned to the application or if the calling principal does not have access, the response will look like:
327+
### Remove custom security attribute assignments from an application
328+
329+
In this example, we remove a custom security attribute assignment that supports multiple values.
209330

210331
```http
332+
PATCH https://graph.microsoft.com/beta/servicePrincipals/{id}
333+
Content-type: application/json
334+
211335
{
212-
"customSecurityAttributes": null
336+
"customSecurityAttributes":
337+
{
338+
"Engineering":
339+
{
340+
"@odata.type":"#Microsoft.DirectoryServices.CustomSecurityAttributeValue",
341+
"Project":[]
342+
}
343+
}
213344
}
214345
```
215346

347+
:::zone-end
348+
216349
## Next steps
217350

218351
- [Add or deactivate custom security attributes in Azure AD](../fundamentals/custom-security-attributes-add.md)

0 commit comments

Comments
 (0)