Skip to content

Change AKV Provider to target .NET Standard 2.0#4016

Draft
paulmedynski wants to merge 6 commits intomainfrom
dev/paul/akv-netstandard
Draft

Change AKV Provider to target .NET Standard 2.0#4016
paulmedynski wants to merge 6 commits intomainfrom
dev/paul/akv-netstandard

Conversation

@paulmedynski
Copy link
Contributor

@paulmedynski paulmedynski commented Mar 6, 2026

Description

This PR changes the AKV Provider to target .NET Standard 2.0 since it doesn't contain any code specific to .NET or .NET Framework. Changes include:

  • AKV Provider Changes:
    • Explicitly set <TargetFramework> to netstandard2.0 in the AKV Provider project.
    • Removed the add-ons/Directory.Build.props.
    • Absorbed the AKV Provider nuspec into the csproj.
  • Build Changes:
    • Added new BuildAkvProvider and PackAkvProvider targets to build.proj.
    • Removed all of the obsolete AKV Provider build targets.
    • Removed the GenerateAkvPackage target and all references to it.
    • Added BuildAllPackages and PackAllPackages targets.
    • Added BuildSqlClient and PackSqlClient targets to help fix the Docs-Build-Pack-Publish pipeline.
  • Pipeline Changes:
    • Updated pipelines to pack the AKV Provider directly.

Testing

  • Automated PR runs will confirm basic functionality.
  • Manual CI run will confirm those pipeline changes.
  • Manual OneBranch pipeline runs will confirm official builds.
  • Maunal runs of the Docs-Build-Pack-Publish pipeline to confirm fixes there.

Copilot AI review requested due to automatic review settings March 6, 2026 15:52
@paulmedynski paulmedynski added the Area\AKV Provider Use this label to tag issues that are targeted for AKV Provider codebase. label Mar 6, 2026
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 6, 2026
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board Mar 6, 2026
<DocumentationFile>$(BinFolder)$(Configuration).$(Platform)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>

<!-- Trim/AOT Support ================================================ -->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

.NET Standard 2.0 isn't trimmable or AOT compatible.

<IsTrimmable>true</IsTrimmable>
<IsAotCompatible>true</IsAotCompatible>
<ItemGroup>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved here from the deleted Directory.Build.props.


See: https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target
-->
<PropertyGroup>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absorbed from the nuspec, thanks to Copilot.

<!-- MDS Reference -->
<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Microsoft.Data.SqlClient\src\Microsoft.Data.SqlClient.csproj"
<ProjectReference Include="$(RepoRoot)/src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The SqlClient project doesn't target .NET Standard 2.0, but it's ref project does. We don't need a real implementation to compile against.

<readme>README.md</readme>
<repository type="git" url="https://github.com/dotnet/sqlclient" commit="$COMMITID$" />
<description>The current data provider for SQL Server and Azure SQL databases. This has replaced System.Data.SqlClient. These classes provide access to SQL and encapsulate database-specific protocols, including tabular data stream (TDS).
<description>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Formatting cleanup.

Copy link
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

This PR updates the Always Encrypted Azure Key Vault (AKV) Provider to target .NET Standard 2.0 and modernizes its packaging flow by moving from a standalone .nuspec/custom MSBuild target to SDK-style dotnet pack driven by the AKV Provider .csproj. It also updates build/pipeline wiring to use the new BuildAkvProvider/PackAkvProvider targets.

Changes:

  • Removed the legacy AKV .nuspec and GenerateAkvPackage MSBuild target infrastructure.
  • Updated the AKV Provider project to netstandard2.0 and embedded NuGet metadata into the .csproj.
  • Updated build and pipeline steps to build/pack the AKV Provider directly via dotnet pack and new build.proj targets.

Reviewed changes

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

Show a summary per file
File Description
tools/targets/add-ons/GenerateAkvPackage.targets Removes the legacy GenerateAkvPackage target.
tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec Deletes the old AKV Provider .nuspec (packaging now via .csproj).
tools/specs/Microsoft.Data.SqlClient.nuspec Adds a header comment documenting required nuget pack properties (contains a small typo).
src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props Removes add-ons-specific props file (AKV now uses standard props chain).
src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj Sets netstandard2.0 and absorbs NuGet package metadata/config into the project.
eng/pipelines/onebranch/variables/common-variables.yml Removes akvNuspecPath variable (no longer applicable).
eng/pipelines/onebranch/steps/roslyn-analyzers-akv-step.yml Updates build target from BuildAkv to BuildAkvProvider.
eng/pipelines/onebranch/steps/compound-build-akv-step.yml Updates build target naming/usage to BuildAkvProvider.
eng/pipelines/onebranch/jobs/build-akv-official-job.yml Switches AKV packaging step from nuspec-based to dotnet pack on the .csproj.
eng/pipelines/common/templates/steps/ci-project-build-step.yml Replaces old AKV build targets with BuildAkvProvider (but introduces a Windows gating issue).
eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml Switches AKV packaging from nuspec-based step to dotnet pack on the .csproj.
build.proj Removes GenerateAkvPackage.targets import; adds BuildAkvProvider/PackAkvProvider; updates BuildSqlClient deps.
BUILDGUIDE.md Documents the new BuildAkvProvider/PackAkvProvider targets and removes obsolete AKV targets.
Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj:78

  • Switching AKV Provider packaging from a nuspec to SDK-style dotnet pack means the project’s PackageReferences/ProjectReferences now flow into the produced NuGet dependency graph. This project currently references Microsoft.Data.SqlClient.Extensions.Logging, which the removed nuspec did not list, so this change will add/alter external package dependencies for consumers. If the AKV provider doesn’t actually use Logging APIs, remove that reference or mark it as PrivateAssets=all to avoid changing the published dependency set.
  <!-- References ====================================================== -->
  <!-- MDS Reference -->
  <ItemGroup>
    <ProjectReference Include="$(RepoRoot)/src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj"
                      Condition="'$(ReferenceType)' != 'Package'" />
    <PackageReference Include="Microsoft.Data.SqlClient"
                      Condition="'$(ReferenceType)' == 'Package'" />
  </ItemGroup>

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 6, 2026 19:27
Copy link
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 17 out of 17 changed files in this pull request and generated 3 comments.


You can also share your feedback on Copilot code review. Take the survey.

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.48%. Comparing base (569ada7) to head (bc19a3a).

❗ There is a different number of reports uploaded between BASE (569ada7) and HEAD (bc19a3a). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (569ada7) HEAD (bc19a3a)
CI-SqlClient 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4016      +/-   ##
==========================================
- Coverage   72.36%   64.48%   -7.88%     
==========================================
  Files         287      282       -5     
  Lines       43149    66073   +22924     
==========================================
+ Hits        31223    42610   +11387     
- Misses      11926    23463   +11537     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 64.48% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…y to inhibit NuGet.exe download when generating SqlClient package.
Copilot AI review requested due to automatic review settings March 6, 2026 20:53

<!-- We will download the latest NuGet executable unless otherwise inhibited. -->
<PropertyGroup>
<InstallNuget Condition="'$(InstallNuget)' != 'false'">true</InstallNuget>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Docs-Build-Pack-Publish pipeline isn't permitted to download things, so it will set this to false.

Copy link
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 18 out of 18 changed files in this pull request and generated 2 comments.


You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\AKV Provider Use this label to tag issues that are targeted for AKV Provider codebase.

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants