I've recently been learning Azure Resource Manager template based deployment, and as a result I am deploying and removing a lot of VMs as I refine my ResourceManager templates. I have made a PowerShell script to delete a given VM,LoadBalancer,PublicIPAddress,NetworkInterface,etc but I can't find an equivalent cmdlet for removing a VHD / blob / from an AzureRM Storage account.
Is there an AzureRM PowerShell way to delete a VHD file stored in an Azure ResourceManager Storage account? Or is this yet to be implemented? If not, are there any command line alternatives such as Azure CLI or a workaround?
I've looked at:
Get-Command -Module AzureRM.Storage
This shows:
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Get-AzureRmStorageAccount 1.1.3 AzureRm.Storage
Cmdlet Get-AzureRmStorageAccountKey 1.1.3 AzureRm.Storage
Cmdlet Get-AzureRmStorageAccountNameAvailability 1.1.3 AzureRm.Storage
Cmdlet Get-AzureRmStorageUsage 1.1.3 AzureRm.Storage
Cmdlet New-AzureRmStorageAccount 1.1.3 AzureRm.Storage
Cmdlet New-AzureRmStorageAccountKey 1.1.3 AzureRm.Storage
Cmdlet Remove-AzureRmStorageAccount 1.1.3 AzureRm.Storage
Cmdlet Set-AzureRmCurrentStorageAccount 1.1.3 AzureRm.Storage
Cmdlet Set-AzureRmStorageAccount 1.1.3 AzureRm.Storage
... which doesn't have what I want. The closest would be adding and removing an entire storage account, but since I'm deploying from a custom template I believe I am limited to storing the VM VHD in the same storage account as the template (please correct me if I'm wrong). By contrast, the Azure.Storage module has *StorageFile/Blob/Container cmdlets. Given I see classic Azure cmdlets that sound like what I want, but no AzureRM equivalents, I suspect the answer is "no" for the moment.
For reference, I'm running Windows 10, and have installed the latest AzureRM PowerShell module from the PowerShell Gallery within the past couple of weeks (AzureRM Module 1.6.0, AzureRM.Storage 1.1.3)