1

I'm sure I'm not the first hitting this problem but I haven't found any useful question/answer on StackOverflow.

I've started working in a company that proposes a SaaS solution which uses App Service and Azure SQL Database. The architecture is

  • Multi-Tenant at app level
  • Single-Tenant at database level

a bit like this:

enter image description here

Naturally we have problems estimating costs at the end of the month.

My solution would be to put in place Azure Cost Management connector in Power BI but even that will not help me estimate exactly the costs of the App service per customer.

Microsoft itself suggests to Allocate costs by using resource tags but even that way isn't precise enough for me:

enter image description here

With this tagging strategy, it's easy to filter the cost information to a single stamp. It's also easy to find the cost of the tenant-specific resources, such as the total cost of the database for tenant C. Shared components don't have a tenant-id tag, but the cost of the shared components for a stamp can be divided between the tenants who are assigned to use that stamp or shard.

So once again Microsoft is underlining that the only way to calculate costs precisely is to go full Single-Tenant (Tenant C in the example).

Do you agree that going Single-Tenant at App and database level is the only way out?

Can you give me a few examples of how you address this problem in your company?

Thom A
  • 88,727
  • 11
  • 45
  • 75
Francesco Mantovani
  • 10,216
  • 13
  • 73
  • 113
  • 1
    I'm not sure this is really a programming problem, if I am honest. – Thom A Aug 04 '22 at 15:01
  • 1
    Ah, where do you think I should post this question @Larnu? – Francesco Mantovani Aug 04 '22 at 15:07
  • 1
    I doubt it fits *any* of the sites within the Stack Overflow Community, if I am honest. You would probably be better off on a forum for Azure Services (or possibly a SQL Server community if they have a section for Azure SQL Services). – Thom A Aug 04 '22 at 15:11
  • @Larnu, thinking again... I don't think I'm the only one asking this type of questions. StackOverflow was born in early 2000 when no one could foreseen the coming of the Cloud. I understand that StackOverflow was mainly focused on coding but the world has changed. Nowadays working in the IT industry is still coding but a lot ot of technologies are more and more low coding, drug'n'drop. If before setting up an architecture was a job made in Bash you now do all that through an interface in AWS or Azure. And this is still hard to archive and deserves a StackOveflow question. What do you think? – Francesco Mantovani Aug 04 '22 at 18:44
  • 1
    The fact that others might have the question doesn't make it on topic. The problem itself isn't about programming, it's about how to work out costing for a product. If there were a community with the site on cloud services or Azure I'd suggest there might be on topic, but it doesn't look like such a community exists (perhaps there's one in [area51.se] though). – Thom A Aug 04 '22 at 18:51

1 Answers1

1

There is a relatively new feature called Cost Allocation that is currently in public preview. It means that it may have limited capabilities until it is fully released (see the Current limitations section in the linked documentation page).

If you are a customer with a Microsoft Customer Agreement or an Enterprise Agreement (EA), you can try enabling this feature in the Cost Management section of Azure portal and check if available cost allocation rules meet your requirements.

With cost allocation, you can reassign or distribute the costs of shared services from subscriptions, resource groups or tags to other subscriptions, resource groups or tags in your organization. You are able to create multiple "sources" and "targets" and configure the allocation percentage either manually or proportionally based on the compute cost, storage cost, or network cost.

Please note that cost allocation will not affect your billing invoice as the primary purpose of cost allocation is to help you to charge costs back to others.

Anna Gevel
  • 1,103
  • 1
  • 11
  • 20
  • 1
    Thank you @AnnaGevel for participating in this answer. Your answer is not the silver bullet but it might be the closest thing I could find to the target. – Francesco Mantovani Aug 15 '22 at 08:15
  • @FrancescoMantovani no problem, hope you will be able to achieve what's required and get the correct cost split. – Anna Gevel Aug 15 '22 at 08:55