Create and Configure Azure VM for Todo App
SR

Steve Rich

Created Jun 24, 2025

Create 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.

0
    p

Go to the Azure Portal

37 Steps
1

Click on Create a resource

Click on Create a resource
2

Type "virtual machine" and hit enter

Type "virtual machine" and hit enter
3

Find Virtual Machine in the list and click on Create

Find Virtual Machine in the list and click on Create
4

Now we start the progress of configuring the Virtual Machine (scroll down)

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

Now we start the progress of configuring the Virtual Machine (scroll down)
5

For the Resource Group, click on Create new

You will likely have another subscription details here at this point, but do not worry as it always fills the most suitable subscription in with the default.

For the Resource Group, click on Create new
6

Type any sensible name for your resource group. I used "ICCtutorial1"

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.

Type any sensible name for your resource group. I used "ICCtutorial1"
7

Type "icc1-todo"

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.

Type "icc1-todo"
8

We will use Public Private Keys for security. Click on Key pair name

Public and private keys to access our virtual machine is more secure than using Passwords. You can see I have left the username as azureuser and I've given my key a name of my initial and first name (srich)

We will use Public Private Keys for security. Click on Key pair name
9

Click on Select inbound ports

We need to configure the virtual machine so that it will accept web traffic from the public Internet. For this proof of concept we will use HTTP port 80

Click on Select inbound ports
10

Click on HTTP (80)

Click on HTTP (80)
11

Click on Next : Disks >

Click on Next : Disks >
12

Now we will configure the disk connected to the virtual machine.

We can see here on this screen shot that the OS disk type Is set as Premium SSD LRS. This will cost me $6.39 per month. I want to save some costs so I'm going to select the second option from this drop down box.

Now we will configure the disk connected to the virtual machine.
13

Click on Standard SSD Best for web servers, lightly used enterprise applications and dev/test

Click on Standard SSD Best for web servers, lightly used enterprise applications and dev/test
14

Click on Next : Networking >

Click on Next : Networking >
15

Click on Public IP

We will require one of these so that our users who are using our app can connect to our virtual machine. We could if we wanted also set up azure DNS. but for this proof of concept and walkthrough I won't

Click on Public IP
16

Click on Create new

Click on Create new
17

Type "todoAppIP"

Again, any sensible name is OK.

Type "todoAppIP"
18

Click on Basic (if it's available)

(it's cheaper and does all we need). Don't worry if it's not available. In the process of creating this guide, sometimes it was available for me and other times it wasn't!

Click on Basic (if it's available)
19

Click on Dynamic

(it's cheaper and does all we need)

Click on Dynamic
20

Click on OK

Click on OK
21

Click on Review + create

Click on Review + create
22

It should say 'Validation passed'

It should say 'Validation passed'
23

Check out the estimated monthly cost for our VM.

Your costs may be slightly different if you are running in a different region or maybe selected slightly different options.

Check out the estimated monthly cost for our VM.
24

Click on Create

Once we click this button then it will start to provision the resources it needs In order to create our virtual machine and associated other resources

Click on Create
25

Click on Download private key and create resource

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.

Click on Download private key and create resource
26

You will see that deployment is in progress, This usually takes a minute or so

You will see that deployment is in progress, This usually takes a minute or so
27

Eventually it should say the deployment is complete

Eventually it should say the deployment is complete
28

Click on Go to resource

Click on Go to resource
29

Now we will connect to our virtual machine. Click on Connect

Now we will connect to our virtual machine. Click on Connect
30

Click on Connect

Click on Connect
31

Click the highlighted option

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

Click the highlighted option
32

Click on Select

Click on Select
33

Now we will configure prerequisites for SSH using Azure CLI…

Now we will configure prerequisites for SSH using Azure CLI…
34

Check the box and then click configure and connect. At this point it normally takes about 30 seconds

Check the box and then click configure and connect. At this point it normally takes about 30 seconds
35

The Azure Cloud Shell will open at the bottom and you can see that I have a message asking if I want to continue connecting. This is usual as it is the first time we have connected we should type yes and press enter

The Azure Cloud Shell will open at the bottom and you can see that I have a message asking if I want to continue connecting. This is usual as it is the first time we have connected we should type yes and press enter
36

The Azure Cloud Shell will open at the bottom and you can see that I have a message asking if I want to continue connecting. This is usual as it is the first time we have connected from this IP address. We should type yes and press enter

The Azure Cloud Shell will open at the bottom and you can see that I have a message asking if I want to continue connecting. This is usual as it is the first time we have connected from this IP address. We should type yes and press enter
37

Install Flask

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.

Install Flask
    g

GitHub

5 Steps

Now we need our application on our Virtual Machine. We'll clone a repository onto our virtual machine.. The repository Is all set up to go and should work just fine on our virtual machine.

38

Click on Clone with HTTPS url

Click on Clone with HTTPS url
39

Click on Copy url to clipboard

Click on Copy url to clipboard
40

Back in our SSH client in the Cloud Shell

type "git clone" and then press CTRL-SHIFT-V to paste the copied git link in. Then press enter.

Back in our SSH client in the Cloud Shell
41

Now a copy of the app is on our virtual machine

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.

Now a copy of the app is on our virtual machine
42

Click on Copy to clipboard the value for Public IP address, 51.137.152.243 [YOURS WILL VERY LIKELY BE DIFFERENT]

This can be seen in the main portal window above the Cloud shell.
We want to see if our app is alive and active on the IP address.

Click on Copy to clipboard the value for Public IP address, 51.137.152.243 [YOURS WILL VERY LIKELY BE DIFFERENT]
    5

Open a new browser tab and paste the IP address you've just copied into the address bar (NOT Google).

4 Steps
43

The page should load!

The page should load!
44

Type "Buy sugar"

Type "Buy sugar"
45

Click on Add

Click on Add
46

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!

Well done!
Create how-to guides like this in a snap. Get Tango now.