- Microsoft Azure Account ( with funds or credits )
- Microsoft Azure Suscription
- A Windows, Linux or Mac system
- A web browser
- Access to internet
- Azure CLI installed on your system (here's the official guide)
- Installed SSH (optional)
Press the Windows key and type cmd, then click on Command prompt.
Press Command + Spacebar and type terminal, then click on it.
This will depend a lot on the distribution you're using, however, for most desktop distributions the shortcut to open a command line is Ctrl + Alt + T.
az login
3. A new browser window will appear, just login to your Microsoft Azure account. If your logged in succesfully, the following message will appear:
az group create --location uksouth --name cli-resource-group
az group list
6. We can also see our resource groups using the Azure Portal. Once you're inside your dashboard, click on the searchbar and type Resource groups, then click on it.
7. You will now see all of your resource groups, including the one you just created using Azure CLI.
8. We will now create a VM inside the resource group. Go back to your terminal and insert the following command:
az vm create --resource-group cli-resource-group --name myVM --image Debian --admin-username azureuser --generate-ssh-keys
az resource list --resource-group cli-resource-group
1. You will first need to find out your VM's public IP address, to do so, insert the following command:
az vm list-ip-addresses --resource-group cli-resource-group
ssh azureuser@IPADDRESS
exit
1. Once we remove your resource group, the VM inside it will also be deleted. Insert the following command to remove your resource group, then, press y and enter (this may take some time).
az group delete -n cli-resource-group
az group list
3. As you can see, our resource group (cli-resource-group) has been deleted, however, we do have another resource group called NetworkWatcherRG; this resource group was created when we created our VM. I don't need it for any of my resources, so I'll be removing it as well.
az group delete -n NetworkWatcherRG
Don't forget to delete or turn off your resources when you you're done with them !