Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve slow microsoft query #5110

Open
vjeffrey opened this issue Jan 21, 2025 · 2 comments
Open

improve slow microsoft query #5110

vjeffrey opened this issue Jan 21, 2025 · 2 comments

Comments

@vjeffrey
Copy link
Contributor

vjeffrey commented Jan 21, 2025

 microsoft.users.any(userPrincipalName == /emergency/)
 emrgID = microsoft.users.where(userPrincipalName == /emergency/).map(id)
 microsoft.rolemanagement.roleDefinitions.where(displayName == "Global Administrator").all(assignments.any(principalId == emrgID))

this query has been found to be very slow in large environments. we need to investigate how to improve it.

@vjeffrey
Copy link
Contributor Author

two possible ways to speed this up:

  • allow fetching of users by userPrincipalName so we don't have to use a where clause there
  • allow fetching of role definitions by display name so we don't need to use a where clause there

@vjeffrey
Copy link
Contributor Author

being able to query

 emrgID = microsoft.users(userPrincipalName == /emergency/).map(id)
 microsoft.rolemanagement.roleDefinitions(displayName == "Global Administrator").all(assignments.any(principalId == emrgID))

would make this easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant