Real cost of developing a project in Azure

Recently I've moved one of my side projects fully to the cloud. In this short post I'd like to show you what is the real cost of developing a fairly small yet multi-dimensional project and how Azure gives me and my client flexibility to select what is really needed in this particular moment.

The project

I won't go into details here. Just to make a long story short - we're gathering data from many electronic devices and then provide reports based on different time intervals, places and custom properties to the clients. There's also a need to handle the old legacy system and migrate data from the old database to the new one.

Azure components

Mentioned project is built using following elements:

  • Storage account
  • Function App
  • 2x Web App
  • SQL database
  • Azure B2C
  • Application Insights

worth mentioning here is the fact, that by default we're using free tiers for Web Apps and SQL server.

Taking into consideration all above our monthly cost of developing this project is 1,50 EUR on average.

Caveats

Because we're using free tiers, we have to be aware of limits - like available CPU minutes per day - but on the other hand, there's no problem to scale up when needed. This is what really made us into cloud - if only small features are being developed, free tier is more than enough. If we're during a strenuous period of developing new features, we can just go to the portal and change a tier.

Additionally we have to be aware, that on production we won't be able to use free versions of Azure components because of lacking features and much higher traffic. On the other hand, saving money in such way instead of paying much more money for resources we won't be able to utilize is a much smarter decision.

Detailed cost

There're two resources which make the most of our cost: Storage account and Function App. This is because they're the "hot path" in the system - one of the functions fetches data from FTP and pushes each record to a queues. Other functions take data from queues and perform some transformations, store data and push it further. When I checked my Billing page, the cost looks like this:

  • Storage account 0,62 EUR
  • Function App 0,55 EUR
  • B2C 0,09EUR
  • The rest of resources 0 EUR

We didn't need more power this month so we could keep the lowest cost possible.

Summary

Carefully designed cloud solution could really lower monthly cost of developing a project. On the other hand I've seen many examples, where developing a product in the cloud was much more expensive than an old-fashioned VM(or even a production environment also hosted somewhere in Azure!). Pay attention to resources used, selected tiers and their utilization and you won't be surprised when you see a bill at the end of a month.

Replacing your application stack with Azure services

I've been thinking recently what would be the cost of Azure services, if I'd like to replace my VM with this particular cloud solutions. Please do have in mind, that in this post I'm not taking into account multiple third-party applications(like TeamCity or YouTrack), which I run on the VM along with my projects. Only technology stack matters.

What do we have?

My VM is a very basic machine:

  • Windows Server 2012
  • 1 Core AMD Opteron Processor 6386 SE 2,80 GHz
  • 50 GBs HDD storage
  • 4 GBs RAM

It's perfectly fine to run a simple SPA application, SQL server and EventStore to aggregate events from multiple devices. It's far from optimal solution but serves well since many months. Cost - about 18 EUR. 

If I had a chance to start from scratch, I'd select following stack on Azure:

  • EventHub for 10M events for 9,65 EUR
  • App Service shared infrastructure for 8,16 EUR
  • Table Storage with 50 GBs of storage and 100 transaction units for 3,26EUR

It gives total of 21,06 EUR.

Pros and cons?

While having a VM gives you great flexibility, it also complicates many things when it comes to update all software, deploy and configure it. It's also a bit more difficult to integrate all together. The biggest disadvantage of a VM is the lack of scalability - if an application will meet its higher requirements, it will cost us much more to migrate to the higher stack.

The downside of a stack built on Azure is having shared infrastructure for our web application which can(but doesn't have to be) problematic from time to time. What I like about this solution is having it all in once place and integrating it all with ease. What is more I can add Azure B2C for free and have a widely used access control solution for my application. Who knows, maybe I'll migrate to the cloud in the future?