Skip to content

Commit a3c3c91

Browse files
committed
add query
1 parent dbe638b commit a3c3c91

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

articles/active-directory/governance/entitlement-management-logs-and-reporting.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ $bResponse = Invoke-AzOperationalInsightsQuery -WorkspaceId $wks[0].CustomerId -
188188
$bResponse.Results |ft
189189
```
190190

191+
### Using query filters
192+
191193
You can include the `TimeGenerated` field to scope a query to a particular time range. For example, to retrieve the audit log events for entitlement management access package assignment policies being created or updated in the last 90 days, you can supply a query that includes this field as well the category and operation type.
192194

193195
```
@@ -196,5 +198,18 @@ where TimeGenerated > ago(90d) and Category == "EntitlementManagement" and Resul
196198
project ActivityDateTime,OperationName, InitiatedBy, AdditionalDetails, TargetResources
197199
```
198200

201+
For audit events of some services such as entitlement management, you can also expand and filter on the affected properties of the resources being changed. For example, you can view just those audit log records for access package assignment policies being created or updated, that do not require approval for users to have an assignment added.
202+
203+
```
204+
AuditLogs |
205+
where TimeGenerated > ago(90d) and Category == "EntitlementManagement" and Result == "success" and (AADOperationType == "CreateEntitlementGrantPolicy" or AADOperationType == "UpdateEntitlementGrantPolicy") |
206+
mv-expand TargetResources |
207+
where TargetResources.type == "AccessPackageAssignmentPolicy" |
208+
project ActivityDateTime,OperationName,InitiatedBy,PolicyId=TargetResources.id,PolicyDisplayName=TargetResources.displayName,MP1=TargetResources.modifiedProperties |
209+
mv-expand MP1 |
210+
where (MP1.displayName == "IsApprovalRequiredForAdd" and MP1.newValue == "\"False\"") |
211+
order by ActivityDateTime desc
212+
```
213+
199214
## Next steps
200215
- [Create interactive reports with Azure Monitor workbooks](../../azure-monitor/visualize/workbooks-overview.md)

0 commit comments

Comments
 (0)