Steve Rich
Created Jun 24, 2025Create and Configure Azure VM for Todo App
This lab takes you through creating a virtual machine service/resource using the Azure portal and deploying an application to run on it.
The application we'll run on it is a very simple ToDo app, which is a proof of concept for us.
I won't be going through every single option in this walkthrough or it would be extremely lengthy. The tutor will talk more about these options as they demonstrate it on a first walkthrough. However if you want to find out more information about any of these options, of course you can use the Copilot button which is on the menu bar at the top. Or you can use your favourite search engine. Some of the options should seem familiar to you now that you have studied for the AZ 900. Hopefully these labs will start to tie the theory with the practice

As we create a Virtual Machine resource Azure will automatically create some additional resources such as a Virtual Network and a Network Security Group. (NSG) They will all be grouped together under this resource group so that it makes them easier for us to manage in the future.

This is the name of the virtual machine. Again you can see what I called mine, however you are free to call it any sensible name.
You can also see at this point that I selected UK West and that I said that no infrastructure redundancy was required.
The virtual machine image that it will use for the operating system is Ubuntu Server 24.04. This is a reasonable operating system image to use for our virtual machine and is very common.

You must download your private key which will be downloaded to your Downloads folder. Do not lose this as if you did you would potentially lose Access to your virtual machine. You would normally use your Private key if using another SSH client, but to keep things simple, we'll use the SSH client built into the Cloud Shell.

In order to administer and set up our virtual machine we will use the Azure CLI, or more specifically we will be using SSH over Azure CLI. this allows us to do all of the administration through our web browser, although experts and professionals would probably use another option such as a native SSH client

Python comes installed as default with our Ubuntu OS image. But it doesn't come with Flask, which is the library/module we are using the create our web app with Python. So, we need to install it.
Type: "sudo apt install python3-flask" At the prompt. No quotes needed!
It will then confirm that you want to install the package. Press enter or enter Y and press enter.

We now need to navigate Into the folder where the application is. You can see here I use cd and the name of the directory to navigate into the directory. I then use the next command sudo python3 app.py [PRESS ENTER] which starts the application running.

Congratulations
Congratulations you have successfully set up an application inside a virtual machine which is accessible on the Internet by its public IP address.
Don't forget that you will pay for the use of the virtual machine resources whilst the virtual machine is running. You should ensure you remember to shut down the virtual machine when not using as because in a shutdown mode it will cost you less. When you are completely done with the resources you should delete the resource group which of course will delete all the resources inside it and will incur no costs at all!