vscode uri handler now asks for signing in to another account instead…#2899
vscode uri handler now asks for signing in to another account instead…#2899
Conversation
… of showing a "subscription not found" error. fixes #2686
|
I have not tested this yet, but we should not forget to add tenantId param to the Azure Portal, that's an essential part. |
There was a problem hiding this comment.
Pull request overview
Improves the Cosmos DB “Open in VS Code” URI handler to better handle Azure account/subscription mismatches by prompting the user to sign in or select subscriptions and retrying the reveal flow, with updated messaging and tests.
Changes:
- Add account/subscription mismatch prompting + retry logic around
revealAzureResource/ tree lookup. - Improve URI handler error propagation to preserve
UserCancelledError(avoid wrapping as a generic failure). - Add localization strings and a new test suite covering the new prompts/retry behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/vscodeUriHandler.ts |
Adds prompt/retry helpers for subscription-not-found and account-mismatch scenarios; preserves UserCancelledError propagation. |
l10n/bundle.l10n.json |
Adds/updates strings for new prompts and improved “resource not found” guidance. |
test/vscodeUriHandler.test.ts |
Adds tests for subscription-not-found prompt + retry, account mismatch retry, and cancellation handling. |
extension.bundle.ts |
Exports globalUriHandler for test access. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…source Co-authored-by: mkrueger <341098+mkrueger@users.noreply.github.com>
…dResource` closure (#2941)
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
…n test path Co-authored-by: mkrueger <341098+mkrueger@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
This pull request enhances the robustness and user experience of the Cosmos DB "Open in VS Code" URI handler, especially around Azure account and subscription issues. It introduces improved error handling and user prompts when resources cannot be found due to account or subscription mismatches, and adds comprehensive tests for these scenarios. Additionally, it updates localization strings to provide clearer guidance to users.
Improvements to Azure account/subscription handling:
revealAzureResourceInExplorerinsrc/vscodeUriHandler.tsto detect when a resource cannot be found due to account or subscription issues, prompting the user to sign in or select subscriptions, and retrying the reveal operation after user action. [1] [2]promptToFixAzureAccountAccessandrevealAzureResourceWithAccountPromptto encapsulate user prompting and retry logic for account/subscription issues.globalUriHandlerto properly propagateUserCancelledErrorand provide more descriptive failure messages.Localization and messaging updates:
l10n/bundle.l10n.jsonto clarify instructions when resources are not found due to Azure account or subscription problems, and to support new prompts for sign-in and subscription selection. [1] [2] [3] [4] [5]Testing improvements:
test/vscodeUriHandler.test.tsto verify that the handler correctly prompts users and retries when encountering subscription/account issues, and that cancellation is handled as expected.Other changes:
globalUriHandlerfromextension.bundle.tsto make it available for testing and integration.parseErrorinsrc/vscodeUriHandler.ts.… of showing a "subscription not found" error.fixes #2686