Q. How can I delete all snapshots for a blob?

A. To quickly delete all snapshots for a blob, for example a VHD, run the following PowerShell. Make sure you replace the file name, resource group and storage account variables.

$Container = 'vhds'
$VHDName = 'DummyVM201656141318.vhd'
$AzStorAccName = 'savtechsalrsscus'
$AzResGroup = 'rg-scusa'
$AzStrKey = Get-AzureRmStorageAccountKey -Name $AzStorAccName -ResourceGroupName $AzResGroup
$AzStrCtx = New-AzureStorageContext $AzStorAccName -StorageAccountKey $AzStrKey[0].Value

$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()
}