We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fd1890 commit fb2495aCopy full SHA for fb2495a
setup-vm.sh
@@ -39,5 +39,12 @@ export IP_ADDRESS=$(az vm show --show-details --resource-group $MY_RESOURCE_GROU
39
40
alias sshvm="ssh -o StrictHostKeyChecking=no $MY_USERNAME@$IP_ADDRESS"
41
42
+echo '#!/bin/bash' > "destroyvm-$RANDOM_ID"
43
+echo "az vm delete --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_VM_NAME --yes" >> "destroyvm-$RANDOM_ID"
44
+echo "az group delete --name $MY_RESOURCE_GROUP_NAME --yes" >> "destroyvm-$RANDOM_ID"
45
+chmod +x "destroyvm-$RANDOM_ID"
46
+
47
+echo
48
+echo "VM created. You can now connect to it using 'sshvm' command"
49
+echo "To destroy the VM, run 'destroyvm-$RANDOM_ID'"
50
echo
-echo "VM created. You can now connect to it using 'sshvm' command"
0 commit comments