Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Skip missing blob container properties
  • Loading branch information
benbp authored and azure-sdk committed Nov 6, 2024
commit 4423bc280466390fdb4c16f5a441f60ec3959a02
5 changes: 4 additions & 1 deletion eng/common/scripts/Helpers/Resource-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ function RemoveStorageAccount($Account) {
}

foreach ($container in $containers) {
if (!($container | Get-Member 'BlobContainerProperties')) {
continue
}
if ($container.BlobContainerProperties.HasImmutableStorageWithVersioning) {
try {
# Use AzRm cmdlet as deletion will only work through ARM with the immutability policies defined on the blobs
Expand Down Expand Up @@ -395,7 +398,7 @@ function EnableBlobDeletion($Blob, $Container, $StorageAccountName, $ResourceGro
$Blob.ICloudBlob.BreakLease()
}

if ($container.BlobContainerProperties.HasImmutableStorageWithVersioning) {
if (($container | Get-Member 'BlobContainerProperties') -and $container.BlobContainerProperties.HasImmutableStorageWithVersioning) {
$forceBlobDeletion = $true
}

Expand Down