Skip to content

Adding SqlPackage Service for supporting Sqlpackage command generation changes#2556

Merged
ssreerama merged 30 commits intomainfrom
sai/SqlPkgCmdGen
Jan 14, 2026
Merged

Adding SqlPackage Service for supporting Sqlpackage command generation changes#2556
ssreerama merged 30 commits intomainfrom
sai/SqlPkgCmdGen

Conversation

@ssreerama
Copy link
Copy Markdown
Contributor

Pull Request Template – SQL Tools Service

Description

This PR provides the Service layer that bridges VSCode and the SqlPackage API by transforming client-side deployment configurations into SqlPackage CLI command strings, handling contract conversion and option normalization.

Below are the complete changes that have made to achieve this task with sqlpackage service.

  • GenerateSqlPackageCommandRequest.cs - Defines the RPC contract between VSCode and STS.
  • SqlPackageCommandParams (request) and request type for the "sqlpackage/generateCommand" endpoint.
  • SqlPackageCommandResult.cs - Response contract sent back to VSCode containing the generated command string, success status, and error message.
  • SqlPackageService.cs - Service layer that handles command generation requests, normalizes deployment options for Publish/Script operations, converts STS contracts to API types, and calls the SqlPackage API.
  • Changes in csproj file using HintPathGeneratePathProperty → Creates $(PkgMicrosoft_SqlPackage) variable pointing to package folder
    • IncludeAssets="none" → Don't auto-include the package in build output
    • HintPath → Manually reference only the sqlpackage.dll assembly we need
    • Private = true → Copies the dll to the build output folder

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (dotnet test)
  • Code follows contributing guidelines
  • Logging/telemetry updated if relevant
  • No protocol or behavioral regressions

Reviewers: Please read our reviewer guidelines

@github-actions
Copy link
Copy Markdown

As part of updating the dependencies in Packages.props we require that any PRs opened also verify that
they've done the following checks.

Please respond to this comment verifying that you've done the appropriate validation (or explain why it's not necessary) before merging in the PR

  • Built and tested the change locally to validate that the update doesn't cause any regressions and fixes the issues intended
  • Tested changes on all major platforms
    • Windows
    • Linux
    • Mac
  • Check the source repo for any open issues with the release being updated to (if available)

@ssreerama ssreerama changed the title Sai/sql pkg cmd gen Adding SqlPackage Service for supporting Sqlpackage command generation changes Jan 7, 2026
@ssreerama ssreerama self-assigned this Jan 7, 2026
@ssreerama ssreerama marked this pull request as ready for review January 7, 2026 01:21
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Working on uploading the Sqlpackage Core nuget to nuget.org, uploaded temporarily for the validation checks

<dependency id="Azure.Identity" version="1.12.0" />
<dependency id="Microsoft.Data.SqlClient" version="5.1.6" />
<dependency id="Azure.Identity" version="1.14.2" />
<dependency id="Microsoft.Data.SqlClient" version="6.1.3" />
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.

This is a pretty significant bump in sqlclient. We will have to make sure if everything is still working.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we are not bumping the MDS with this release so, reverted the changes and fixed the issue with the Nuget that causes the vbump requirement

Packages.props Outdated
<PackageReference Update="Azure.Identity" Version="1.12.0" />
<PackageReference Update="Microsoft.Data.SqlClient" Version="5.1.7" />
<PackageReference Update="Azure.Identity" Version="1.14.2" />
<PackageReference Update="Microsoft.Data.SqlClient" Version="6.1.3" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought we decided yesterday that we don't need to update MDS for this release. is it required for your work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since the New Nuget's sqlpackage.dll build against latest dacfx, it is expecting the MDS version bump and few supported packages upgrade. But I'll verify again if the version upgrades can be bypassed with the nuget usage.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you nuget should have dependency on dacfx 170.2. that's what we discussed in the meeting.

await requestContext.SendResult(new SqlPackageCommandResult
{
Success = false,
ErrorMessage = "Invalid request parameters"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shouldn't be localized?

/// <summary>
/// Enable diagnostics logging
/// </summary>
public bool Diagnostics { get; set; }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you cannot inherit from CommandLineArguments so you don't duplicate all the properties?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

great point! actually we can avoid repetition of this by doing inheritance, since i have started with few arguments before i made the commandlineArgs public, I missed this one. Thanks.

<group targetFramework="net8.0">
<dependency id="Azure.Identity" version="1.12.0" />
<dependency id="Microsoft.Data.SqlClient" version="5.1.7" />
<dependency id="Microsoft.Data.SqlClient" version="5.1.6" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why? seems wrong

Copy link
Copy Markdown
Contributor Author

@ssreerama ssreerama Jan 13, 2026

Choose a reason for hiding this comment

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

Batchparser is at 5.1.6 currenlty, should be align with MDS version with props file though. we are not making any changes to that in this PR.

@@ -1,5 +1,5 @@
// WARNING:
// This file was generated by the Microsoft SQL Server String Resource Tool 9.0.0.0
// This file was generated by the Microsoft SQL Server String Resource Tool 10.0.0.0
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.

Do you know why we are seeing these changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I ran the localization command to generate the loc strings, and it produced these updates to the files.

@ssreerama ssreerama merged commit 6858e96 into main Jan 14, 2026
6 checks passed
@ssreerama ssreerama deleted the sai/SqlPkgCmdGen branch January 14, 2026 17:39
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