Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a VHD in Azure storage. That VHD is configured as an OS disk through a command like the following:

Add-AzureDisk -DiskName $newCode -MediaLocation "http://$$newCode/$sourceVhdName.vhd" `
    -Label $newCode -OS "Windows"

I would like to create a new VM pointing at that disk. From what I can tell if I was doing this with an image I would do something like:

New-AzureVMConfig -Name $newCode -InstanceSize $instanceSize `
    -MediaLocation "http://$$newCode/$sourceVhdName.vhd" -ImageName $newCode  `
    | Add-AzureProvisioningConfig -Windows -Password $adminPassword `
    | New-AzureVM -ServiceName $newCode 

However this is wrong for me because I don't have an image - I have a configured VHD that is not sysprepped and can't be.

How can I create the VM in PowerShell to point at the existing disk like I can through the portal?

share|improve this question
I am trying to find an answer to this as well. I see that Add-AzureDisk has parameters for -DiskName and -DiskLabel, but I have tried both and not had success. I have a single disk that I can use when creating a VM from the web manager, but haven't been able to automate this with PowerShell... – aSkywalker Dec 11 '12 at 4:58
up vote 1 down vote accepted

So it appears from that the recent cmdlet update closed this gap - there's a script there that includes the upload and the VM creation from the upload.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.