Q. How can I delete Blob snapshots in an Azure Storage Account?
A. The PowerShell below finds all snapshots for a specific blob name and then enumerates the snapshots and deletes them all. You could change this to match your own requirements.
#Define variables for the storage context ($AzStrCtx), the container ($Container) and blob name ($VHDName)
$VMsnaps = Get-AzureStorageBlob –Context $AzStrCtx -Container $Container | Where-Object {$_.ICloudBlob.IsSnapshot -and $_.Name -eq $VHDName -and $_.SnapshotTime -ne $null }
foreach($VMSnap in $VMsnaps)
{
$VMSnap.ICloudBlob.Delete()
}
0 comments
Hide comments