I am using the C# SDK for Microsoft Azure to stop (deallocate) a virtual machine. I am trying to use either Microsoft.Azure.Management.Compute.Fluent.IVirtualMachine.Deallocate
or Microsoft.Azure.Management.Compute.IVirtualMachine.DeallocateWithHttpMessagesAsync
. Both seem to wait for the virtual machine to complete the deallocation process.
I want to deallocate virtual machines without blocking to wait for the deallocate to complete.
I notice in the Azure CLI documentation that there is a --no-wait
option.
Source: https://docs.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latest#az_vm_deallocate
How can I achieve this using the C# SDK for Azure?
--no-wait
option means the command should terminate immediately after sending the request and not wait for the operation to finish. - Gaurav MantricancellationToken
property would be the same functionality with--no-wait
- EagleDevDeallocateWithHttpMessagesAsync
is used for Scale Set, not a specific vritual machine. With VM Scale Set, of course it is a set of VMs which requires a wait. - EagleDev