Skip to content

Conversation

@KenitoInc
Copy link
Collaborator

@KenitoInc KenitoInc commented Nov 5, 2025

Sample scripts on how to apply batch operations in Graph API calls.
Goal : Performance improvements on operations that involve alot of API calls.

In the sample script, below are the operations

  1. Getting all the users in the tenant. We use $users = Get-EntraUser -All
  2. Using the users collections, create batch requests, each with a maximum of 20 sub-requests. Each subrequest invokes /users/$($user.id)/authentication/methods endpoint to get authentication methods.
  3. We then call Invoke-BatchWithRetry function passing each batch request.
  • This function invoke the https://graph.microsoft.com/v1.0/$batch endpoint with the batch payload.
  • This function handles 429 errors. This is due to time-out errors

@KenitoInc KenitoInc requested a review from a team as a code owner November 5, 2025 09:49
@KenitoInc KenitoInc added the Ready For Review The PR Ready for Review label Nov 5, 2025
@learn-build-service-prod
Copy link

Learn Build status updates of commit ec29528:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details

  • Line 0, Column 0: [Error: PSMD2Yaml_FileLoadFailed] Failed to load file: C:/LocalRun/W/qcvk-s/module/mapping/monikerMapping.json. PackageRoot, ReferenceTocUrl, and ConceptualTocUrl are required for every moniker. PackageRoot should be a valid relative path to docset root.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

@givinalis
Copy link
Collaborator

@KenitoInc please add a description for this PR to provide sufficient context.

@learn-build-service-prod
Copy link

Learn Build status updates of commit 75c89ba:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details

  • Line 0, Column 0: [Error: PSMD2Yaml_FileLoadFailed] Failed to load file: C:/LocalRun/W/ta5b-s/module/mapping/monikerMapping.json. PackageRoot, ReferenceTocUrl, and ConceptualTocUrl are required for every moniker. PackageRoot should be a valid relative path to docset root.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

@KenitoInc KenitoInc force-pushed the kemunga/sample-batch-authenticationmethods branch from f05c006 to c1ff91d Compare November 27, 2025 07:00
@learn-build-service-prod
Copy link

Learn Build status updates of commit f05c006:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details

  • Line 0, Column 0: [Error: PSMD2Yaml_FileLoadFailed] Failed to load file: C:/LocalRun/W/2ens-s/module/mapping/monikerMapping.json. PackageRoot, ReferenceTocUrl, and ConceptualTocUrl are required for every moniker. PackageRoot should be a valid relative path to docset root.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

@learn-build-service-prod
Copy link

Learn Build status updates of commit c1ff91d:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details

  • Line 0, Column 0: [Error: PSMD2Yaml_FileLoadFailed] Failed to load file: C:/LocalRun/W/xnjk-s/module/mapping/monikerMapping.json. PackageRoot, ReferenceTocUrl, and ConceptualTocUrl are required for every moniker. PackageRoot should be a valid relative path to docset root.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

@KenitoInc KenitoInc merged commit 5d555c7 into main Nov 27, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review The PR Ready for Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants