| applyTo | eng/pipelines/**/*.yml |
|---|
Rules and conventions for editing the OneBranch Azure DevOps YAML pipelines that build, sign, package, and release six NuGet packages with interdependencies.
sqlclient-official.yml— Official pipeline; usesOneBranch.Official.CrossPlat.yml; CI trigger oninternal/main+ daily schedule at 04:30 UTCsqlclient-non-official.yml— Non-Official pipeline; usesOneBranch.NonOfficial.CrossPlat.yml; manual only (pr: none,trigger: none)- Both live under
eng/pipelines/onebranch/and extend OneBranch governed templates - Never parameterize the OneBranch template name — hardcode it per pipeline for PRC compliance
- Official pipeline must never be run on PRs or dev branches.
Respect this graph when modifying build stages:
Microsoft.SqlServer.Server— no dependenciesMicrosoft.Data.SqlClient.Internal.Logging— no dependenciesMicrosoft.Data.SqlClient.Extensions.Abstractions— depends on LoggingMicrosoft.Data.SqlClient— depends on Logging + AbstractionsMicrosoft.Data.SqlClient.Extensions.Azure— depends on Abstractions + LoggingMicrosoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider— depends on SqlClient + Abstractions + Logging
Defined in stages/build-stages.yml. Four build stages plus validation, ordered by dependency:
build_independent(Stage 1) — Logging and SqlServer.Server in parallel; no inter-package dependenciesbuild_abstractions(Stage 2) — Abstractions;dependsOn: build_independent; downloads Logging artifactbuild_dependent(Stage 3) — SqlClient and Extensions.Azure in parallel;dependsOn: build_abstractions; downloads Abstractions + Logging artifactsbuild_addons(Stage 4) — AKV Provider;dependsOn: build_dependent; downloads SqlClient + Abstractions + Logging artifactssqlclient_package_validation— Validates signed SqlClient package;dependsOn: build_dependent; runs in parallel with Stage 4
Each build job copies PDB files into $(JOB_OUTPUT)/symbols/ so they are included in the auto-published pipeline artifact alongside the NuGet packages in $(JOB_OUTPUT)/packages/.
Stage conditional rules:
- Wrap stages/jobs in
${{ if }}compile-time conditionals based on build parameters buildSqlClientcontrols Stages 2, 3, validation, and Logging (when AKV is disabled)buildAKVProvider AND buildSqlClientcontrols Stage 4buildSqlServerServercontrols SqlServer.Server job in Stage 1- Logging builds when
buildAKVProvider OR buildSqlClientis true
build-buildproj-job.yml— Shared build.proj-driven package job used for all shipped packages. Flow: build viabuild.proj→ optional ESRP DLL signing → pack viabuild.proj→ optional ESRP NuGet signing → copy outputs for APIScan/artifactsvalidate-signed-package-job.yml— Validates signed MDS package (signature, strong names, folder structure, target frameworks)publish-nuget-package-job.yml— Reusable release job using OneBranchtemplateContext.type: releaseJobwithinputsfor artifact download; pushes viaNuGetCommand@2publish-symbols-job.yml— Reusable symbols job: downloads a build artifact, locates PDBs undersymbols/, and invokespublish-symbols-step.yml
When adding a new package to the OneBranch flow:
- Extend
build-buildproj-job.ymlinputs with the new package metadata and dependency artifacts - Add or update the corresponding build/pack targets in
build.proj - Add version variables to
variables/common-variables.yml - Add artifact name variables to
variables/onebranch-variables.yml
- Defined in
stages/publish-symbols-stage.yml; produces stagepublish_symbols - Entire stage excluded at compile time when
publishSymbolsis false dependsOnis conditional based on whichbuild*parameters are set, mirroring the build stage dependency graph- One job per package (
publish-symbols-job.yml), each downloading its build artifact and publishing PDBs fromsymbols/ - Each package's PDBs are published separately with unique artifact names and version information
- Build jobs copy PDBs into
$(JOB_OUTPUT)/symbols/so they are included in the auto-published artifact - The
publish-symbols-step.ymlaccepts asymbolsFolderparameter to point at the downloaded PDB location - The publish step calls an extracted
publish-symbols.ps1script with structured error handling and diagnostic logging - Symbols publishing credentials come from the
Symbols Publishingvariable group - In the official pipeline, symbol server destination follows
releaseToProduction: Production when true, PPE when false - Non-official pipeline always targets the PPE symbol server
- Defined in
stages/release-stages.yml; produces stagerelease_production(official) orrelease_test(non-official) viastageNameSuffixparameter - Entire stage excluded at compile time when no release parameters are true
dependsOnis conditional based on which release parameters are setreleaseToProductionparameter controls NuGet target feed:true→ service connectionADO Nuget Org Connection(NuGet Production)false→ service connectionADO Nuget Org Test Connection(NuGet Test)
- Non-official pipeline always sets
releaseToProduction: false - Environment gating:
- Official:
ob_release_environment: Production,ob_deploymentjob_environment: NuGet-Production - Non-official:
ob_release_environment: Test,ob_deploymentjob_environment: NuGet-DryRun
- Official:
- Each publish job uses OneBranch deployment job syntax (
templateContext.type: releaseJobwithinputsfor artifact download)
Build parameters (all boolean, default true):
debug— enable debug output (defaultfalse)isPreview— use preview version numbers (defaultfalse)publishSymbols— publish symbols to servers (defaultfalse)buildSqlServerServer— build SqlServer.Server packagebuildSqlClient— build SqlClient, Extensions.Azure, Abstractions, and LoggingbuildAKVProvider— build AKV Provider (requiresbuildSqlClient)
Release parameters (all boolean, default false):
releaseSqlServerServer,releaseLogging,releaseAbstractions,releaseSqlClient,releaseAzure,releaseAKVProvider
Official-only parameter:
releaseToProduction— controls both NuGet target feed and symbol server destination (defaultfalse):true→ NuGet Production feed + Production symbol serverfalse→ NuGet Test feed + PPE symbol server
When isPreview is true, pipeline resolves effective*Version variables to preview versions; otherwise GA versions. All versions defined in variables/common-variables.yml.
- Variable chain: pipeline YAML →
variables/onebranch-variables.yml→variables/common-variables.yml - All package versions (GA, preview, assembly file) centralized in
variables/common-variables.yml effective*Versionpipeline variables map to selected version set based onisPreview- Artifact name variables defined in
variables/onebranch-variables.ymlfollowingdrop_<stageName>_<jobName>pattern assemblyBuildNumberderived from first segment ofBuild.BuildNumberonly (16-bit limit)- When adding a new package, add GA version, preview version, and assembly file version entries
Variable groups:
Symbols Publishing— symbol publishing credentials (inonebranch-variables.yml)ESRP Federated Creds (AME)— ESRP signing credentials (incommon-variables.yml)
- Uses ESRP v6 tasks (
EsrpMalwareScanning@6,EsrpCodeSigning@6) with MSI/federated identity authentication - Signing only runs when
isOfficial: true— non-official pipelines skip ESRP steps - The shared OneBranch job signs DLLs before packing and signs the resulting NuGet package afterward so the published package contains signed binaries
- DLL signing uses keyCode
CP-230012(Authenticode); NuGet signing uses keyCodeCP-401405 - All ESRP credentials come from variable groups — never hardcode secrets in YAML
- TSA: enabled only in official pipeline; disabled in non-official to avoid spurious alerts
- ApiScan: enabled in both; currently
break: falsepending package registration - Each build job sets
ob_sdl_apiscan_softwareFolderto$(JOB_OUTPUT)/assembliesandob_sdl_apiscan_symbolsFolderto$(JOB_OUTPUT)/symbols - CodeQL, SBOM, Policheck (
break: true): enabled in both pipelines - asyncSdl
enabled: falsein both; individual sub-tools (CredScan, BinSkim, Armory, Roslyn) configured underneath - Policheck exclusions:
$(REPO_ROOT)\.config\PolicheckExclusions.xml - CredScan suppressions:
$(REPO_ROOT)/.config/CredScanSuppressions.json
ob_outputDirectoryset to$(JOB_OUTPUT)(=$(REPO_ROOT)/output) — OneBranch auto-publishes this directory- Each published artifact uses subdirectories to separate file types:
assemblies/— DLL assemblies for APIScan (preserving TFM folder structure)packages/— NuGet packages (.nupkg,.snupkg)symbols/— PDB symbol files (preserving TFM folder structure, shared by APIScan and symbol publishing)
- Artifact names follow
drop_<stageName>_<jobName>— defined invariables/onebranch-variables.yml - Downstream jobs download artifacts via
DownloadPipelineArtifact@2into$(Build.SourcesDirectory)/packages - Downloaded packages serve as a local NuGet source for
dotnet restore - If stage or job names change, update artifact name variables in
onebranch-variables.yml
- Do not use
PublishPipelineArtifactstask — OneBranch auto-publishes fromob_outputDirectory - Do not add
NuGetToolInstaller@1in OneBranch containers — NuGet is pre-installed - Variable templates are under
variables/notlibraries/ - Always test parameter changes in the non-official pipeline first
- When modifying stage names, update all
dependsOnreferences and artifact name variables - Release jobs must use
templateContext.type: releaseJobwithinputsfor artifact download — deployment jobs do not auto-download artifacts