Repository navigation
Support Entra ID sign-in in sovereign clouds and explain sign-in failures - #1050
Conversation
Record the investigation of Entra ID sign-in failures (AADSTS65002) in Azure US Government: the client and resource app IDs, why preauthorization is fixed outside the extension, the opaque broker error, per-cloud OSSRDBMS audiences published in ARM metadata, and how other extensions handle sovereign clouds. Add decisions and the iteration plan for a cloud-aware DocumentDB token audience (interactive, managed identity, custom clouds) and a single-table Entra error classifier routed through ConnectionDiagnosticsService. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ity flows Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…nces Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
✅ CI passed: standard tier (ready PR)Commit
Full run: add the Code quality
Build sizeNo page, activation, VSIX or other bundle size changed by 5% or 50 KiB or more against Artifacts: VSIX | Bundle-reports-41834283100 | L1-manifest-report-41834283100 All graphs (exact bytes)
Packaged bytes. Shared chunks count in every graph that loads them, so rows do not add up. Updated in place on every run. |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…nd pass findings and recommendations
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Review follow-up: fixes beyond the Copilot threadsThe five Copilot threads each have a reply with the fixing commit. Those were C1–C5 in the review file, iteration 02, which records each finding, the decision and a done note. The same review found further issues; they were fixed as follows. Fixes
Improvements in this PR since the last review
Still open
Focused tests for the changed areas pass locally (7 files, 216 tests), and the localization bundle is up to date. CI is running on fe267ff. |
Reverts 7f2a288. The 1.0.2-sov-cloud-preview version existed only for a preview build, which is no longer needed because the branch merges next. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
One private DNS name or IP address in the seed list made the host cloud "unknown", which skipped the interactive cloud-mismatch check and sent managed identity to IMDS even though an azure.us/azure.cn host already identified the cloud. Unrecognized hosts are now ignored; hosts in more than one built-in cloud stop interactive and managed-identity sign-in with a clear message (copy falls back to the VS Code cloud). The trace records hostsOutsideAzure for support; no host names are logged. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Update: the remaining review items are done
Case 2 ran in full on 1d38808 (Vitest: 5633 passed, 1 skipped; |
Rename the unshipped mongoClusterHostnameSuffix property to hostnameSuffix without a compatibility alias. Update readers, diagnostics, localization, tests, and current documentation. Co-authored-by: Copilot <[email protected]>
- Add a "What to do when" table and a per-setup configuration matrix - Make the Settings editor the primary way to set each setting, with JSON and the Azure Resources command as alternatives - Explain Remote settings for machine-scoped documentDB.customEnvironment and when a change takes effect - Add error message tables with who can fix each problem - Document the [Authentication] output lines for diagnostics - Drop internal implementation details - Note cloud-aware TOKEN_RESOURCE in managed identity and copy docs - Link the setting description to the guide Co-authored-by: Copilot <[email protected]>
…(WI-29) Adds the dns.mixedHostDomains warning to the Server address (DNS) step, for Microsoft Entra ID and managed identity connections only. It classifies the hosts the driver contacts (seeds, the SRV name and its resolved targets) with getAzureHostSuffix and the trusted documentDB.customEnvironment.hostnameSuffix, and warns when they span two built-in clouds, or one built-in cloud plus unrecognized names (IP literals included). Hosts that are all unrecognized do not warn. The package DNS check is wrapped, and the finding is attached once, to the first host DNS resolves. It only turns a pass into a warning, so blocking, the headline and later checks are unchanged. Finding data and telemetry carry counts and cloud enums only, and the panel shows the finding without a host. Reason: #1050 review finding E2. The resolver itself is unchanged. Co-authored-by: Copilot <[email protected]>
What changed
Microsoft Entra ID connections to Azure DocumentDB now work with the Azure cloud VS Code is signed in to (Azure US Government, Azure China, custom clouds), and sign-in failures get actionable explanations.
https://ossrdbms-aad.database.windows.net. It now requests the open-source database resource of the cloud selected inmicrosoft-sovereign-cloud.environment:…usgovcloudapi.netfor US Government and…chinacloudapi.cnfor China. Public-cloud behaviour is unchanged; tests pin the scope string.documentDB.customEnvironment.ossrdbmsEndpointsetting, from the custom cloud's sign-in host, or from its ARM metadata (/metadata/endpoints?api-version=2022-09-01). If none of these works, the connection fails with a clear message. Custom clouds never fall back to the public audience.azure.com,azure.us,azure.cn) belongs to a different cloud than the one VS Code is signed in to, the extension stops before sign-in and names the setting to change. Host names outside these domains, such as private DNS names or IP addresses, are ignored, so they no longer hide the cloud of the recognized hosts. Hosts in more than one Azure cloud stop sign-in with a message to check the connection string.TOKEN_RESOURCE.src/documentdb/auth/entraErrors/entraErrorRules.ts) maps AADSTS codes and the opaque Windows broker error to messages that say who can fix the problem.ConnectionDiagnosticsService, so every surface that already explains connection errors gets it.entraCloud.resolved: the cloud, the sign-in provider, the broker mode, the host's cloud, and the chosen token resource with the reason for it. No tenant, account, host or connection-string values are logged.docs/user-manual/sovereign-clouds.md. It now says themsal-no-brokertoken-cache caveat applies to all sovereign clouds.Why
A user reported that in Azure US Government, listing resources works but connecting with Entra ID fails with AADSTS65002. There are two causes:
decisions.md records the rejected alternatives and the reasoning. They include using our own client ID, falling back to the public audience, buttons on diagnostics, and restarting sessions when credentials change (D12).
Scope
Not in this PR:
Reviews
Validation
Case 2 ran in full on
1d388086, the code head;de93377bafter it is docs-only:prettier-fix: its one formatting change is committed;l10n:check: up to date;lint,build,typecheck:tests: pass;npx vitest run: 323 files, 5633 passed, 1 skipped;npm run package: VSIX built.Not verified end to end: nobody on the team has sovereign-cloud access. US Government sign-in cannot succeed until the service-side configuration rolls out.
Before shipping (D11): check telemetry for successful Entra connections to
*.azure.cnhosts, so the switch to the China audience cannot break existing users.Links