How I Escaped the Cloud

2022-11-09 | 374 words

Half a year ago, I famously migrated my websites and experiments to Azure, specifically to Static Web Apps (which are free), App Service (Flask website, also basically free with limited CPU time), and Cosmos DB (a NoSQL database with a SQL-like API…sounds better than it actually is). And I was basically satisfied, I had resource groups in Azure with individual services, an overview of spending, and even nameservers in Azure DNS (because I couldn’t find a CZ registrar that could handle ALIAS/ANAME).

A few days after listening to the episode “Leaving The Cloud”

a huge bill arrived (as is usually the case in the cloud, sooner or later). I was used to paying almost nothing and suddenly they wanted almost 60€ from me. I only have my projects for fun in the cloud and I’m not going to pay for this! I still don’t know why this happened or what it was for. Most of the spending was for Cosmos DB, which I always had for free. I didn’t exceed any limits, nor did I exceed any data usage.

I have no idea. I looked at various Cost Explorers and really couldn’t figure out the reason. The funny thing is that the next day I received an email about exceeding the 5€ limit (which is probably the daily limit). The image shows that I sometimes paid over 2€ per day just for Cosmos DB.

Azure Crazy Cost

So I decided to get the cheapest VPS from Forpsi for 84 CZK per month. I transferred my domains there, spent two days debugging, installing, and modifying my scripts.

For static websites (Hugo, Vue, Svelte), I made a simple PowerShell script that builds the website and uploads it to the server via Rclone (SFTP).

It was harder with Python. I had never hosted it as a web application before, except on Azure (where it was automatic), so I struggled with Apache and WSGI. That was really something.

In the end, I also modified the scripts running on my raspberries. I replaced direct access to Cosmos DB with a simple “API” in Flask and my favorite MariaDB :) So I had some fun, burned a lot of time on it, but that’s what we DIYers do. So there you have it.

Funny Cloud Joke