The Azure SQL Serverless Trap: How a 10-Minute Cron Job Cost Me €30 in 2 Days

Many advertisements say something like “Only pay for what you use!” It sound like you can make your small app free of charge, but something can always go wrong. As I recently learned the hard way, serverless doesn’t always mean cheap. In fact, under the right conditions, it can be a massive budget burner. Here is how a tiny, low-intensity background app managed to rack up a €30 SQL bill in just 48 hours, and why going “old school” saved my wallet.

I built a relatively simple, automated pipeline:

  1. An App Service fetches data from an external API.
  2. The data is stored and processed in an Azure SQL Database.
  3. The app generates reports and saves them directly into Azure Blob Storage.

This operation is executed every 10 minutes. Actually, the requests to the database are very easy and can’t load the database seriously. The sizes of tables are also very small. Every table has less than 200 lines.

I wanted to gain some real-world experience with modern cloud features, I opted for Azure SQL Serverless. I estimated my total monthly costs for the App Service, Blob Storage, and SQL combined should comfortably hover around €30 a month.

After just two days of the live run, I checked my Azure Cost Management dashboard. Total expected monthly budget? Already gone. The SQL database alone had accumulated €30 in just two days. If left unchecked, that single database was on track to cost between €120 to €150 by the end of the month.

What went wrong?

In my scenario SQL server never fell asleep. The minimal time for SQL auto pause is 15 minutes. As a result, I had serverless instance running 24/7. Even at a minimum resource of 0.5 vCores the cost should be about 120 euro a month.

What to do

For scenarios like mine I do not need the heavy architectural flexing of the vCore model, so the best solution is to switch to Basic Plan, that costs 5 euro per month. Fixed, Predictable Pricing: The Basic tier costs a flat rate of roughly €5 per month. No matter how many times my app pings it every 10 minutes, the bill will not change.

Leave a Reply

Your email address will not be published. Required fields are marked *

Let us know you are human: