Setting up a Linux Virtual Machine on Microsoft Azure

Setting up a Linux Virtual Machine on Microsoft Azure

Today, I’m putting on my nerd’s hat to show you how to setup a Linux Virtual Machine on Microsoft Azure. This a just a basic setup. From there, then, you can decide what you would want to do with your Virtual Machine.

Okay, lets get our hands dirty.

  1. Login to your Microsoft Azure Portal by going to https://portal.azure.com

azure_portal

2. Click on the “New” button on the left-side

new_azurecli

3. Click on Compute, choose Ubuntu Server and make sure Resource Manager is selected as the Deployment Model then press Create.

vm_create

Configure Virtual Machine (First Steps).

  1. Give your VM a name
  2. Chose your storage type (Either SSD or HDD)
  3. Enter a username
  4. Insert your SSH public key or set a password
  5. Choose an Existing Resource Group or create a new one
  6. Lastly, select where you want to deploy your server. Choose the region nearest to yours.

Press OK to move to the next step.

vm_basic1vm_basic1-2

Size and Pricing (Second Steps)

This is tricky part. The size you will want to choose will depend on what you want to do with the VM. For instance, if you want to use it as a Web Server then the Standard Package DS1V2 will suffice for an average website. So go ahead, explore and choose the package that suits your needs best.

size_stdn

If you just want to fool around, then go back to the previous step, change your storage type to HDD then again on the Size and pricing section click on “View All” and select the A1 Basic package.

size_basic

For the sake of this tutorial, I will use the standard one.

Other Settings (Third Steps)

We need to create a storage account.

  1. Click on storage account
  2. Select an existing account or create a new one
  3. Name the new account then press OK.

choose_storage

Then you are required to create a virtual network to put your VM in. Note that, thereafter, all VMs that you will put in this Virtual Network should be created in the same region you have selected in the first steps.

create_new

Next step is to assign your Virtual Machine an IP address. Now again, depending on what you want to use the VM for, you have the option to decide whether to use a Static or a Dynamic IP address. If you want to have it configured as a Web Server later, I recommend using a Static IP. Here’s how:

  1. Click on Public IP Address
  2. Select Create New
  3. Then set a name and select Static

Select OK to continue.

set_stat_ip

Our Virtual Machine now has a public IP Address which means it can be accessed from the Internet. Hence, we need to protect it. This is where the Network Security Group comes in action.

It defines a specific set of open ports that you’ll be using for inbound and outbound connection to your VM while restricting access to other ports that you’ll not be using. For instance, you will see that port 22 is opened by default. Port 22 is used by Secure Shell for remote connection.

You might want to set a new inbound rule for ports 80 and 443 to enable HTTP and HTTPS traffic in case you want to setup a web server.

To create a new Network Security Group do the following:

  1. Click on Network Security Group
  2. Select Create New
  3. Name your NSG
  4. Create rules for any other port you want to open

Click on OK to continue.

ngp_azure

We are not going to configure Extensions and High Availability set just leave it still.

Lastly, we need to setup a diagnostic account where all metrics information like CPU and network usage will be stored.

  1. Select storage account
  2. Click on create new
  3. Name your storage account

Click OK to continue.

diagsa_azure1

Deployment

Great! We have finished setting up our first Linux VM. Press OK on the settings pane and validate to start deployment. This will take some time so go grab a coffee.

oka_azrueset val-azrue

After a successful deployment, the VM should appear on your Dashboard. Click on it.

created_vm

 

The Virtual Machine’s public IP Address will appear on under the Essentials properties.

vm_ip

 

Now, you can easily use puTTY to connect to your VM and get it ready for some good use 😉

 

Regards,

Cédric