Skip to content

Commit c1b565b

Browse files
Use work load identity service connection to download makeappx tool from storage account (#24817) (#24820)
Co-authored-by: Aditya Patwardhan <[email protected]>
1 parent 4b3f794 commit c1b565b

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

.pipelines/templates/release-create-msix.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,24 @@ jobs:
2828
displayName: Download x86 msix
2929
patterns: '**/*.msix'
3030

31-
- pwsh: |
32-
$cmd = Get-Command makeappx.exe -ErrorAction Ignore
33-
if ($cmd) {
34-
Write-Verbose -Verbose 'makeappx available in PATH'
35-
$exePath = $cmd.Source
36-
} else {
37-
$toolsDir = '$(Pipeline.Workspace)\releasePipeline\tools'
38-
New-Item $toolsDir -Type Directory -Force > $null
39-
Invoke-RestMethod -Uri '$(makeappUrl)' -OutFile "$toolsDir\makeappx.zip"
40-
Expand-Archive "$toolsDir\makeappx.zip" -DestinationPath "$toolsDir\makeappx" -Force
41-
$exePath = "$toolsDir\makeappx\makeappx.exe"
42-
43-
Write-Verbose -Verbose 'makeappx was installed:'
44-
Get-ChildItem -Path $toolsDir -Recurse
45-
}
46-
47-
$vstsCommandString = "vso[task.setvariable variable=MakeAppxPath]$exePath"
48-
Write-Host "sending " + $vstsCommandString
49-
Write-Host "##$vstsCommandString"
31+
- task: AzurePowerShell@5
5032
displayName: Install makeappx tool
5133
retryCountOnTaskFailure: 1
34+
inputs:
35+
azureSubscription: az-blob-cicd-infra
36+
scriptType: inlineScript
37+
azurePowerShellVersion: LatestVersion
38+
pwsh: true
39+
inline: |
40+
$toolsDir = '$(Pipeline.Workspace)\releasePipeline\tools'
41+
New-Item $toolsDir -Type Directory -Force > $null
42+
Invoke-RestMethod -Uri '$(makeappUrlDirect)' -OutFile "$toolsDir\makeappx.zip"
43+
Expand-Archive "$toolsDir\makeappx.zip" -DestinationPath "$toolsDir\makeappx" -Force
44+
$exePath = "$toolsDir\makeappx\makeappx.exe"
45+
46+
$vstsCommandString = "vso[task.setvariable variable=MakeAppxPath]$exePath"
47+
Write-Host "sending " + $vstsCommandString
48+
Write-Host "##$vstsCommandString"
5249
5350
- pwsh: |
5451
$sourceDir = '$(Pipeline.Workspace)\releasePipeline\msix'

0 commit comments

Comments
 (0)