Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Namespace: microsoft.graph
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Get a resourcePolicyEvaluationEvent object that represents an Entra Resource Policy (ERP) evaluation audit event.
Events are retained for seven days with Microsoft Entra ID Free and 30 days with Microsoft Entra ID P1 or P2.
API availability
This API is available in the following national cloud deployments.
| Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
|---|---|---|---|
| ✅ | ❌ | ❌ | ❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type | Least privileged permission | Higher privileged permissions |
|---|---|---|
| Delegated (work or school account) | ResourcePolicyEvaluationEvent.Read.All | AuditLog.Read.All |
| Delegated (personal Microsoft account) | Not supported. | Not supported. |
| Application | ResourcePolicyEvaluationEvent.Read.All | AuditLog.Read.All |
Important
For delegated access using work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role. Reports Reader is the least privileged role supported for this operation.
HTTP request
GET /auditLogs/resourcePolicy/{resourcePolicyEvaluationEventId}
Optional query parameters
This method supports the $select OData query parameter. The policyDetails property isn't returned by default; include it in $select to retrieve per-policy evaluation results. For general information, see OData query parameters.
Request headers
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK response code and a resourcePolicyEvaluationEvent object in the response body.
If the event doesn't exist or is outside the retention period, this method returns a 404 Not Found response code with the error code ResourceNotFound.
Examples
Request
The following example requests the event identifier, net decision, and per-policy evaluation results.
GET https://graph.microsoft.com/beta/auditLogs/resourcePolicy/b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40?$select=id,policyDecision,policyDetails
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#auditLogs/resourcePolicy(id,policyDecision,policyDetails)/$entity",
"@odata.type": "#microsoft.graph.resourcePolicyEvaluationEvent",
"id": "b5a1f3e2-8c47-4a3d-9f21-1c0e2a7b9d40",
"policyDecision": "deny",
"policyDetails": [
{
"@odata.type": "#microsoft.graph.policyEvaluationDetail",
"assignmentUniqueName": "block-app-key-rotation",
"assignedPolicyDisplayName": "Block application key rotation",
"appliedPolicyEffects": "deny",
"isEnforced": true,
"isCompliant": false,
"isApplicable": true,
"policyMessage": "Key rotation is blocked for this application by tenant policy.",
"evaluationError": null,
"applicabilityEvaluationError": null,
"policyLoadingError": null,
"policyVersion": "1.2.0"
}
]
}