I am trying to stop and Deallocate a linux Azure VM from the script that is running on the VM by
sudo halt
This terminates the session (ssh if interactive), stops the VM, but does not deallocate the resources. Is this somehow possible by e.g. some configuration like AllowShutdownFromGuest
?
There is an SO answer considering shutdown from windows guests, but not linux.
There are mentions about azure-cli
accessible from the linux images, but I am not able to find any documentation, does anyone know something about this?