question

KetanChawda-MSFT avatar image
0 Votes"
KetanChawda-MSFT asked ·

[MSDN Redirect] Wait for VMs running

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
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered ·

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


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.