@@ -125,11 +125,19 @@ extends:
125
125
displayName : Install Rust
126
126
env :
127
127
ob_restore_phase : true
128
- - task : CargoAuthenticate@0
128
+ - task : AzureCLI@2
129
129
inputs :
130
- configFile : " $(Build.SourcesDirectory)/DSC/.cargo/config.toml"
131
- cargoServiceConnections : azDO-Cargo-PowerShell-feed-Ingestion
132
- displayName : Authenticating cargo crates registry
130
+ azureSubscription : az-PowerShell-feed-ingestion
131
+ scriptType : ' pscore'
132
+ scriptLocation : ' inlineScript'
133
+ inlineScript : |
134
+ $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
135
+
136
+ # Set the access token as a secret, so it doesn't get leaked in the logs
137
+ Write-Host "##vso[task.setsecret]$accessToken"
138
+ $header = "Bearer $accessToken"
139
+ Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN;issecret=true]$header"
140
+ displayName : ' Get Azure DevOps Token'
133
141
env :
134
142
ob_restore_phase : true
135
143
- pwsh : |
@@ -261,7 +269,7 @@ extends:
261
269
262
270
# Set the access token as a secret, so it doesn't get leaked in the logs
263
271
Write-Host "##vso[task.setsecret]$accessToken"
264
- $header = Bearer $accessToken
272
+ $header = " Bearer $accessToken"
265
273
Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN;issecret=true]$header"
266
274
displayName : ' Get Azure DevOps Token'
267
275
env :
@@ -305,7 +313,7 @@ extends:
305
313
306
314
# Set the access token as a secret, so it doesn't get leaked in the logs
307
315
Write-Host "##vso[task.setsecret]$accessToken"
308
- $header = Bearer $accessToken
316
+ $header = " Bearer $accessToken"
309
317
Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN;issecret=true]$header"
310
318
displayName : ' Get Azure DevOps Token'
311
319
env :
@@ -347,11 +355,19 @@ extends:
347
355
displayName : Install Rust
348
356
env :
349
357
ob_restore_phase : true
350
- - task : CargoAuthenticate@0
358
+ - task : AzureCLI@2
351
359
inputs :
352
- configFile : " .cargo/config.toml"
353
- cargoServiceConnections : azDO-Cargo-PowerShell-feed-Ingestion
354
- displayName : Authenticating cargo crates registry
360
+ azureSubscription : az-PowerShell-feed-ingestion
361
+ scriptType : ' pscore'
362
+ scriptLocation : ' inlineScript'
363
+ inlineScript : |
364
+ $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
365
+
366
+ # Set the access token as a secret, so it doesn't get leaked in the logs
367
+ Write-Host "##vso[task.setsecret]$accessToken"
368
+ $header = "Bearer $accessToken"
369
+ Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN;issecret=true]$header"
370
+ displayName : ' Get Azure DevOps Token'
355
371
env :
356
372
ob_restore_phase : true
357
373
- pwsh : |
0 commit comments