[MSDN Redirect] Wait for VMs running

KetanChawda-MSFT 1 Reputation point Microsoft Employee
2020-02-06T06:22:45.083+00:00

Hi,

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.
6,981 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,511 Reputation points Microsoft Employee
    2020-02-06T06:47:07.547+00:00

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

    0 comments No comments