Using in Nixos environment:
-
execute nix.shell to load Azure and OpenTofu commands
-
az login -> go through Azure login process in the opened web browser
-
tofu init
-
tofu plan
-
tofu apply
If VM creation was ok, local machine public key must be added to VM .ssh/authorized_keys file. Azure seems to want RSA keys. (dir and file protections chmod 700/600). Use Azure web UI portal to connect to the created machine via shell for this operation. Nano editor to create the file.
Log into new VM from local machine: ssh -v YOUR_AZURE_ACCOUNT@NEW_VM_IP_ADDRESS
Destroy VM (to stop possible billing):
*tofu plan -destroy*
*tofu apply*
NOTE: Check finally VM status via Azure WEBUI protal, you might have to stop(and delete) VM via the portal!!!