Migrating to Azure Cloud

I had used DigitalOcean before, which is really easy to do, they less features than other cloud providers, but their dashboard is clean, concise and fast.
Also, their pricing is a lot more predictable and easy to see.

But this time, I wanted to go for Azure, because they not only offer credit, but you also get some services free for 12 months. So if you're cautious, you can really stretch your credit to this 12 months, with headroom.

Context

Basement server

For context, I started with an old computer in my parent's basement that I used for personal VPN (required to access Steam in school dorms), hosting and whatnot.
When a 2cm flooding fried the motherboard, I decided that maybe a reliable VPS provider would shelter me from such a disaster, and also be impervious to the occasionnal home router reboot.

OVHcloud

I went to OVH, who has one of the cheapest low-end options: 3,50€/month for a 1vCPU/2GB RAM and 20GB disk. It's really good for some tests and stuff you want to leave running.
Also, they have more sensible datacenter locations in Europe compared to Azure.

The fire

As you may know, there was a fire in the OVH SBG Strasbourg datacenter, and my VPS was SBG3 which was destroyed.
I lost my data. I didn't have full backups, and I am to blame.
Many enterprises were in disaster, many lost services, and some data.

like me, they should have had backups.

Because you just can't rely on one datacenter of one cloud provider. They could encouter a fire, a disconnection, anything. Or they could simply terminate your account without any warning, like Google is infamous for.

Rebuilding

In the aftermath, OVHcloud gave away 6 months of free replacement for lost assets, which meant I got a free VPS for 6 months with the same configuration.

Having taken a look at cloud-init, I kinda wished I had such a setup that would enable me to switch really fast my services and data from one VPS to another.
I tried to stick to docker deployments so that I could more easily transfer all of my setup to another server, so the only thing left was the actual data.

Migrating

Coming from "simple" cloud providers, Azure can be quite intimidating: tons of tabs with strange and similar names, strong resource separation.

To deploy a VM, Azure will create a managed disk, a Network Security Group -- some sort of firewall, an IP and a NIC. On a side note, these resources persist of you delete just the VM, so be wary of hidden costs !
Like on GCP, VMs don't see their public IP if they have one.

Network setup

For simpler management or to use a dynamic IP, you can setup a DNS zone in Azure (create it, then point your domain to Azure nameservers), and then create alias on you IP objects, which is a DNS record bound to your VM's IP. You can only setup A records with this though.
And of course you can edit your Azure zone manually. Sadly it lacks SSHFP records (and DNSSEC)