Skip to content

Remove sql auth provider flag#21523

Merged
aasimkhan30 merged 3 commits intomainfrom
aasim/fix/removeSqlauthflag
Mar 13, 2026
Merged

Remove sql auth provider flag#21523
aasimkhan30 merged 3 commits intomainfrom
aasim/fix/removeSqlauthflag

Conversation

@aasimkhan30
Copy link
Copy Markdown
Contributor

Description

The provider has been enabled by default for a long time, and the extension now effectively depends on that mode. In particular, when the SQL Authentication Provider is disabled, the extension no longer implements the token refresh contract expected by STS (language service), which can lead to broken or inconsistent authentication behavior.

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

Removes the user-facing setting/feature-flag for the SQL Authentication Provider and makes the extension always launch SQL Tools Service with the provider enabled, aligning the extension’s behavior with the now-required auth mode described in the PR.

Changes:

  • Removed the mssql.enableSqlAuthenticationProvider setting from package contributions, docs, constants, and localization sources.
  • Always passes --enable-sql-authentication-provider when launching SQL Tools Service.
  • Simplified MSAL controller logic by removing the conditional “provider enabled” branching and related unit test coverage.

Reviewed changes

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

Show a summary per file
File Description
localization/xliff/vscode-mssql.xlf Removes the trans-unit for the deleted setting description.
extensions/mssql/package.json Removes the mssql.enableSqlAuthenticationProvider configuration contribution.
extensions/mssql/package.nls.json Removes the localized description string for the deleted setting.
extensions/mssql/README.md Removes the setting from documentation examples.
extensions/mssql/src/languageservice/serviceclient.ts Always enables SQL Auth Provider via STS command-line argument.
extensions/mssql/src/constants/constants.ts Removes the constant for the deleted setting key.
extensions/mssql/src/controllers/mainController.ts Stops treating the deleted setting as requiring a reload prompt.
extensions/mssql/src/azure/utils.ts Removes the config reader for the deleted setting.
extensions/mssql/src/azure/constants.ts Removes constants tied to the deleted setting.
extensions/mssql/src/azure/azureController.ts Removes provider-enabled state gating and related token-refresh branching.
extensions/mssql/src/azure/msal/msalAzureController.ts Removes provider-enabled branching; init becomes a no-op; changes token acquisition behavior in populateAccountProperties.
extensions/mssql/src/azure/fileEncryptionHelper.ts Always notifies STS of encryption key changes (no longer conditional on the removed setting).
extensions/mssql/test/unit/msalAzureController.test.ts Removes unit test tied to the deleted setting/config.
extensions/mssql/test/unit/objectExplorerService.test.ts Updates stubbing to match removed controller API/behavior.

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

Comment on lines 324 to +328
let account = await this.addAccount(accountStore);
profile.user = account!.displayInfo.displayName;
profile.email = account!.displayInfo.email;
profile.accountId = account!.key.id;

// Skip fetching access token for profile if Sql Authentication Provider is enabled.
if (!this.isSqlAuthProviderEnabled()) {
if (!profile.tenantId) {
await this.promptForTenantChoice(account!, profile);
}

const token = await this.getAccountSecurityToken(account!, profile.tenantId, settings);

if (!token) {
let errorMessage = LocalizedConstants.msgGetTokenFail;
this.logger.error(errorMessage);
this._vscodeWrapper.showErrorMessage(errorMessage);
} else {
profile.azureAccountToken = token.token;
profile.expiresOn = token.expiresOn;
}
} else {
this.logger.verbose(
"SQL Authentication Provider is enabled, access token will not be acquired by extension.",
);
}
this.logger.verbose(
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

populateAccountProperties no longer populates profile.azureAccountToken/profile.expiresOn (or tenantId) and just logs/returns. Callers such as ConnectionManager.confirmEntraTokenValidity use this method as the fallback path after a refresh failure and then copy profile.azureAccountToken/expiresOn back onto the connection; with this change that fallback will always leave the connection without a token and can cause repeated auth failures. Either keep this method acquiring and setting the token fields (and tenant choice) or update the fallback logic to not depend on populateAccountProperties for token acquisition in SQL Auth Provider mode.

Copilot uses AI. Check for mistakes.
Comment thread localization/xliff/vscode-mssql.xlf
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 9, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 6424 KB 6407 KB ⚪ -17 KB ( 0% )
sql-database-projects VSIX 7061 KB 7061 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )

@aasimkhan30 aasimkhan30 changed the title Remove sql auth provider flags Remove sql auth provider flag Mar 9, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 7.14286% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.72%. Comparing base (64e8b10) to head (ad87127).
⚠️ Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
extensions/mssql/src/azure/fileEncryptionHelper.ts 0.00% 6 Missing ⚠️
extensions/mssql/src/azure/azureController.ts 0.00% 3 Missing ⚠️
...nsions/mssql/src/azure/msal/msalAzureController.ts 0.00% 3 Missing ⚠️
...ensions/mssql/src/languageservice/serviceclient.ts 50.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (7.14%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #21523      +/-   ##
==========================================
+ Coverage   72.69%   72.72%   +0.03%     
==========================================
  Files         330      330              
  Lines       98395    98298      -97     
  Branches     5455     5453       -2     
==========================================
- Hits        71529    71491      -38     
+ Misses      26866    26807      -59     
Files with missing lines Coverage Δ
extensions/mssql/src/azure/constants.ts 100.00% <ø> (ø)
extensions/mssql/src/azure/utils.ts 47.40% <ø> (-4.72%) ⬇️
extensions/mssql/src/constants/constants.ts 100.00% <ø> (ø)
...ensions/mssql/src/controllers/connectionManager.ts 57.97% <ø> (-0.04%) ⬇️
extensions/mssql/src/controllers/mainController.ts 33.94% <ø> (+0.01%) ⬆️
...ensions/mssql/src/languageservice/serviceclient.ts 44.23% <50.00%> (-0.16%) ⬇️
extensions/mssql/src/azure/azureController.ts 57.37% <0.00%> (+6.34%) ⬆️
...nsions/mssql/src/azure/msal/msalAzureController.ts 54.12% <0.00%> (+1.42%) ⬆️
extensions/mssql/src/azure/fileEncryptionHelper.ts 35.56% <0.00%> (+0.03%) ⬆️
🚀 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.

Comment thread extensions/mssql/src/azure/msal/msalAzureController.ts Outdated
@aasimkhan30 aasimkhan30 merged commit 59bf223 into main Mar 13, 2026
3 checks passed
@aasimkhan30 aasimkhan30 deleted the aasim/fix/removeSqlauthflag branch March 13, 2026 22:18
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.

4 participants