Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a145eaf
Abstractions Package - C# project changes (#3626)
paulmedynski Sep 30, 2025
6720b4a
Abstractions Package - Pipeline Changes (#3628)
paulmedynski Oct 16, 2025
4e2c6b4
Move AAD/Entra Authentication into new Azure package (#3680)
paulmedynski Nov 14, 2025
540c2c6
Removed orphaned project import for GenerateResourceStringsSource.tar…
paulmedynski Nov 17, 2025
6f7f621
Abstractions Package - C# project changes (#3626)
paulmedynski Sep 30, 2025
12a5177
- Replaced parameter NugetPackageVersion with packageVersion.
paulmedynski Nov 17, 2025
b653f18
- Removed duplicate parameter.
paulmedynski Nov 17, 2025
e1906a1
- Addressed all comments/feedback in the PR.
paulmedynski Jan 2, 2026
51fdf03
Merge branch 'feat/azure-split' into dev/paul/azure-split/move-tests
paulmedynski Jan 6, 2026
864a7e9
Fixed compile issues with the previous merge.
paulmedynski Jan 6, 2026
de168e7
- Removed duplicate package version section.
paulmedynski Jan 6, 2026
7bfd4c5
- Addressed Copilot feedback.
paulmedynski Jan 6, 2026
01b6701
- Rolled back a few unnecessary changes that just cluttered up the di…
paulmedynski Jan 7, 2026
69319f8
- Trying to fix CldeQL workflow erros.
paulmedynski Jan 7, 2026
cda0c87
- Removed StressTests from CodeQL analysis for now.
paulmedynski Jan 7, 2026
3665496
- Changed MDS common project to always build all supported target fra…
paulmedynski Jan 9, 2026
9722e43
- Removed obsolete MDS assembly name suffix plumbing.
paulmedynski Jan 9, 2026
1190b1b
Fixed stray MDS assembly name suffix.
paulmedynski Jan 9, 2026
fd7b13c
Added the new unified MDS project's SNI paths to the CopySniDllsForNe…
paulmedynski Jan 10, 2026
2661143
- Removed leftovers from MDS assembly name suffix kludge.
paulmedynski Jan 13, 2026
94ab704
- Fixed missing coverage for integrated security tests.
paulmedynski Jan 13, 2026
ffe7e25
Added local SQL Server config for the jobs that need it.
paulmedynski Jan 14, 2026
1834c69
Trying to make the local SQL Server config the same as the MDS tests.
paulmedynski Jan 14, 2026
1858a2b
Applied @benrr101's suggestions from PR #3717.
paulmedynski Jan 15, 2026
3f14d49
- Merge branch 'feat/azure-split' into dev/paul/azure-split/cleanup
paulmedynski Jan 15, 2026
349bc47
- Fixed stale job names.
paulmedynski Jan 15, 2026
0ddde81
Disabling the failing test for now.
paulmedynski Jan 15, 2026
47dc2aa
Removed unnecessary condition from Azure_UserManagedIdentityTest.
paulmedynski Jan 15, 2026
f9c5bee
Restricting the Azure_UserManagedIdentityTest test to ADO pool agents.
paulmedynski Jan 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion eng/pipelines/jobs/pack-abstractions-package-ci-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ jobs:
value: >-
$(commonArguments)
--configuration ${{ parameters.buildConfiguration }}
-p:ForceMdsAssemblyNameSuffix=true
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}

# Explicitly unset the $PLATFORM environment variable that is set by the
Expand Down
1 change: 0 additions & 1 deletion eng/pipelines/jobs/pack-azure-package-ci-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ jobs:
value: >-
--verbosity ${{ parameters.dotnetVerbosity }}
-p:ReferenceType=${{ parameters.referenceType }}
-p:ForceMdsAssemblyNameSuffix=true
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}

# dotnet CLI arguments for build/test/pack commands
Expand Down
1 change: 0 additions & 1 deletion eng/pipelines/jobs/test-abstractions-package-ci-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ jobs:
value: >-
$(commonArguments)
--configuration ${{ parameters.buildConfiguration }}
-p:ForceMdsAssemblyNameSuffix=true

# Explicitly unset the $PLATFORM environment variable that is set by the
# 'ADO Build properties' Library in the ADO SqlClientDrivers public project.
Expand Down
50 changes: 38 additions & 12 deletions eng/pipelines/jobs/test-azure-package-ci-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ parameters:
- Package
- Project

# Steps to run, if any, to configure a local SQL Server instance on the agent
# VM.
- name: sqlServerSetupSteps
type: stepList
default: []

# True if the VM image includes a local SQL Server that supports connections
# via integrated security.
- name: supportsIntegratedSecurity
type: boolean
default: false

# The pool VM image to use.
- name: vmImage
type: string
Expand Down Expand Up @@ -129,16 +141,24 @@ jobs:
value: >-
--verbosity ${{ parameters.dotnetVerbosity }}
-p:ReferenceType=${{ parameters.referenceType }}
-p:ForceMdsAssemblyNameSuffix=true
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}
-p:MdsPackageVersion=${{ parameters.mdsPackageVersion }}

# dotnet CLI arguments for build/test/pack commands
# dotnet CLI arguments for build/test/pack commands.
- name: buildArguments
value: >-
$(commonArguments)
--configuration ${{ parameters.buildConfiguration }}

# dotnet CLI arguments for test commands.
#
# Filter out tests annotated with the ActiveIssue attribute, which for
# some reason uses the category 'failing' rather than 'ActiveIssue'.
#
- name: testArguments
value: >-
--filter "category != failing"

# Explicitly unset the $PLATFORM environment variable that is set by the
# 'ADO Build properties' Library in the ADO SqlClientDrivers public
# project. This is defined with a non-standard Platform of 'AnyCPU', and
Expand Down Expand Up @@ -232,19 +252,25 @@ jobs:
AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
# macOS doesn't support managed identities.
ManagedIdentitySupported: ${{ not(eq(parameters.vmImage, 'macos-latest')) }}
SupportsIntegratedSecurity: ${{ eq(variables['SupportsIntegratedSecurity'], 'true') }}
SupportsIntegratedSecurity: ${{ parameters.supportsIntegratedSecurity }}
TCPConnectionString: $(AZURE_DB_TCP_CONN_STRING)
UserManagedIdentityClientId: $(UserManagedIdentityClientId)
WorkloadIdentityFederationServiceConnectionId: $(WorkloadIdentityFederationServiceConnectionId)
# Note: Using the isFork variable to determine if secrets are
# available is not ideal since it's an indirect association. But
# everything else (referencing secret variables various ways to detect
# if they were present) won't run consistently across forks and
# non-forks.
# Avoid exposing secrets to pipeline jobs triggered via forks. This
# prevents external contributors from creating PRs and running
# pipelines that could expose these secrets.
#
# Note that this isn't a perfect restriction since internal
# contributors may want to use forks, but this would prevent them from
# running the full test suite. We don't have a better way to detect
# external parties though.
${{ if eq(variables['system.pullRequest.isFork'], 'False') }}:
AADPasswordConnectionString: $(AAD_PASSWORD_CONN_STR)
AADServicePrincipalSecret: $(AADServicePrincipalSecret)

# Perform any local SQL Server setup.
- ${{ parameters.sqlServerSetupSteps }}

# We use the 'custom' command because the DotNetCoreCLI@2 task doesn't
# support all of our argument combinations for the different build steps.

Expand Down Expand Up @@ -282,7 +308,7 @@ jobs:
# Many of our tests require access to Azure resources that are
# currently only granted by agents running our custom ADO 1ES
# images in our ADO pools.
${{ if startsWith(parameters.poolName, 'ADO-') }}:
${{ if ne(parameters.poolName, 'Azure Pipelines') }}:
ADO_POOL: 1
# When using connectedServiceName below, the DotNetCoreCLI task
# needs the system access token to be injected as this environment
Expand All @@ -299,14 +325,14 @@ jobs:
command: custom
custom: test
projects: $(project)
arguments: $(buildArguments) --no-build -f ${{ runtime }}
arguments: $(buildArguments) $(testArguments) --no-build -f ${{ runtime }}

# Run the tests for each .NET Framework runtime.
- ${{ each runtime in parameters.netFrameworkRuntimes }}:
- task: DotNetCoreCLI@2
displayName: Test [${{ runtime }}]
env:
${{ if startsWith(parameters.poolName, 'ADO-CI') }}:
${{ if ne(parameters.poolName, 'Azure Pipelines') }}:
ADO_POOL: 1
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
${{ if eq(parameters.debug, true) }}:
Expand All @@ -316,4 +342,4 @@ jobs:
command: custom
custom: test
projects: $(project)
arguments: $(buildArguments) --no-build -f ${{ runtime }}
arguments: $(buildArguments) $(testArguments) --no-build -f ${{ runtime }}
51 changes: 39 additions & 12 deletions eng/pipelines/stages/build-azure-package-ci-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ parameters:
#
# Any pool specified here must contain images with the following names:
#
# - ADO-MMS22-SQL22
# - ADO-UB22-SQL22
# - ADO-CI-Win11
#
default: $(ci_var_defaultPoolName)

Expand Down Expand Up @@ -139,7 +139,7 @@ stages:
debug: ${{ parameters.debug }}
displayNamePrefix: Linux
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
jobNameSuffix: linux_basic
jobNameSuffix: linux
mdsArtifactName: MDS.Artifact
mdsPackageVersion: ${{ parameters.mdsPackageVersion }}
netFrameworkRuntimes: []
Expand All @@ -155,15 +155,25 @@ stages:
abstractionsPackageVersion: ${{ parameters.abstractionsPackageVersion }}
buildConfiguration: ${{ parameters.buildConfiguration }}
debug: ${{ parameters.debug }}
displayNamePrefix: Linux
displayNamePrefix: Linux Integration
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
jobNameSuffix: linux_comprehensive
jobNameSuffix: linux_integration
mdsArtifactName: MDS.Artifact
mdsPackageVersion: ${{ parameters.mdsPackageVersion }}
netFrameworkRuntimes: []
netRuntimes: [net8.0, net9.0, net10.0]
poolName: ${{ parameters.adoPoolName }}
referenceType: ${{ parameters.referenceType }}
# The image includes a SQL Server instance that we must configure.
sqlServerSetupSteps:
- template: /eng/pipelines/common/templates/steps/configure-sql-server-linux-step.yml@self
parameters:
# Override the template's default step condition. We always
# want this step to run.
condition: true
# Use the Azure DevOps Library variable "password" for the SA
# password.
password: $(password)
vmImage: ADO-UB22-SQL22

# ------------------------------------------------------------------------
Expand All @@ -178,7 +188,7 @@ stages:
debug: ${{ parameters.debug }}
displayNamePrefix: Win
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
jobNameSuffix: windows_basic
jobNameSuffix: windows
mdsArtifactName: MDS.Artifact
mdsPackageVersion: ${{ parameters.mdsPackageVersion }}
netFrameworkRuntimes: [net462]
Expand All @@ -194,16 +204,33 @@ stages:
abstractionsPackageVersion: ${{ parameters.abstractionsPackageVersion }}
buildConfiguration: ${{ parameters.buildConfiguration }}
debug: ${{ parameters.debug }}
displayNamePrefix: Win
displayNamePrefix: Win Integration
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
jobNameSuffix: windows_comprehensive
jobNameSuffix: windows_integration
mdsArtifactName: MDS.Artifact
mdsPackageVersion: ${{ parameters.mdsPackageVersion }}
netFrameworkRuntimes: [net462]
netRuntimes: [net8.0, net9.0, net10.0]
poolName: ${{ parameters.adoPoolName }}
referenceType: ${{ parameters.referenceType }}
vmImage: ADO-CI-Win11
# The image includes a SQL Server instance that we must configure.
sqlServerSetupSteps:
- template: /eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml@self
# Use defaults for most parameters.
parameters:
# Override the template's default step condition. We always
# want this step to run.
condition: true
enableLocalDB: true
# These variables are from an Azure DevOps Library variable
# group.
fileStreamDirectory: $(FileStreamDirectory)
password: $(password)
sqlRootPath: $(SQL22RootPath)
# The ADO-MMS22-SQL22 image includes a local SQL Server that supports
# integrated security.
supportsIntegratedSecurity: true
vmImage: ADO-MMS22-SQL22

# ------------------------------------------------------------------------
# Build and test on macOS.
Expand Down Expand Up @@ -242,10 +269,10 @@ stages:
dependsOn:
# We depend on all of the test jobs to ensure the tests pass before
# producing the NuGet package.
- test_azure_package_job_linux_basic
- test_azure_package_job_linux_comprehensive
- test_azure_package_job_windows_basic
- test_azure_package_job_windows_comprehensive
- test_azure_package_job_linux
- test_azure_package_job_linux_integration
- test_azure_package_job_windows
- test_azure_package_job_windows_integration
- test_azure_package_job_macos
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
referenceType: ${{ parameters.referenceType }}
39 changes: 0 additions & 39 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -153,43 +153,4 @@
<!-- The newest .NET SDK we support is .NET 10.0, which uses C# 14 -->
<LangVersion>14</LangVersion>
</PropertyGroup>

<PropertyGroup>
<!--
We currently define 2 separate projects for MDS that both produce an
assembly named 'Microsoft.Data.SqlClient'. This confuses MSBuild during
project-reference based builds of downstream projects (like AKV, Azure, or
tests) - it can't resolve the correct assembly based on the downstream
project's target framework. To avoid such conflicts, we append a suffix
to the MDS AssemblyName property: '.NetCore' for .NET targets, and
'.NetFx' for .NET Framwork targets.
These suffices are only applied during project-reference based builds,
and only for non-pipeline builds (i.e. developer builds). This ensures
that pipeline builds and package-reference based builds use the normal
MDS assembly name. These builds already include safeguards to build
downstream projects for specific target frameworks individually, and thus
don't encounter the same assembly name conflicts.
For developer builds, we don't care that the MDS assembly name isn't
truthful. MSBuild finds the correct artifacts based on target framework
and all downstream projects build without needing a target framework
specified.
For package reference or pipeline builds, the assembly name remains
truthful and downstream projects don't encounter MSBuild restore problems
since the MDS artifacts are pulled from the NuGet package directly.
There are some downstream projects that still expect different assembly
names, even during pipeline builds. For those, we define the
ForceMdsAssemblyNameSuffix property, which overrides the default pipeline
behaviour for project-based builds.
The boolean property ApplyMdsAssemblyNameSuffix can be used by any
project to determine whether or not to apply the MDS assembly name suffix.
-->
<ApplyMdsAssemblyNameSuffix>false</ApplyMdsAssemblyNameSuffix>
<ApplyMdsAssemblyNameSuffix
Condition="'$(ReferenceType)' == 'Project' AND ('$(ForceMdsAssemblyNameSuffix)' == 'true' OR '$(TF_BUILD)' != 'true')">true</ApplyMdsAssemblyNameSuffix>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
<Version>$(AbstractionsPackageVersion)</Version>

<DocumentationFile>$(Artifacts)/doc/$(TargetFramework)/$(AssemblyName).xml</DocumentationFile>

<!--
Apply an MDS assembly name suffix, if necessary. See the top-level
Directory.Build.props for more information.
-->
<DefineConstants Condition="'$(ApplyMdsAssemblyNameSuffix)' == 'true'">$(DefineConstants);APPLY_MDS_ASSEMBLY_NAME_SUFFIX</DefineConstants>
</PropertyGroup>
<ItemGroup>
<!-- Our API is CLS Compliant. -->
Expand Down Expand Up @@ -86,7 +80,7 @@
<PackageIcon>dotnet.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<None Include="../../../../tools/icons/dotnet.png" Pack="true" PackagePath="/" />
<None Include="$(RepoRoot)/tools/icons/dotnet.png" Pack="true" PackagePath="/" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,7 @@ private static class Internal
/// </summary>
static Internal()
{
// Choose the MDS assembly name based on compilation flags and the
// runtime environment. See the top-level Directory.Build.props for
// more information.
string assemblyName = "Microsoft.Data.SqlClient";
#if (APPLY_MDS_ASSEMBLY_NAME_SUFFIX)
if (RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework"))
{
assemblyName += ".NetFx";
}
else
{
assemblyName += ".NetCore";
}
#endif
const string assemblyName = "Microsoft.Data.SqlClient";

// If the MDS package is present, load its
// SqlAuthenticationProviderManager class and get/set methods.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
<AssemblyName>Microsoft.Data.SqlClient.Extensions.Abstractions.Test</AssemblyName>
</PropertyGroup>

<PropertyGroup>
<!--
Apply an MDS assembly name suffix, if necessary. See the top-level
Directory.Build.props for more information.
-->
<DefineConstants Condition="'$(ApplyMdsAssemblyNameSuffix)' == 'true'">$(DefineConstants);APPLY_MDS_ASSEMBLY_NAME_SUFFIX</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../src/Abstractions.csproj" />
</ItemGroup>
Expand All @@ -33,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<Content Include="../../../Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/xunit.runner.json">
<Content Include="$(RepoRoot)/src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>xunit.runner.json</TargetPath>
</Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,14 @@ namespace Microsoft.Data.SqlClient.Extensions.Abstractions.Test;

public class SqlAuthenticationProviderTest
{
// Choose the MDS assembly name based on compilation flags. See the
// top-level Directory.Build.props for more information.
#if (APPLY_MDS_ASSEMBLY_NAME_SUFFIX && NET)
const string assemblyName = "Microsoft.Data.SqlClient.NetCore";
#elif (APPLY_MDS_ASSEMBLY_NAME_SUFFIX && NETFRAMEWORK)
const string assemblyName = "Microsoft.Data.SqlClient.NetFx";
#else
const string assemblyName = "Microsoft.Data.SqlClient";
#endif

/// <summary>
/// Construct to confirm preconditions.
/// </summary>
public SqlAuthenticationProviderTest()
{
// Confirm that the MDS assembly is indeed not present.
Assert.Throws<FileNotFoundException>(() => Assembly.Load(assemblyName));
Assert.Throws<FileNotFoundException>(
() => Assembly.Load("Microsoft.Data.SqlClient"));
}

#region Tests
Expand Down
Loading
Loading