4.3 Ubuntu VM on 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.

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

  • 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:
    • Create new resource group (short name) to keep all components together;
    • Virtual machine name, choosing something appropriate like the resource group name;
    • Select a Region, noting costs vary across regions;
    • Choose Azure Spot instance 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
    • Authentication type using SSH public key with your public key;
    • Choose a Username for your administrator;
    • Select inbound ports to allow HTTP(80), HTTPS(443), SSH(22);
    • Then Review + create to stand up the server.

Once created click on Go to resource. From the Overview tab provide a DNS name by clicking on the Not configured link. You may be able to provide a DNS name label, choose Static IP address and click Save. If you see the message This public IP address can’t be updated because it is associated to the IP configuration ‘ipconfig1’, in the network interface ‘abc123’. 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.

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

Notes

  • I like to create a new resource group for each new VM, so that all of its resources (the VM itself, public IP address, Network security group, Virtual network, Network interface, and Disk) can be deleted as required, simply by deleting the resource group.
  • I tend to use the same name for the resource group, the machine itself, and the DNS name.
  • For an Azure Spot Virtual Machine, you can schedule an Azure Scheduled Event for a 30 second warning of eviction.


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