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
#customer intent: As an admin, I want to manage app consent policies for enterprise applications in Azure AD
17
18
---
@@ -24,16 +25,18 @@ An app consent policy consists of one or more "include" condition sets and zero
24
25
25
26
Each condition set consists of several conditions. For an event to match a condition set, *all* conditions in the condition set must be met.
26
27
27
-
App consent policies where the ID begins with "microsoft-" are built-in policies. Some of these built-in policies are used in existing built-in directory roles. For example, the `microsoft-application-admin` app consent policy describes the conditions under which the Application Administrator and Cloud Application Administrator roles are allowed to grant tenant-wide admin consent. Built-in policies can be used in custom directory roles and to configure user consent settings, but cannot be edited or deleted.
28
+
App consent policies where the ID begins with "microsoft-" are built-in policies. Some of these built-in policies are used in existing built-in directory roles. For example, the `microsoft-application-admin` app consent policy describes the conditions under which the Application Administrator and Cloud Application Administrator roles are allowed to grant tenant-wide admin consent. Built-in policies can be used in custom directory roles and to configure user consent settings, but can't be edited or deleted.
28
29
29
30
## Pre-requisites
30
31
31
-
1. A user or service with one of the following:
32
+
1. A user or service with one of the following roles:
32
33
- Global Administrator directory role
33
34
- Privileged Role Administrator directory role
34
35
- A custom directory role with the necessary [permissions to manage app consent policies](../roles/custom-consent-permissions.md#managing-app-consent-policies)
35
36
- The Microsoft Graph app role (application permission) Policy.ReadWrite.PermissionGrant (when connecting as an app or a service)
36
-
37
+
38
+
:::zone pivot="ms-powershell"
39
+
37
40
1. Connect to [Microsoft Graph PowerShell](/powershell/microsoftgraph/get-started?view=graph-powershell-1.0&preserve-view=true).
38
41
39
42
```powershell
@@ -86,7 +89,7 @@ Follow these steps to create a custom app consent policy:
86
89
-ClientApplicationsFromVerifiedPublisherOnly
87
90
```
88
91
89
-
Repeat this step to add additional "include" condition sets.
92
+
Repeat this step to add more "include" condition sets.
90
93
91
94
1. Optionally, add "exclude" condition sets.
92
95
@@ -101,7 +104,7 @@ Follow these steps to create a custom app consent policy:
101
104
-ResourceApplication $azureApi.AppId
102
105
```
103
106
104
-
Repeat this step to add additional "exclude" condition sets.
107
+
Repeat this step to add more "exclude" condition sets.
105
108
106
109
Once the app consent policy has been created, you can [allow user consent](configure-user-consent.md?tabs=azure-powershell#allow-user-consent-subject-to-an-app-consent-policy) subject to this policy.
107
110
@@ -113,26 +116,113 @@ Once the app consent policy has been created, you can [allow user consent](confi
> Deleted app consent policies cannot be restored. If you accidentally delete a custom app consent policy, you will need to re-create the policy.
119
+
:::zone-end
118
120
119
-
---
121
+
:::zone pivot="ms-graph"
122
+
123
+
To manage app consent policies, sign in to [Graph Explorer](https://developer.microsoft.com/graph/graph-explorer) with one of the roles listed in the prerequisite section.
124
+
125
+
## List existing app consent policies
126
+
127
+
It's a good idea to start by getting familiar with the existing app consent policies in your organization:
128
+
129
+
1. List all app consent policies:
130
+
131
+
```http
132
+
GET /policies/permissionGrantPolicies?$select=id,displayName,description
133
+
```
134
+
135
+
1. View the "include" condition sets of a policy:
136
+
137
+
```http
138
+
GET /policies/permissionGrantPolicies/{ microsoft-application-admin }/includes
139
+
```
140
+
141
+
1. View the "exclude" condition sets:
142
+
143
+
```http
144
+
GET /policies/permissionGrantPolicies/{ microsoft-application-admin }/excludes
145
+
```
146
+
147
+
## Create a custom app consent policy
148
+
149
+
Follow these steps to create a custom app consent policy:
150
+
151
+
1. Create a new empty app consent policy.
120
152
153
+
```http
154
+
POST https://graph.microsoft.com/v1.0/policies/permissionGrantPolicies
155
+
Content-Type: application/json
156
+
157
+
{
158
+
"id": "my-custom-policy",
159
+
"displayName": "My first custom consent policy",
160
+
"description": "This is a sample custom app consent policy"
161
+
}
162
+
```
163
+
164
+
1. Add "include" condition sets.
165
+
166
+
Include delegated permissions classified "low", for apps from verified publishers
167
+
168
+
```http
169
+
POST https://graph.microsoft.com/v1.0/policies/permissionGrantPolicies/{ my-custom-policy }/includes
Repeat this step to add more "exclude" condition sets.
194
+
195
+
Once the app consent policy has been created, you can [allow user consent](configure-user-consent.md?tabs=azure-powershell#allow-user-consent-subject-to-an-app-consent-policy) subject to this policy.
196
+
197
+
## Delete a custom app consent policy
198
+
199
+
1. The following shows how you can delete a custom app consent policy. **This action can’t be undone.**
> Deleted app consent policies cannot be restored. If you accidentally delete a custom app consent policy, you will need to re-create the policy.
121
209
### Supported conditions
122
210
123
211
The following table provides the list of supported conditions for app consent policies.
124
212
125
213
| Condition | Description|
126
214
|:---------------|:----------|
127
-
| PermissionClassification | The [permission classification](configure-permission-classifications.md) for the permission being granted, or "all" to match with any permission classification (including permissions which are not classified). Default is "all". |
128
-
| PermissionType | The permission type of the permission being granted. Use "application" for application permissions (e.g. app roles) or "delegated" for delegated permissions. <br><br>**Note**: The value "delegatedUserConsentable" indicates delegated permissions which have not been configured by the API publisher to require admin consent—this value may be used in built-in permission grant policies, but cannot be used in custom permission grant policies. Required. |
129
-
| ResourceApplication | The **AppId** of the resource application (e.g. the API) for which a permission is being granted, or "any" to match with any resource application or API. Default is "any". |
215
+
| PermissionClassification | The [permission classification](configure-permission-classifications.md) for the permission being granted, or "all" to match with any permission classification (including permissions that aren't classified). Default is "all". |
216
+
| PermissionType | The permission type of the permission being granted. Use "application" for application permissions (for example, app roles) or "delegated" for delegated permissions. <br><br>**Note**: The value "delegatedUserConsentable" indicates delegated permissions that haven't been configured by the API publisher to require admin consent. This value may be used in built-in permission grant policies, but can't be used in custom permission grant policies. Required. |
217
+
| ResourceApplication | The **AppId** of the resource application (for example, the API) for which a permission is being granted, or "any" to match with any resource application or API. Default is "any". |
130
218
| Permissions | The list of permission IDs for the specific permissions to match with, or a list with the single value "all" to match with any permission. Default is the single value "all". <ul><li>Delegated permission IDs can be found in the **OAuth2Permissions** property of the API's ServicePrincipal object.</li><li>Application permission IDs can be found in the **AppRoles** property of the API's ServicePrincipal object.</li></ol> |
131
219
| ClientApplicationIds | A list of **AppId** values for the client applications to match with, or a list with the single value "all" to match any client application. Default is the single value "all". |
132
220
| ClientApplicationTenantIds | A list of Azure Active Directory tenant IDs in which the client application is registered, or a list with the single value "all" to match with client apps registered in any tenant. Default is the single value "all". |
133
221
| ClientApplicationPublisherIds | A list of Microsoft Partner Network (MPN) IDs for [verified publishers](../develop/publisher-verification-overview.md) of the client application, or a list with the single value "all" to match with client apps from any publisher. Default is the single value "all". |
134
-
| ClientApplicationsFromVerifiedPublisherOnly | Set this switch to only match on client applications with a [verified publishers](../develop/publisher-verification-overview.md). Disable this switch (`-ClientApplicationsFromVerifiedPublisherOnly:$false`) to match on any client app, even if it does not have a verified publisher. Default is `$false`. |
222
+
| ClientApplicationsFromVerifiedPublisherOnly | Set this switch to only match on client applications with a [verified publishers](../develop/publisher-verification-overview.md). Disable this switch (`-ClientApplicationsFromVerifiedPublisherOnly:$false`) to match on any client app, even if it doesn't have a verified publisher. Default is `$false`. |
135
223
224
+
> [!WARNING]
225
+
> Deleted app consent policies cannot be restored. If you accidentally delete a custom app consent policy, you will need to re-create the policy.
0 commit comments