1
votes

I'm not even sure why azure even has a GUI Website. It is starting to feel a bit ridiculous when the old manage.windowsazure.com I could powershell up a VHD, and then very easily use a Storage and container and Add the image and then choose from gallery of my own images.

NOW I read that in May 2017 a lot of things with the old portal are going away. I created a Storage Account myvmblobs and then a container mywincontainer and then I uploaded a VHD , tmppro2.vhd is sitting there as a VHD Blob

URL https://myvmblobs.blob.core.windows.net/mywincontainer/TMPPRO2.VHD

So I read that I could create a Disk image from powershell ( I have to no way to do it with website portal.azure.com )

Add-AzureDisk 'tmppro2' -MediaLocation https://myvmblobs.blob.core.windows.net/mywincontainer/TMPPRO2.VHD -Label 'OS' -OS "Windows"

However, I don't know if the Label or OS is important...

Add-AzureDisk : BadRequest: The storage account with the name myvmblobs as specified in the VHD URI https://myvmblobs.blob.core.windows.net/mywincontainer/TMPPRO2.VHD does not exists in the current subscription

1
Do you mean you want to upload VHD to azure storage account use powershell?Jason Ye
No, I did that before to old portal recently and that worked fine, I used the Gui in the container of portal.azure.com to upload .vhd to the container.user6824054
I just want to create a VM from the VHD that is sitting in the new portal in my containeruser6824054
The VHD from where? the VHD create from azure or on-prem?Jason Ye
VHD was created on-prem and then uploaded to Azure portaluser6824054

1 Answers

0
votes

According to your description, we can use PowerShell or template to create new VM in Azure ARM module.

About PowerShell, here is a example script(use existing VHD):

$rgname = "jason-newgroup" 
$loc = "japaneast" 
$vmsize = "Standard_DS1_v2" 
$vmname = "jason-newtest2" 
$vm = New-AzureRmVMConfig -VMName $vmname -VMSize $vmsize 
$nic = Get-AzureRmNetworkInterface -Name ("jason-newtest45") -ResourceGroupName $rgname 
$nicId = $nic.Id 
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nicId 
$osDiskName = "jason-newtest" 
$osDiskVhdUri = "https://jasonnewgroupdisks912.blob.core.windows.net/vhds/jason-newtest201681285042.vhd" 
$vm = Set-AzureRmVMOSDisk -VM $vm -VhdUri $osDiskVhdUri -name $osDiskName -CreateOption attach -Linux 
New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $vm  

Use template to create Azure VM:

Here is the template.

enter image description here

Update:

We can use azure storage explorer to upload VHD to Azure:

enter image description here