From e3db5cb3598196ac1a73bbd6864788250214c8fa Mon Sep 17 00:00:00 2001 From: Patrick Meinecke Date: Mon, 14 Oct 2024 17:11:13 -0400 Subject: [PATCH] Delete the msix blob if it's already there (#24353) --- .pipelines/templates/release-create-msix.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.pipelines/templates/release-create-msix.yml b/.pipelines/templates/release-create-msix.yml index 89f2e7b5a2c..448a46c1194 100644 --- a/.pipelines/templates/release-create-msix.yml +++ b/.pipelines/templates/release-create-msix.yml @@ -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"