[MSDN Redirect] Wait for VMs running

KetanChawda-MSFT 1 Reputation point Microsoft Employee


In my C# code i create some Azure Virtual Machines. I want my program to invoke the creation of VMs (using IVirtualMachine interface), but then I want it to wait VMs until all of them are in Running state before return to main. How can I implement this?

Source : https://social.msdn.microsoft.com/Forums/en-US/697426d8-a76e-4261-b0c7-1c5bc2ce86c0/wait-for-vms-running?forum=azureapimgmt

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,409 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,606 Reputation points Microsoft Employee

    After awaiting on CreateOrUpdateAsync on your VMs, you can await on StartAsync which should return once the VM is started.

    0 comments No comments