Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Upload VHD to Azure Blob Storage
# Variables
$storageaccount = 'mystorageaccount'
$vhdpath = 'c:\users\darrenjrobinson\vhds\WindowsVM.vhd'
$BlobName = 'WinXP.vhd'
# Login
Login-AzureRMAccount
Get-AzureRmStorageAccount | select storageaccountname
# Get Storage Account
$storageContainer = Get-AzureRmStorageAccount | where {$_.StorageAccountName -eq $storageaccount} | Get-AzureStorageContainer
# Upload VHD
$storageContainer | Set-AzureStorageBlobContent –File $vhdpath –Blob $BlobName -BlobType Page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.