Repository navigation
Conversation
$expand on a relationship of a directory object returns at most 20 items and no @odata.nextLink. MT.1063 read owners with applications?$expand=owners, so owners past the 20th were never checked and the test could pass while one of them had no MFA registered. Apps whose expanded owners reach 20 are now read again from applications/{id}/owners, which pages.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Up to standards ✅🟢 Issues
|
|
Ran MT.1063 against my lab tenant, main against this PR, each build in its own PowerShell session (PowerShell 7.7.0, Maester 3.0.0, Microsoft.Graph.Authentication 2.41.2). One app registration has 25 owners, all disabled accounts created for the run.
Both pass: the 25 accounts are not in The unit test covers the other case, where owners past the 20th have no MFA: main passes, this PR fails. |
📑 Description
MT.1063 reads app registration owners with
applications?$expand=owners. On a relationship of a directory object,$expandreturns at most 20 items and no@odata.nextLink(Microsoft Graph known issues). Owners past the 20th are never checked, so the test can pass while one of them has no MFA registered.Apps whose expanded owners reach 20 are now read again from
applications/{id}/owners, which pages. Apps with fewer than 20 owners keep the single call, so the cost is one extra request per app at the cap.I hit the same cap on
servicePrincipals?$expand=appRoleAssignmentswhile building app-grant-diff: a principal holding 25 assignments came back with 20, the missing ones scattered through the list rather than at the end.The other
$expandcalls in the repository are not affected. MT.1226 expandsfederatedIdentityCredentials, which Entra limits to 20 per application (source). The remaining ones expand Intune, Global Secure Access, entitlement management and recommendation relationships, not directory objects.cc @marcel-ngn as the author of MT.1063.
✅ Checks
/powershell/tests/pester.ps1locally.ℹ️ Additional Information
Unit test.
Test-MtAppRegistrationOwnersWithoutMFA.Tests.ps1mocks an app whose expansion stops at 20 owners, all with MFA, while 25 exist and the last five have none. On main the function returns$true; with this change it returns$falseand lists the five. A second case checks that an app with 19 owners is not read again.Repository checks. FileEncoding, GraphCacheUsage, GraphEndpoint, LanguageNeutralMicrosoftUrls, NativeTestLint and RepositoryLayout pass, except the byte order mark check on
Invoke-MtPackGitHubRequest.Tests.ps1, which fails on main as well and #2797 fixes.Live tenant. In a lab tenant, one app registration with 25 owners: the request MT.1063 sends (
applications?$expand=owners) returned 20 of them, andapplications/{id}/ownersreturned all 25. The main vs PR run of MT.1063 against that tenant follows in a comment.Summary by CodeRabbit