Skip to content

Commit

Permalink
Delete the msix blob if it's already there (#24353) (#24516)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan authored Oct 31, 2024
1 parent c22f576 commit 3c2d60e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .pipelines/templates/release-create-msix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,14 @@ jobs:
if ($env:BundleDir) {
$bundleFile = Get-Item "$env:BundleDir\*.msixbundle"
$blobName = $bundleFile | Split-Path -Leaf
$existing = Get-AzStorageBlob -Container $containerName -Blob $blobName -Context $storageContext -ErrorAction Ignore
if ($existing) {
Write-Verbose -Verbose "MSIX bundle already exists at '$storageAccount/$containerName/$blobName', removing first."
$existingBlob | Remove-AzStorageBlob -ErrorAction Stop -Verbose
}
Write-Verbose -Verbose "Uploading $bundleFile to $containerName/$blobName"
Set-AzStorageBlobContent -File $bundleFile -Container $containerName -Blob $blobName -Context $storageContext
Set-AzStorageBlobContent -File $bundleFile -Container $containerName -Blob $blobName -Context $storageContext -Force
}
else{
throw "BundleDir not found"
Expand Down

0 comments on commit 3c2d60e

Please sign in to comment.