Skip to content

perf: throttle parallel Azure tenant sign-in checks #688

@tnaum-ms

Description

@tnaum-ms

Context

Surfaced during the review for #685.

Location

Two near-identical fan-outs against the Azure Identity endpoint:

Both do:

await Promise.all(tenants.map(async (tenant) => isSignedIn(tenant.tenantId, tenant.account)));

The shape of the problem

For most users (1-10 tenants), this is fine. For corporate users with many tenants, this is an unbounded parallel burst against Microsoft Entra. It is not currently a known cause of failures, but it is the same anti-pattern that bit us in #685 with estimateDocumentCount.

Proposal

Apply the shared ConcurrencyLimiter from src/utils/concurrencyLimiter.ts (added in #685). Suggested starting point: concurrency: 5, no inter-batch delay (this is a foreground UX path, latency matters). Both call sites should share a single limiter so the total parallelism is bounded across the wizard.

Acceptance criteria

  • Both call sites routed through a shared limiter.
  • Behavior unchanged for users with a small tenant count.
  • No regression in the account-selection / subscription-filtering wizards.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions