4.3 Ubuntu Azure

20220603

Azure is the second largest cloud provider with compute and data storage that can be created in minutes. An enterprise account or credit card (to establish identity) is required to use Azure. A free USD200 credit is available for a one month trial. Azure can be expensive for a server running 24/7 (from $100 per month) for adhoc testing using spot pricing it can be quite cheap (from $10 per month), shutting down the server when not required. More competitive pricing for 24/7 servers is available from Linode.

After signing up through the Azure Portal you can create a new Ubuntu virtual machine as a personal server for a variety of purposes.

In creating the virtual machine I like to create a new resource group so that all of its resources (the VM itself, public IP address, Network security group, Virtual network, Network interface, and Disk) can be deleted simply by deleting the resource group.

I also tend to use the same name for the resource group, the machine itself, and the DNS name, something short, simple, lowercase.

Through the Azure Portal:

  • Click on + Create a resource
  • Search the Marketplace for Ubuntu Server 22.04 LTS
  • Click on Create to enter the Create a virtual machine page
  • Basic Setup:
    • Choose the desired Subscription if you have more than one;
    • Create new resource group to keep all components together;
    • Virtual machine name, same as the resource group name;
    • Select a Region, noting costs vary across regions;
    • Run with Azure Spot discount to minimise costs, Capacity only* usually;
    • Size, D2s v3 (2 vCPUs and 8GiB of memory for as little as 1.25c/hour) is a good baseline
    • Choose a Username for your administrator;
    • Authentication type using SSH public key with Use existing public key;
    • Paste your SSH public key;
    • Select inbound ports to allow SSH(22) and HTTP(80)/HTTPS(443) if required;
    • Then Review + create and after it is reviewed, Create the server.

Once created (1 minute) click on Go to resource. From the Overview tab provide a DNS name by clicking on the Not configured link. You can provide a DNS name label (e.g., to match the VM name), choose Static IP address and click Save. In some scenarios you will see a message This public IP address can’t be updated because it is associated to the IP configuration ‘ipconfig1’, in the network interface ‘abc123’. If you want to later change things then do the following (thanks to StackOverflow):

  • Click on the Overview from the Public IP address page;
  • Take note of the value of Associated to;
  • Click the Dissociate at the top and then Yes to confirm;
  • Under Configuration add a DNS name label and then Save;
  • Back under Overview, choose to Associate the Network Interface with that noted above.

For an Azure Spot Virtual Machine, you can schedule an Azure Scheduled Event for a 30 second warning of eviction.

The initial setup is now complete, with a base install of Ubuntu. Connect to the server using ssh as in Section 4.2 and then continue to install useful applications as described in Section 4.1.



Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0