Windows Azure – Manage your VM

Once all our stuff is prepared thanks to previous posts:

You way have to take actions on your VM. Windows Azure prodives a set of cmdlets to do this. We already used Update-AzureVM and New-AzureVM, to change configuration and create one, but obvisouly, you can do more !

As you see, many actions are possible. Let’s start by the common ones… i won’t explain what the cmdlets’ll do, i think it’s clearly 🙂

  • Start-AzureVM
  • Stop-AzureVM
  • Restart-AzureVM
  • Remove-AzureVM


If you have only one VM remaining in your subscription, and want to delete a VM you can encounter this

As it’s said, the solution is to use the -StayProvisionned switch, if you wan’t to stop completly the VM and can loose your IP configuration, it’s possible by using the -Force switch.


Ok, now our VM is stopped, let’s start it !

Nothing more simple… it’s the same for a restart.




Import or Export a Virtual Machine

If you want to save a virtual machine and recreate it from scratch with a blank data, it’s possible. First of all, you must have export it to a XML file.

You have now a beautiful XML file locate in the path designed in the command, it should be something like this…

Note: Using Export-AzureVM, followed by Remove-AzureVM and then Import-AzureVM to recreate a virtual machine can
cause the resultant virtual machine to have a different IP address than the original.

And now, we just have to import it and create a new from it !

But this is not working…


So i’ve done a Get-Help Import-AzureVM -examples and see nothing more. Let’s add an AffinityGroup to the New-AzureVM cmdlet.

Not working too…



Soo… let’s try with an existing service label

And guess what ? It’s not working too 🙂 I got the same error as bellow.. So if someone from Microsoft read this post and he/she have a solution, feel free to give me a hint at least or the solution.

Ok, that’s all for today.

In the next post, we’ll talk about backup your VM stuff !