Azure Virtual Machines
- Shone Pious
- Sep 19, 2024
- 2 min read

In this blog:
This lab is important for foundational Azure knowledge, and tackling advanced labs.
Configuring our virtual machine
Sign in with the credentials provided in the lab.
Search for virtual machines in the search bar, and click create.
Configure the machine as shown in the screen shot below.
Keep Availability as No infrastructure redundancy required.
The image can be found in the shared section in all images.


Then use the following configuration. Click review and create, and then download the key from the pop up window after the creation process.

Identity and Access Management (IAM)
Once deployed, go to the resource, and go to the identity section. Click ON, and save.

Next, go to the metrolioassets4fe3 storage account, go to the IAM section and add a new role assignment. Click storage blob data reader for the role and go to the members section.

In the members section, click managed identity and select the virtual machine we made before. Then click review and assign.

Connecting via SSH
Now we can connect to the VM using SSH.
Open the terminal in the lab desktop and navigate to where we downloaded the SSH key.
Type this command to modify the SSH keys permissions so it's usable ➡️
chmod 400 metrolio-app-dev_key.pem

The next command will let us connect to our virtual machine ➡️
ssh -i metrolio-app-dev_key.pem metrolio@20.0.233.30

Target our storage account and return Blob
Nano into the file inside the user’s home directory, and substitute your storage account name, as shown below.

Use Python3 to run the script to download the blob from the storage account. Here is the blob.

Azure Bastion
Go back to the VM resource page, and stop the virtual machine so that its in a deallocated state.
Go back to the metrolio-test VM, and click on the Bastion in the resource menu.
Sign into the Bastion using the username that you set up for your virtual machine, using the SSH Private Key from Local File authentication method and the id_rsa private key found in your lab desktop’s home folder. Once inside, type LS and find the token.
And that’s It! We're done 👍
Thanks for reading!
Comments