I am trying to add a VHD image from my local filesystem to Azure BLOB storage. Whenever I do this after about 6 minutes I get the error "The remote server returned an error: (400) Bad Request". I use the following steps to upload the image (using Azure Resource Manager):
PS C:\Users\myuser> Set-AzureRmContext -SubscriptionId aaaaaaaa-bbbb-cccc-dddd-0123456789012
Environment : AzureCloud
Account : [email protected]
TenantId : aaaaaaaa-bbbb-cccc-dddd-0123456789012
SubscriptionId : aaaaaaaa-bbbb-cccc-dddd-0123456789012
SubscriptionName : MySubscription
CurrentStorageAccount :
PS C:\Users\myuser>
PS C:\Users\myuser> $rgName = "MyResourceGroupName"
PS C:\Users\myuser> $urlOfUploadedImageVhd = "https://myblobaccount.blob.core.windows.net/myvirtualmachine.vhd"
PS C:\Users\myuser>
PS C:\Users\myuser> Add-AzureRmVhd -ResourceGroupName $rgName -Destination $urlOfUploadedImageVhd -LocalFilePath C:\Users\myuser\myvirtualmachine.vhd
MD5 hash is being calculated for the file C:\Users\myuser\myvirtualmachine.vhd.
MD5 hash calculation is completed.
Elapsed time for the operation: 00:06:29
Creating new page blob of size 136365212160...
Add-AzureRmVhd : The remote server returned an error: (400) Bad Request.
At line:1 char:1
+ Add-AzureRmVhd -ResourceGroupName $rgName -Destination $urlOfUploaded ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Add-AzureRmVhd], StorageException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.StorageServices.AddAzureVhdCommand
I have no idea how to debug this further? I would very much appreciate any help in finding out what is going wrong.