1+ # parameters:
2+ # - name: PackagesPath
3+ # type: string
4+ # default: ''
5+
6+ # steps:
7+ # - checkout: self
8+ # clean: true
9+ # fetchDepth: 1
10+
11+ # - task: UseDotNet@2
12+ # displayName: 'Use .NET Core sdk (for code signing)'
13+ # inputs:
14+ # packageType: sdk
15+ # version: 3.1.x
16+
17+ # # Expand packages as zip
18+ # - task: PowerShell@2
19+ # displayName: 'Expand nuget packages'
20+ # inputs:
21+ # packagePath: filePath
22+ # filePath: '$(Build.SourcesDirectory)/.azdo/pipelines/scripts/ExpandNugetPackages.ps1'
23+ # arguments: '-packagePath "${{ parameters.PackagesPath }}"'
24+ # Write-Host "Pattern: $(${{ parameters.PackagesPath }})"
25+
26+ # - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
27+ # displayName: 'ESRP CodeSigning - Sign Package DLLs'
28+ # inputs:
29+ # ConnectedServiceName: 'Code_Signing'
30+ # AppRegistrationClientId: '83032b7a-1253-4736-84b0-3899f3b0cfa1'
31+ # AppRegistrationTenantId: '33e01921-4d64-4f8c-a055-5bdaffd5e33d'
32+ # AuthAKVName: 'kv-toolkit-202506232024'
33+ # AuthCertName: 'test-toolkit-cert-2025'
34+ # AuthSignCertName: 'test-toolkit-cert-2025'
35+ # FolderPath: '${{ parameters.PackagesPath }}'
36+ # Pattern: 'Microsoft.AzureHealth.DataServices.*.dll,Microsoft.Capl.*.dll'
37+ # SessionTimeout: 90
38+ # ServiceEndpointUrl: 'https://api.esrp.microsoft.com/api/v2'
39+ # MaxConcurrency: 25
40+ # UseMSIAuthentication: true
41+ # signConfigType: 'inlineSignParams'
42+ # inlineOperation: |
43+ # [
44+ # {
45+ # "keyCode": "CP-230012",
46+ # "operationCode": "SigntoolSign",
47+ # "parameters": [
48+ # {
49+ # "parameterName": "OpusName",
50+ # "parameterValue": "Microsoft"
51+ # },
52+ # {
53+ # "parameterName": "OpusInfo",
54+ # "parameterValue": "http://www.microsoft.com"
55+ # },
56+ # {
57+ # "parameterName": "PageHash",
58+ # "parameterValue": "/NPH"
59+ # },
60+ # {
61+ # "parameterName": "FileDigest",
62+ # "parameterValue": "/fd sha256"
63+ # },
64+ # {
65+ # "parameterName": "TimeStamp",
66+ # "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
67+ # }
68+ # ],
69+ # "toolName": "sign",
70+ # "toolVersion": "1.0"
71+ # },
72+ # {
73+ # "keyCode": "CP-230012",
74+ # "operationCode": "SigntoolVerify",
75+ # "parameters": [ ],
76+ # "toolName": "sign",
77+ # "toolVersion": "1.0"
78+ # }
79+ # ]
80+ # # Repackage with signed dlls
81+ # - task: PowerShell@2
82+ # displayName: 'Repack nuget packages'
83+ # inputs:
84+ # packagePath: filePath
85+ # filePath: '$(Build.SourcesDirectory)/.azdo/pipelines/scripts/RepackNugetPackages.ps1'
86+ # arguments: '-packageFolderPath "${{ parameters.PackagesPath }}" -signedPath "${{ parameters.PackagesPath }}-signed"'
87+
88+ # - task: CopyFiles@2
89+ # displayName: 'Copy symbols'
90+ # inputs:
91+ # sourceFolder: ${{ parameters.PackagesPath }}
92+ # contents: '*.snupkg'
93+ # targetFolder: ${{ parameters.PackagesPath }}-signed
94+
95+ # # Sign Packages
96+ # - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
97+ # displayName: 'ESRP CodeSigning - Sign Nuget Packages'
98+ # inputs:
99+ # ConnectedServiceName: 'Code_Signing'
100+ # AppRegistrationClientId: '83032b7a-1253-4736-84b0-3899f3b0cfa1'
101+ # AppRegistrationTenantId: '33e01921-4d64-4f8c-a055-5bdaffd5e33d'
102+ # AuthAKVName: 'kv-toolkit-202506232024'
103+ # AuthCertName: 'test-toolkit-cert-2025'
104+ # AuthSignCertName: 'test-toolkit-cert-2025'
105+ # FolderPath: '${{ parameters.PackagesPath }}-signed/'
106+ # Pattern: 'Microsoft.AzureHealth.DataServices*.nupkg,Microsoft.Capl*.nupkg'
107+ # SessionTimeout: 90
108+ # ServiceEndpointUrl: 'https://api.esrp.microsoft.com/api/v2'
109+ # MaxConcurrency: 25
110+ # signConfigType: 'inlineSignParams'
111+ # UseMSIAuthentication: true
112+ # inlineOperation: |
113+ # [
114+ # {
115+ # "keyCode": "CP-401405",
116+ # "operationCode": "NuGetSign",
117+ # "parameters": [ ],
118+ # "toolName": "sign",
119+ # "toolVersion": "1.0"
120+ # },
121+ # {
122+ # "keyCode": "CP-401405",
123+ # "operationCode": "NuGetVerify",
124+ # "parameters": [ ],
125+ # "toolName": "sign",
126+ # "toolVersion": "1.0"
127+ # }
128+ # ]
129+
1130parameters :
2131- name : PackagesPath
3132 type : string
@@ -23,8 +152,9 @@ steps:
23152 arguments : ' -packagePath "${{ parameters.PackagesPath }}"'
24153 Write-Host "Pattern : $(${{ parameters.PackagesPath }})"
25154
155+ # ESRP CodeSigning - Sign Package DLLs in batches to avoid operationSet code length exceeded error
26156- task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
27- displayName : ' ESRP CodeSigning - Sign Package DLLs'
157+ displayName : ' ESRP CodeSigning - Sign Package DLLs Batch 1 '
28158 inputs :
29159 ConnectedServiceName : ' Code_Signing'
30160 AppRegistrationClientId : ' 83032b7a-1253-4736-84b0-3899f3b0cfa1'
@@ -33,7 +163,7 @@ steps:
33163 AuthCertName : ' test-toolkit-cert-2025'
34164 AuthSignCertName : ' test-toolkit-cert-2025'
35165 FolderPath : ' ${{ parameters.PackagesPath }}'
36- Pattern : ' Microsoft.AzureHealth.DataServices.* .dll,Microsoft.Capl.* .dll'
166+ Pattern : ' Microsoft.AzureHealth.DataServices.Caching .dll,Microsoft.AzureHealth.DataServices.Channels.dll,Microsoft.AzureHealth.DataServices.Core .dll'
37167 SessionTimeout : 90
38168 ServiceEndpointUrl : ' https://api.esrp.microsoft.com/api/v2'
39169 MaxConcurrency : 25
@@ -77,6 +207,62 @@ steps:
77207 "toolVersion": "1.0"
78208 }
79209 ]
210+
211+ - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
212+ displayName : ' ESRP CodeSigning - Sign Package DLLs Batch 2'
213+ inputs :
214+ ConnectedServiceName : ' Code_Signing'
215+ AppRegistrationClientId : ' 83032b7a-1253-4736-84b0-3899f3b0cfa1'
216+ AppRegistrationTenantId : ' 33e01921-4d64-4f8c-a055-5bdaffd5e33d'
217+ AuthAKVName : ' kv-toolkit-202506232024'
218+ AuthCertName : ' test-toolkit-cert-2025'
219+ AuthSignCertName : ' test-toolkit-cert-2025'
220+ FolderPath : ' ${{ parameters.PackagesPath }}'
221+ Pattern : ' Microsoft.AzureHealth.DataServices.Storage.dll,Microsoft.Capl.Core.dll'
222+ SessionTimeout : 90
223+ ServiceEndpointUrl : ' https://api.esrp.microsoft.com/api/v2'
224+ MaxConcurrency : 25
225+ UseMSIAuthentication : true
226+ signConfigType : ' inlineSignParams'
227+ inlineOperation : |
228+ [
229+ {
230+ "keyCode": "CP-230012",
231+ "operationCode": "SigntoolSign",
232+ "parameters": [
233+ {
234+ "parameterName": "OpusName",
235+ "parameterValue": "Microsoft"
236+ },
237+ {
238+ "parameterName": "OpusInfo",
239+ "parameterValue": "http://www.microsoft.com"
240+ },
241+ {
242+ "parameterName": "PageHash",
243+ "parameterValue": "/NPH"
244+ },
245+ {
246+ "parameterName": "FileDigest",
247+ "parameterValue": "/fd sha256"
248+ },
249+ {
250+ "parameterName": "TimeStamp",
251+ "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
252+ }
253+ ],
254+ "toolName": "sign",
255+ "toolVersion": "1.0"
256+ },
257+ {
258+ "keyCode": "CP-230012",
259+ "operationCode": "SigntoolVerify",
260+ "parameters": [ ],
261+ "toolName": "sign",
262+ "toolVersion": "1.0"
263+ }
264+ ]
265+
80266# Repackage with signed dlls
81267- task : PowerShell@2
82268 displayName : ' Repack nuget packages'
0 commit comments