Azure VPS setup notes

Azure is more complex than, say, Linode. To set up a free account, you must:

  • Get a Sponsorship.
  • Create a Subscription linked to the Sponsorship.
  • Create a Resource Group linked to the Subscription.
  • Create a Virtual Machine (and associated resources) linked to the Resource Group.

[NOTE: Most of Microsoft's pages break with an ad blocker enabled.]

Get a Sponsorship

Create a Subscription

  • Check that you have credits in your sponsored account:
  • Visit the Azure Portal.
  • Click the Subscriptions icon.
  • Click the Add button.
  • Add a subscription of type "Microsoft Azure Sponsorship" from the Azure portal. You will likely need to select Show other subscription types to see it.
    • Note: Even sponsored subscriptions require a credit card, make sure you have one available.

Create a resource group

  • Select "Resource Group" from the main Azure portal.
  • Select Add and give it a name.
  • Your subscription should be pre-selected since you only have the one.
  • Click Review and Create.

Create a virtual machine

  • Click on your new resource group in the Azure Portal.
  • Click Add.
  • Search for the name of the image you want (e.g. Debian).
  • See the screenshots below for configuration of the "Basics" and "Disk" tabs. The other tabs I keep with the defaults.
  • I've attached a downloaded template for this VM, which as of now I haven't used yet, not sure how it works.

Create a VM - Basics Tab

Create a VM - Disks Tab

Post-provisioning configuration

Partition and format the attached disk

Your VM (if it's D2s v3) will have an "OS disk" of 30GB it ships with. Your attached disk is unformatted. Partition and format the new disk with:

sudo parted --script -a optimal /dev/sdb mklabel gpt -- mkpart primary ext4 '0%' '100%'
sudo mkfs -t ext4 /dev/sdb1 
Mount the attached disk

Using the Microsoft Azure serial console, follow these directions for moving the contents of the /var directory to the attached disk and mount it.

Modify Firewall Rules
  • Click on your new virtual machine in the Azure portal.
  • Click Networking in the side navigation.
  • You should see your firewall settings. They should look like the screenshot below, except they'll be missing the two items circled.
  • Add the "allow_ping" and "Port_5665" rules to the Inbound Port Rules as shown in the screenshot.

Firewall Rules

Add a swapfile

Complete instructions are here but in short, add this to /etc/waagent.conf for an 8GB swapfile:


Then run service walinuxagent restart. (2.63 KB) Jon Goldberg, 08/07/2020 04:52 PM

Selection_999(011).png View (81.8 KB) Jon Goldberg, 08/07/2020 04:52 PM

Selection_999(010).png View (149 KB) Jon Goldberg, 08/07/2020 04:52 PM

Selection_999(012).png View (130 KB) Jon Goldberg, 08/07/2020 06:46 PM

Go to top