1

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

  • Do you mean you want to upload VHD to azure storage account use powershell? – Jason Ye Apr 04 '17 at 01:08
  • 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. –  Apr 04 '17 at 01:09
  • I just want to create a VM from the VHD that is sitting in the new portal in my container –  Apr 04 '17 at 01:10
  • The VHD from where? the VHD create from azure or on-prem? – Jason Ye Apr 04 '17 at 01:11
  • VHD was created on-prem and then uploaded to Azure portal –  Apr 04 '17 at 01:13
  • Oh, I see people saying that Add-AzureDisk is for Classic VM and Storage.. Ughhh - how can I easily create a disk in azure from the vhd that is in a container in new portal.azure ? –  Apr 04 '17 at 01:15
  • I believe that would be `Add-AzureRmVMDataDisk` or `Set-AzureRmVMOSDisk'. – David Makogon Apr 04 '17 at 01:18
  • we can use template to create a new VM, or use powershell. – Jason Ye Apr 04 '17 at 01:19
  • Maybe the template is faster and easier. – Jason Ye Apr 04 '17 at 01:20
  • I see the answer below, thx guys . Hey I'm a full-stack developer ... and I write tons of c# and javascript etc... but I guess this seems a bit ridiculous when the old portal made it work without powershell - IDK, I guess if this is the direction that we are headed, seems like I should not even be able to upload a vhd within the portal.azure .. crazy to me –  Apr 04 '17 at 01:25
  • @JohnBaxter we can use some tool to upload VHD to Azure, like Azure Storage Explorer, – Jason Ye Apr 04 '17 at 01:38

1 Answers1

0

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

Jason Ye
  • 13,710
  • 2
  • 16
  • 25