@@ -19,7 +19,8 @@ variables:
19
19
value : ' 16.x'
20
20
- name : ' publisher'
21
21
value : ' Marketplace'
22
-
22
+ - name : ' marketplaceServiceConnection'
23
+ value : ' 24325a98-0d4b-4180-9936-c930a4156258'
23
24
24
25
stages :
25
26
- stage : ' Build'
@@ -138,11 +139,22 @@ stages:
138
139
version : $(tfxVersion)
139
140
checkLatest : true
140
141
142
+ - task : AzureCLI@2
143
+ displayName : ' Authenticate with Service Principal'
144
+ inputs :
145
+ azureSubscription : ' azure-devops-marketplace'
146
+ scriptType : ' pscore'
147
+ scriptLocation : ' inlineScript'
148
+ inlineScript : |
149
+ $accessToken = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv
150
+ write-host "##vso[task.setsecret]$accessToken"
151
+ write-host "##vso[task.setendpoint id=$env:MARKETPLACESERVICECONNECTION;field=authParameter;key=password]$accessToken"
152
+
141
153
- task : PublishAzureDevOpsExtension@4
142
154
name : ' publishDev'
143
155
inputs :
144
156
connectTo : ' VsTeam'
145
- connectedServiceName : ' Jesse Houwing '
157
+ connectedServiceName : ' $(marketplaceServiceConnection) '
146
158
fileType : ' vsix'
147
159
vsixFile : ' $(Pipeline.Workspace)/vsix/$(extensionId).vsix'
148
160
publisherId : ' jessehouwing'
@@ -156,7 +168,7 @@ stages:
156
168
- task : IsAzureDevOpsExtensionValid@4
157
169
inputs :
158
170
connectTo : ' VsTeam'
159
- connectedServiceName : ' Jesse Houwing '
171
+ connectedServiceName : ' $(marketplaceServiceConnection) '
160
172
method : ' vsix'
161
173
vsixFile : ' $(publishDev.Extension.OutputPath)'
162
174
@@ -192,11 +204,22 @@ stages:
192
204
version : $(tfxVersion)
193
205
checkLatest : true
194
206
207
+ - task : AzureCLI@2
208
+ displayName : ' Authenticate with Service Principal'
209
+ inputs :
210
+ azureSubscription : ' azure-devops-marketplace'
211
+ scriptType : ' pscore'
212
+ scriptLocation : ' inlineScript'
213
+ inlineScript : |
214
+ $accessToken = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv
215
+ write-host "##vso[task.setsecret]$accessToken"
216
+ write-host "##vso[task.setendpoint id=$env:MARKETPLACESERVICECONNECTION;field=authParameter;key=password]$accessToken"
217
+
195
218
- task : PublishAzureDevOpsExtension@4
196
219
name : ' publishProd'
197
220
inputs :
198
221
connectTo : ' VsTeam'
199
- connectedServiceName : ' Jesse Houwing '
222
+ connectedServiceName : ' $(marketplaceServiceConnection) '
200
223
fileType : ' vsix'
201
224
vsixFile : ' $(Pipeline.Workspace)/vsix/$(extensionId).vsix'
202
225
publisherId : ' jessehouwing'
@@ -208,7 +231,7 @@ stages:
208
231
- task : IsAzureDevOpsExtensionValid@4
209
232
inputs :
210
233
connectTo : ' VsTeam'
211
- connectedServiceName : ' Jesse Houwing '
234
+ connectedServiceName : ' $(marketplaceServiceConnection) '
212
235
method : ' vsix'
213
236
vsixFile : ' $(publishProd.Extension.OutputPath)'
214
237
0 commit comments