Skip to content

perf(azure): throttle parallel tenant sign-in checks with shared concurrency limiter#694

Merged
tnaum-ms merged 4 commits into
microsoft:mainfrom
hanhan761:perf-688-throttle-tenant-signin
Jun 23, 2026
Merged

perf(azure): throttle parallel tenant sign-in checks with shared concurrency limiter#694
tnaum-ms merged 4 commits into
microsoft:mainfrom
hanhan761:perf-688-throttle-tenant-signin

Conversation

@hanhan761

@hanhan761 hanhan761 commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace unbounded Promise.all fan-outs against the Azure Identity endpoint with a shared ConcurrencyLimiter (concurrency: 5).

For corporate users with many tenants, the original code issued unlimited parallel isSignedIn calls against Microsoft Entra -- the same anti-pattern fixed for estimateDocumentCount in #685.

Issue

Fixes #688

Changes

File Change
src/plugins/api-shared/azure/tenantSignInLimiter.ts New -- shared LimitedRunner (concurrency: 5) wrapping createConcurrencyLimiter
src/plugins/api-shared/azure/credentialsManagement/SelectAccountStep.ts Import limiter, wrap isSignedIn calls
src/plugins/api-shared/azure/subscriptionFiltering/InitializeFilteringStep.ts Import limiter, wrap isSignedIn calls

Verification

  • npm run build -- TypeScript compilation passes
  • npm run lint -- ESLint passes
  • npm run prettier-fix -- formatting confirmed

Copilot AI review requested due to automatic review settings May 29, 2026 13:14
@hanhan761 hanhan761 requested a review from a team as a code owner May 29, 2026 13:14
@tnaum-ms tnaum-ms added the in-triage-queue We've seen your input and will triage it label Jun 4, 2026
@tnaum-ms tnaum-ms force-pushed the perf-688-throttle-tenant-signin branch from 1b357bc to f32064e Compare June 19, 2026 12:36
@tnaum-ms tnaum-ms added this to the 0.9.1 milestone Jun 19, 2026
@tnaum-ms tnaum-ms removed the in-triage-queue We've seen your input and will triage it label Jun 19, 2026
@tnaum-ms

Copy link
Copy Markdown
Collaborator

Maintainer note (triage)

This branch was rebased onto main and reduced to the minimal change for #688. It reuses the existing shared createConcurrencyLimiter utility (instead of a bespoke limiter) to cap parallel tenant isSignedIn checks across both wizard steps (SelectAccountStep and InitializeFilteringStep). The unrelated strays that had leaked in via earlier stacked commits (index-count code and the package.json multi-select changes from a sibling PR) were pruned, so the diff is now limited to the limiter and its two call sites.

There was no Copilot review on this PR. The limiter itself is unit-tested; a manual check with a 50+ tenant Azure account is still recommended before merge.

@tnaum-ms tnaum-ms merged commit 75d3058 into microsoft:main Jun 23, 2026
5 checks passed
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

Successfully merging this pull request may close these issues.

perf: throttle parallel Azure tenant sign-in checks

3 participants