Skip to content

Commit 6f7f621

Browse files
committed
Abstractions Package - C# project changes (#3626)
Abstractions Package - Pipeline Changes (#3628) Move AAD/Entra Authentication into new Azure package (#3680) User Story 39839: Move existing MDS tests to Azure package - Identified and moved tests specific to ActiveDirectoryAuthenticationProvider into the Azure Test project. - Updated some MDS tests that unnecessarily used ActiveDirectoryAuthenticationProvider. - Added tests to Abstractions Test project to ensure AAD/Entra auth fails when the Azure package isn't present. - Various build and pipeline changes to support the test changes. - Fixed project-based builds so we can restore MDS netcore and netfx projects at the same time. - Added caching to the managed identity provider for the ManualTest project. - Moved username/password Entra auth provider into its own file for sharing across tests. - Added ADO service connection for test tasks that require access to Azure resources. - Added workload identity federation tests. - Solved the mystery of SNI DLLs missing for .NET Framework project-reference-based builds. - Added ADO-CI-1ES pool jobs to test the Azure package on Linux and Windows. - Fixed Azure package pipelines to support pools in the ADO.Net and Public projects. - Added some new pipeline variables to handle the Workload Identity Federation test.
1 parent 540c2c6 commit 6f7f621

File tree

56 files changed

+1933
-685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1933
-685
lines changed

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@
515515
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "bin", SearchOption.AllDirectories))' />
516516
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", ".nuget", SearchOption.AllDirectories))' />
517517
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "obj", SearchOption.AllDirectories))' />
518-
</Target>
518+
</Target>
519519

520520
<!-- AKV Targets ========================================================= -->
521521
<Target Name="BuildAkv">

eng/pipelines/common/templates/jobs/build-signed-package-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
# These variables are sourced from common-variables.yml.
7474
abstractionsAssemblyFileVersion: $(abstractionsAssemblyFileVersion)
7575
abstractionsPackageVersion: $(abstractionsPackageVersion)
76-
configuration: $(Configuration)
76+
buildConfiguration: $(Configuration)
7777
mdsAssemblyFileVersion: $(mdsAssemblyFileVersion)
7878
mdsPackageVersion: $(mdsPackageVersion)
7979
referenceType: Package

eng/pipelines/common/templates/jobs/ci-run-tests-job.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ parameters:
9696
type: boolean
9797
default: false
9898

99+
- name: usemanagedSNI
100+
type: boolean
101+
default: false
102+
99103
jobs:
100104
- job: ${{ format('{0}', coalesce(parameters.jobDisplayName, parameters.image, 'unknown_image')) }}
101105

eng/pipelines/common/templates/steps/ensure-dotnet-version.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
# Reason for not using UseDotNet task:
1111
# [BUG]: UseDotNet task installs x86 build on Windows arm64
1212
# https://github.com/microsoft/azure-pipelines-tasks/issues/20300
13+
#
14+
# A possible workaround is discussed here:
15+
#
16+
# https://github.com/microsoft/azure-pipelines-tasks/issues/16501
17+
#
18+
# TODO: See if we can eliminate this template and just use the above workaround
19+
# for the Windows x86 builds.
1320

1421
parameters:
1522
- # Directory where dotnet binaries should be installed. If not specified, defaults to the

eng/pipelines/common/templates/steps/update-config-file-step.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ parameters:
124124
type: boolean
125125
default: true
126126

127+
- name: WorkloadIdentityFederationServiceConnectionId
128+
type: string
129+
default: ''
130+
127131
steps:
128132
# All properties should be added here, and this template should be used for any manipulation of the config.json file.
129133
- pwsh: |
@@ -180,6 +184,7 @@ steps:
180184
$p.IsDNSCachingSupportedCR=[System.Convert]::ToBoolean("${{parameters.IsDNSCachingSupportedCR }}")
181185
$p.TracingEnabled=[System.Convert]::ToBoolean("${{parameters.TracingEnabled }}")
182186
$p.EnclaveEnabled=[System.Convert]::ToBoolean("${{parameters.EnclaveEnabled }}")
187+
$p.WorkloadIdentityFederationServiceConnectionId="${{parameters.WorkloadIdentityFederationServiceConnectionId }}"
183188
}
184189
$jdata | ConvertTo-Json | Set-Content "config.json"
185190
workingDirectory: src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities
@@ -196,4 +201,4 @@ steps:
196201
}
197202
}
198203
workingDirectory: src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities
199-
displayName: 'Read config.json [debug]'
204+
displayName: '[Debug] Read config.json'

eng/pipelines/dotnet-sqlclient-ci-core.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ parameters:
9393
type: boolean
9494
default: true
9595

96+
- name: dotnetVerbosity
97+
displayName: dotnet CLI Verbosity
98+
type: string
99+
default: normal
100+
values:
101+
- quiet
102+
- minimal
103+
- normal
104+
- detailed
105+
- diagnostic
106+
96107
variables:
97108
- template: libraries/ci-build-variables.yml@self
98109

@@ -114,11 +125,11 @@ stages:
114125
# under the given artifact name.
115126
- template: stages/build-abstractions-package-ci-stage.yml@self
116127
parameters:
117-
buildConfiguration: ${{ parameters.buildConfiguration }}
128+
abstractionsArtifactName: $(abstractionsArtifactName)
118129
abstractionsPackageVersion: $(abstractionsPackageVersion)
119-
artifactName: $(abstractionsArtifactName)
120-
${{if eq(parameters.debug, 'true')}}:
121-
verbosity: diagnostic
130+
buildConfiguration: ${{ parameters.buildConfiguration }}
131+
debug: ${{ parameters.debug }}
132+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
122133

123134
# Build MDS and its NuGet packages.
124135
- stage: build_mds_akv_packages_stage
@@ -157,25 +168,29 @@ stages:
157168
azureArtifactName: $(azureArtifactName)
158169
azurePackageVersion: $(azurePackageVersion)
159170
buildConfiguration: ${{ parameters.buildConfiguration }}
171+
debug: ${{ parameters.debug }}
172+
mdsArtifactName: $(mdsArtifactName)
173+
mdsPackageVersion: $(mdsPackageVersion)
160174
# When building via package references, we must depend on the Abstractions
161-
# package.
175+
# and MDS packages
162176
${{ if eq(parameters.referenceType, 'Package') }}:
163177
dependsOn:
164178
- build_abstractions_package_stage
179+
- build_mds_akv_packages_stage
165180
referenceType: ${{ parameters.referenceType }}
166-
${{if eq(parameters.debug, 'true')}}:
167-
verbosity: diagnostic
181+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
168182

169183
# Run the stress tests, if desired.
170184
- ${{ if eq(parameters.enableStressTests, true) }}:
171185
- template: stages/stress-tests-ci-stage.yml@self
172186
parameters:
173187
buildConfiguration: ${{ parameters.buildConfiguration }}
174-
dependsOn: [build_mds_akv_packages_stage]
188+
dependsOn:
189+
- build_mds_akv_packages_stage
190+
- build_azure_package_stage
175191
pipelineArtifactName: $(artifactName)
176192
mdsPackageVersion: $(mdsPackageVersion)
177-
${{ if eq(parameters.debug, 'true') }}:
178-
verbosity: 'detailed'
193+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
179194

180195
# Run the MDS and AKV tests.
181196
- template: common/templates/stages/ci-run-tests-stage.yml@self
@@ -190,9 +205,6 @@ stages:
190205
mdsArtifactName: $(mdsArtifactName)
191206
mdsPackageVersion: $(mdsPackageVersion)
192207
testJobTimeout: ${{ parameters.testJobTimeout }}
193-
${{ if eq(parameters.buildType, 'Package') }}:
194-
dependsOn: build_nugets
195-
196208
# When testing MDS via packages, we must depend on the Abstractions,
197209
# Azure, and MDS packages.
198210
${{ if eq(parameters.referenceType, 'Package') }}:

eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,18 @@ parameters:
149149
type: object
150150
default: [false, true]
151151

152+
# Dotnet CLI verbosity level.
153+
- name: dotnetVerbosity
154+
displayName: dotnet CLI Verbosity
155+
type: string
156+
default: normal
157+
values:
158+
- quiet
159+
- minimal
160+
- normal
161+
- detailed
162+
- diagnostic
163+
152164
extends:
153165
template: dotnet-sqlclient-ci-core.yml@self
154166
parameters:
@@ -157,6 +169,7 @@ extends:
157169
referenceType: Package
158170
codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
159171
debug: ${{ parameters.debug }}
172+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
160173
enableStressTests: ${{ parameters.enableStressTests }}
161174
targetFrameworks: ${{ parameters.targetFrameworks }}
162175
targetFrameworksLinux: ${{ parameters.targetFrameworksLinux }}

eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,18 @@ parameters:
149149
type: object
150150
default: [false, true]
151151

152+
# Dotnet CLI verbosity level.
153+
- name: dotnetVerbosity
154+
displayName: dotnet CLI Verbosity
155+
type: string
156+
default: normal
157+
values:
158+
- quiet
159+
- minimal
160+
- normal
161+
- detailed
162+
- diagnostic
163+
152164
extends:
153165
template: dotnet-sqlclient-ci-core.yml@self
154166
parameters:
@@ -157,6 +169,7 @@ extends:
157169
referenceType: Project
158170
codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
159171
debug: ${{ parameters.debug }}
172+
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
160173
enableStressTests: ${{ parameters.enableStressTests }}
161174
targetFrameworks: ${{ parameters.targetFrameworks }}
162175
targetFrameworksLinux: ${{ parameters.targetFrameworksLinux }}

eng/pipelines/jobs/pack-abstractions-package-ci-job.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,34 @@
1212

1313
parameters:
1414

15-
# The version to apply to the Abstractions NuGet package and its assemblies.
16-
- name: abstractionsPackageVersion
17-
type: string
18-
1915
# The name to apply to the published pipeline artifact.
20-
- name: artifactName
16+
- name: abstractionsArtifactName
2117
type: string
2218
default: Abstractions.Artifact
2319

20+
# The version to apply to the Abstractions NuGet package and its assemblies.
21+
- name: abstractionsPackageVersion
22+
type: string
23+
2424
# The type of build to test (Release or Debug)
2525
- name: buildConfiguration
2626
type: string
2727
values:
2828
- Release
2929
- Debug
30+
31+
# True to enable extra debug steps and logging.
32+
- name: debug
33+
type: boolean
34+
default: false
3035

3136
# The list of upstream jobs to depend on.
3237
- name: dependsOn
3338
type: object
3439
default: []
3540

3641
# The verbosity level for the dotnet CLI commands.
37-
- name: verbosity
42+
- name: dotnetVerbosity
3843
type: string
3944
default: normal
4045
values:
@@ -69,13 +74,14 @@ jobs:
6974
# dotnet CLI arguments common to all commands.
7075
- name: commonArguments
7176
value: >-
72-
--verbosity ${{ parameters.verbosity }}
77+
--verbosity ${{ parameters.dotnetVerbosity }}
7378
7479
# dotnet CLI arguments for build/test/pack commands
7580
- name: buildArguments
7681
value: >-
7782
$(commonArguments)
7883
--configuration ${{ parameters.buildConfiguration }}
84+
-p:ForceMdsAssemblyNameSuffix=true
7985
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}
8086
8187
# Explicitly unset the $PLATFORM environment variable that is set by the
@@ -102,6 +108,11 @@ jobs:
102108

103109
steps:
104110

111+
# Emit environment variables if debug is enabled.
112+
- ${{ if eq(parameters.debug, true) }}:
113+
- pwsh: 'Get-ChildItem Env: | Sort-Object Name'
114+
displayName: '[Debug] Print Environment Variables'
115+
105116
# Install the .NET 9.0 SDK.
106117
- task: UseDotNet@2
107118
displayName: Install .NET 9.0 SDK
@@ -112,18 +123,18 @@ jobs:
112123
# We use the 'custom' command because the DotNetCoreCLI@2 task doesn't
113124
# support all of our argument combinations for the different build steps.
114125

115-
# Restore the solution.
126+
# Restore the project.
116127
- task: DotNetCoreCLI@2
117-
displayName: Restore Solution
128+
displayName: Restore Project
118129
inputs:
119130
command: custom
120131
custom: restore
121132
projects: $(project)
122133
arguments: $(commonArguments)
123134

124-
# Build the solution.
135+
# Build the project.
125136
- task: DotNetCoreCLI@2
126-
displayName: Build Solution
137+
displayName: Build Project
127138
inputs:
128139
command: custom
129140
custom: build
@@ -144,5 +155,5 @@ jobs:
144155
displayName: Publish Pipeline Artifact
145156
inputs:
146157
targetPath: $(dotnetPackagesDir)
147-
artifactName: ${{ parameters.artifactName }}
158+
artifactName: ${{ parameters.abstractionsArtifactName }}
148159
publishLocation: pipeline

eng/pipelines/jobs/pack-azure-package-ci-job.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,28 @@ parameters:
4040
values:
4141
- Release
4242
- Debug
43+
44+
# True to enable extra debug steps and logging.
45+
- name: debug
46+
type: boolean
47+
default: false
4348

4449
# The list of upstream jobs to depend on.
4550
- name: dependsOn
4651
type: object
4752
default: []
4853

54+
# The verbosity level for the dotnet CLI commands.
55+
- name: dotnetVerbosity
56+
type: string
57+
default: normal
58+
values:
59+
- quiet
60+
- minimal
61+
- normal
62+
- detailed
63+
- diagnostic
64+
4965
# The reference type to use:
5066
#
5167
# Project - dependent projects are referenced directly.
@@ -57,17 +73,6 @@ parameters:
5773
- Package
5874
- Project
5975

60-
# The verbosity level for the dotnet CLI commands.
61-
- name: verbosity
62-
type: string
63-
default: normal
64-
values:
65-
- quiet
66-
- minimal
67-
- normal
68-
- detailed
69-
- diagnostic
70-
7176
jobs:
7277

7378
- job: pack_azure_package_job
@@ -93,8 +98,9 @@ jobs:
9398
# dotnet CLI arguments common to all commands.
9499
- name: commonArguments
95100
value: >-
96-
--verbosity ${{ parameters.verbosity }}
101+
--verbosity ${{ parameters.dotnetVerbosity }}
97102
-p:ReferenceType=${{ parameters.referenceType }}
103+
-p:ForceMdsAssemblyNameSuffix=true
98104
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}
99105
100106
# dotnet CLI arguments for build/test/pack commands
@@ -128,6 +134,11 @@ jobs:
128134

129135
steps:
130136

137+
# Emit environment variables if debug is enabled.
138+
- ${{ if eq(parameters.debug, true) }}:
139+
- pwsh: 'Get-ChildItem Env: | Sort-Object Name'
140+
displayName: '[Debug] Print Environment Variables'
141+
131142
# We have a few extra steps for Package reference builds.
132143
- ${{ if eq(parameters.referenceType, 'Package') }}:
133144

@@ -152,18 +163,18 @@ jobs:
152163
# We use the 'custom' command because the DotNetCoreCLI@2 task doesn't
153164
# support all of our argument combinations for the different build steps.
154165

155-
# Restore the solution.
166+
# Restore the project.
156167
- task: DotNetCoreCLI@2
157-
displayName: Restore Solution
168+
displayName: Restore Project
158169
inputs:
159170
command: custom
160171
custom: restore
161172
projects: $(project)
162173
arguments: $(commonArguments)
163174

164-
# Build the solution.
175+
# Build the project.
165176
- task: DotNetCoreCLI@2
166-
displayName: Build Solution
177+
displayName: Build Project
167178
inputs:
168179
command: custom
169180
custom: build

0 commit comments

Comments
 (0)