Skip to content

auth: Skip failing tenants instead of aborting subscription listing - #2208

Merged
Alex Weininger (alexweininger) merged 4 commits into
mainfrom
alex/harlequin-pinniped
Mar 5, 2026
Merged

Alex Weininger (alexweininger) merged 4 commits into
mainfrom
alex/harlequin-pinniped

Conversation

@alexweininger

Copy link
Copy Markdown
Member

When listing subscriptions across tenants, a failing tenant (e.g., locked account) would throw a non-NotSignedInError, causing Promise.all to reject and skip all remaining tenants. Now these errors are caught, logged, and the tenant is skipped so other tenants can still be listed.

Fixes microsoft/azcode#110

When listing subscriptions across tenants, a failing tenant (e.g., locked account) would throw a non-NotSignedInError, causing Promise.all to reject and skip all remaining tenants. Now these errors are caught, logged, and the tenant is skipped so other tenants can still be listed.

Fixes microsoft/azcode#110
@alexweininger
Alex Weininger (alexweininger) requested a review from a team as a code owner March 4, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates subscription enumeration to be resilient to per-tenant failures so that one failing tenant/account doesn’t abort listing subscriptions across other tenants.

Changes:

  • Swallow (non-NotSignedInError) errors when listing subscriptions per-tenant and continue processing remaining tenants.
  • Add debug logging when skipping tenants/accounts due to unexpected errors.
  • Bump @microsoft/vscode-azext-azureauth version to 6.0.0-alpha.4.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
auth/src/providers/AzureSubscriptionProviderBase.ts Catch and skip tenant/account failures during subscription enumeration to avoid Promise.all aborting the full run.
auth/package.json Version bump for the auth package.
auth/package-lock.json Lockfile update to reflect the new package version.
Files not reviewed (1)
  • auth/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

auth/src/providers/AzureSubscriptionProviderBase.ts:166

  • This skip-on-error path logs via logForTenant which uses logger.debug. Since debug output is commonly suppressed at normal log levels, tenant failures may become hard to diagnose. Consider using logger.warn/logger.error (while still skipping) for these non-NotSignedInError cases so the issue is visible to users and telemetry/log collectors.
                                    this.logForTenant(tenant, `Skipping account+tenant due to error: ${err}`);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Alex Weininger (@alexweininger) I've opened a new pull request, #2209, to work on those changes. Once the pull request is ready, I'll request review from you.

#2209)

* Initial plan

* Log skipped tenant/account errors at warn level with stack trace

Co-authored-by: alexweininger <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: alexweininger <[email protected]>
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.

Fail to list all Subscriptions with Azure Resources

5 participants