Queries for the AADServicePrincipalSignInLogs table
Most active service principals
Gets list of top 100 most active service principals for the last day.
AADServicePrincipalSignInLogs
| where TimeGenerated > ago(1d)
| summarize CountPerServicePrincipal = count() by ServicePrincipalId
| order by CountPerServicePrincipal desc
| take 100
Inactive service principals
Service principals that had no sign-ins for the last 30d.
AADServicePrincipalSignInLogs
| where TimeGenerated > ago(90d)
| where ResultType == 0
| summarize LastSignIn = max(TimeGenerated) by ServicePrincipalId
| where LastSignIn < ago(30d)
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for