Skip to content

Adding Active Directory Default support#21828

Open
Benjin wants to merge 9 commits intomainfrom
dev/benjin/activeDirectoryDefault
Open

Adding Active Directory Default support#21828
Benjin wants to merge 9 commits intomainfrom
dev/benjin/activeDirectoryDefault

Conversation

@Benjin
Copy link
Copy Markdown
Contributor

@Benjin Benjin commented Apr 6, 2026

Description

Adding support for authentication via ActiveDirectoryDefault mode, which instructs the MDS driver to look for a credential on its own in a number of different places, including Az powershell, Az CLI, a shared token cache, and environment credentials (which covers client ID + secret/cert and username + password).

To test, install the Az CLI, then run az login to sign in with an account.

image

To do:

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds extension-side support for connecting with the ActiveDirectoryDefault (Microsoft Entra ID Default) authentication mode, including UI plumbing, connection profile validation, and unit test coverage.

Changes:

  • Introduces ActiveDirectoryDefault as a supported authentication type across shared interfaces and model enums.
  • Updates connection profile validation and connection-string parsing allowlist to accept ActiveDirectoryDefault.
  • Adds localized display text and expands unit tests/mocks to cover the new authentication mode.

Reviewed changes

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

Show a summary per file
File Description
localization/xliff/vscode-mssql.xlf Adds new localized strings for the new auth mode and updates an error message (auto-generated localization file).
extensions/mssql/l10n/bundle.l10n.json Adds new localized key/value entries for the new auth mode and updates an error message (localization bundle).
extensions/mssql/src/constants/locConstants.ts Adds a localized label for “Microsoft Entra Id - Default” and updates unsupported-auth error message text.
extensions/mssql/src/sharedInterfaces/connectionDialog.ts Adds AuthenticationType.ActiveDirectoryDefault to the shared (webview) auth type enum.
extensions/mssql/src/models/interfaces.ts Adds AuthenticationTypes.ActiveDirectoryDefault to the core model enum.
extensions/mssql/src/models/connectionProfile.ts Treats ActiveDirectoryDefault as server-only for isValidProfile() validation.
extensions/mssql/src/models/connectionCredentials.ts Adds the new auth type to the auth-type quick pick choices.
extensions/mssql/src/connectionconfig/connectionDialogWebviewController.ts Allows connection-string import to accept ActiveDirectoryDefault.
extensions/mssql/src/objectExplorer/objectExplorerService.ts Forces the VS Code Azure sign-in prompt when retrying after a missing VS Code Entra auth error.
extensions/mssql/test/unit/mocks.ts Updates mock capabilities to include the new auth type.
extensions/mssql/test/unit/connectionProfile.test.ts Adds a unit test asserting server-only validity for ActiveDirectoryDefault.
extensions/mssql/test/unit/connectionCredentials.test.ts Adds a unit test ensuring the auth type is preserved in createConnectionInfo().
extensions/mssql/test/unit/connectionDialogWebviewController.test.ts Adds unit tests for UI visibility expectations and connection-string import with ActiveDirectoryDefault.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 77285 KB 77285 KB ⚪ 0 KB ( 0% )
sql-database-projects VSIX 6175 KB 6175 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )
keymap VSIX 7 KB 7 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 84.93151% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.93%. Comparing base (d2c596e) to head (f7196b7).

Files with missing lines Patch % Lines
extensions/mssql/src/controllers/queryRunner.ts 64.70% 6 Missing ⚠️
...tensions/mssql/src/models/connectionCredentials.ts 0.00% 4 Missing ⚠️
...ensions/mssql/src/controllers/connectionManager.ts 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #21828      +/-   ##
==========================================
+ Coverage   73.91%   73.93%   +0.01%     
==========================================
  Files         338      338              
  Lines      102104   102153      +49     
  Branches     5950     5955       +5     
==========================================
+ Hits        75474    75528      +54     
+ Misses      26630    26625       -5     
Files with missing lines Coverage Δ
...nectionconfig/connectionDialogWebviewController.ts 63.71% <100.00%> (+0.25%) ⬆️
extensions/mssql/src/constants/locConstants.ts 75.51% <100.00%> (+<0.01%) ⬆️
...ons/mssql/src/controllers/webviewBaseController.ts 82.92% <100.00%> (+0.10%) ⬆️
extensions/mssql/src/models/connectionProfile.ts 69.29% <100.00%> (+10.36%) ⬆️
extensions/mssql/src/models/interfaces.ts 98.51% <100.00%> (+<0.01%) ⬆️
.../mssql/src/objectExplorer/objectExplorerService.ts 78.75% <100.00%> (ø)
.../schemaDesigner/schemaDesignerWebviewController.ts 85.81% <100.00%> (+0.03%) ⬆️
...ons/mssql/src/sharedInterfaces/connectionDialog.ts 97.87% <100.00%> (+0.02%) ⬆️
extensions/mssql/src/sharedInterfaces/telemetry.ts 100.00% <100.00%> (ø)
extensions/mssql/src/telemetry/telemetry.ts 98.75% <100.00%> (+0.01%) ⬆️
... and 4 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings April 7, 2026 19:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Copilot AI review requested due to automatic review settings April 9, 2026 19:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

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.

3 participants