Skip to content

Commit

Permalink
chore: better logging of azcopy output (#5634)
Browse files Browse the repository at this point in the history
  • Loading branch information
timmy-wright authored Jan 23, 2025
1 parent 41a38a4 commit 989219b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion vhdbuilder/packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,22 @@ function Download-FileWithAzCopy {
pushd "$global:aksTempDir"
$env:AZCOPY_JOB_PLAN_LOCATION="$global:aksTempDir\azcopy"
$env:AZCOPY_LOG_LOCATION="$global:aksTempDir\azcopy"

mkdir -Force $env:AZCOPY_LOG_LOCATION
if (Test-Path -Path "$env:AZCOPY_LOG_LOCATION\*.log" ) {
rm -Force "$env:AZCOPY_LOG_LOCATION\*.log"
}

Write-Log "Logging in to AzCopy"
# user_assigned_managed_identities has been bound in vhdbuilder/packer/windows-vhd-builder-sig.json
.\azcopy.exe login --login-type=MSI
.\azcopy.exe copy $URL $Dest

Write-Log "Copying $URL to $Dest"
.\azcopy.exe copy "$URL" "$Dest"

Write-Log "--- START AzCopy Log"
Get-Content "$env:AZCOPY_LOG_LOCATION\*.log" | Write-Log
Write-Log "--- END AzCopy Log"
popd
}

Expand Down

0 comments on commit 989219b

Please sign in to comment.