We can now start adding Subscriptions for all our different Business domains and environments. Azure allows you to quickly get started adding Resource groups and Resources to your subscriptions. Using Management groups above subscriptions allows for even more control. You can manage access, policy, and compliance across multiple subscriptions.
This is all great but what about controlling costs? You will very likely have team members that cant wait to try resources to see what they can do but what happens when you came from after a weekend and you test Cosmos DB has racked up a huge amount of money?
We want to be able to control things more so lets look at some options.
Azure Spending Limit
The following Subscriptions have the ability to apply Azure Spending Limits
- 0044P Free trial
- 0059P Visual Studio Professional subscribers
- 0060P Visual Studio Test Professional subscribers
- 0062P MSDN Platforms subscribers
- 0063P Visual Studio Enterprise subscribers
- 0064P Visual Studio Enterprise (BizSpark) subscribers
- 0029P Visual Studio Enterprise (MPN) subscribers
- 0025P Action Pack
- 0111p Azure in Open Licensing
- 0170p Azure for Students
- 0144P Microsoft Azure for Students Starter
When you get a free account, or are for example a Visual Studio Enterprise Subscriber you will get personal use credits.
for example. Going to a personal Subscription and looking at the overview
This Visual Studio Enterprise Subscription allows the user £115 Credits. You cant increase set credits.
If you reach your spending Limit, all services are disabled until the next billing period.
If you need to uncap you need to remove the spending limit by clicking on the above message.
Remove the Spending Limit for the current billing period will allow you to continue and the credits will then reset.
Remove the Spending Limit indefinitely will allow you to go over your Spending limit every month by adding your credit card details (Pay as you go)
However the recommendation is to only remove if required to keep more control
This is obviously a great choice for personal Azure Subscriptions, used for testing and trying things out.
Monitor Costs When using Azure Services
You cant cap the following subscriptions
- 0136P Microsoft Azure EA Sponsorship
- 0003P Pay-as-you-go
- 0023P Pay-as-you-go Dev/Test
- 0148P Enterprise Dev/Test
- 0036P Microsoft Azure Sponsored Offer
- 0243P Azure Pass
- 0145P Azure in CSP
Track Costs with Budgets
Budgets allow you to set thresholds for your spending. You can then get alerts on these thresholds.
If for example, you have a budget for £500 and a threshold for £400 you could also start adding in automation to start shutting down resources, like VMs at the threshold.
Setting the Budget at the Subscription Level
Within the Subscription Overview
Application Insights Smart Detection has been used as the action Group if the costs go up to 90% of the budget that has been set
‘Smart Detection automatically warns you of potential performance problems and failure anomalies in your web application’
Targeting a Resource with a Budget
Again going to a Subscription and Clicking Cost Analysis
The resource that has a habit of becoming expensive is the database in this subscription
We want to make sure it doesn’t get out of control
Create a new budget for this subscription and then add a filter (the filter will only work once the graph is displayed
Resource Type is selected
then Microsoft SQL Servers. You could also put tags to good use in Budgets. You could for example check for tags of resources created by specific people.
You can now have Budgets that specifically check on certain services. Great if you have Services that have a tendency to create lots of costs.
So now we can rest a little easier knowing that Azure is going to let us know what is happening. It would be great if we could apply automation to shut something down if it was accumulating costs over the threshold. We can look at this next time