0
votes

I have a few Service Bus Namespaces in my Azure Subscription. Some of them are in Basic and some in Standard tier. What I want to do is find out the cost of each Namespace separately.

I have looked at the pricing page and it is my understanding that for Service Bus Namespaces in Standard tier, there's a base charge of $0.0135/hour (BTW, the pricing page conveniently omitted the fact that this pricing is at the Azure Subscription level and not at the Namespace level) and then there's a cost per operation (e.g. first 13 M operations per month are free and then the next 87 M operations are charged at the rate of $0.80 per million operations).

This is all fine and very straight forward. The problem comes when I use Cost Management API to get the costs for a Service Bus Namespace (https://docs.microsoft.com/en-us/rest/api/cost-management/query/usage).

What I am observing is that Cost Management API reports only operations costs against the actual Namespace however the base charge is reported under a different namespace all together. The name of that namespace is $system and is under $system resource group.

There's a blurb about $system Namespace here which states:

Azure Service Bus recently upgraded the billing components. Because of this change, if you have a Service Bus Standard namespace, you may see line items for the resource '/subscriptions/<azure_subscription_id>/resourceGroups/$system/providers/Microsoft.ServiceBus/namespaces/$system' under resource group '$system'.

These charges represent the base charge per Azure subscription that has provisioned a Service Bus Standard namespace.

It's important to note that these charges aren't new, that is, they existed in the previous billing model too. The only change is that they're now listed under '$system'. It's done because of constraints in the new billing system that groups subscription level charges, not tied to a specific resource, under the '$system' resource ID.

Which is again fine.

What my confusion is how should I calculate the total cost of an individual Service Bus Namespace.

For a Service Bus Namespace in Standard tier should the formula be:

Total cost = Total operations cost for that Namespace + Prorated cost reported for $system Namespace

where 

Prorated cost = Cost reported for $system Namespace / Total number of Standard Service Bus Namespaces

Is this formula correct?

1

1 Answers

0
votes

I think you missed one more from FAQ docs:

Will I be charged multiple base charges if I have multiple standard namespaces in my Azure subscription?

No, the standard base charge is billed only once per month per Azure subscription. This means that after you create a single standard tier Service Bus namespace, you will be able to create as many additional standard tier namespaces as you like under that same Azure subscription without incurring additional base charges.

You can leverage pricing calculator for estimates. Here is one, where I have 2 standard and one basic namespace tiers listed to estimate.

You can view cost by service in cost analysis under cost management and group them by service tier for monthly to see the individual cost. Further you can add tags to resources to later filter them in cost analysis.

1: enter image description here enter image description here enter image description here

Filter using Resource Type: microsoft.servicebus/namespaces

So the calculation would be

Total cost = Total operations cost for that Namespace + Prorated cost reported for $system Namespace

where 

Prorated cost = Base Cost reported for $system Namespace (Standard Service Bus Namespaces)

enter image description here