Towards GreenOps: FinOps & Azure Costs
Have you heard of GreenOps yet? But you must know FinOps. Well, it’s two faces of the same coin. Optimize your cloud costs and you lower emissions. Lower you cloud emissions, and you probably are lowering your cloud costs too. This blogpost is part of a short series on Azure Costs, FinOps and GreenOps. So let’s dive in! 💚
Introducing FinOps (And GreenOps)
The FinOps Foundation describes FinOps as a cultural practice. A way for teams to manage their costs and take ownership of their cloud usage. As such, it requires both technical- and organizational capabilities.
A Little History
The biggest change in terms of business organization caused by the introduction of Cloud is a change in procurement responsibilities. Where you would have a central procurement department be responsible for all company expenses, including IT hardware such as servers, racks and cooling, nowadays almost all software teams can indirectly purchase this hardware through Cloud Services and perhaps some Internal-Developer-Platform modules (IDP). From a governance perspective you might be inclined to conclude that organizations are moving towards disaster, but there is some light at the end of the tunnel: we never really had this granular control, data and insights on our IT procurement. In the past you might buy a couple new servers, fit them within your rack, and start offering to your teams, but nowadays we can almost see every little thing teams are doing and the expenses that come with those actions. It’s actually quite incredible, if you know what you’re doing off course, because it’s still a tremendous amount of data coming your way.
Anyway. So, it’s important to remember that: the core ideas of FinOps tackle the problems that arise with those new procurement models!
The Stages of FinOps (And GreenOps)
The FinOps foundation has done a great job in explaining how an organization can adopt FinOps, what is necessaroy for it to succeed, and how to iterate into the future. They’ve laid out maturity levels, involved personas, rough capabilities and they explain the shortcomings when appraoching FinOps solely from one of the various traditional business disciplines (IT, Finance, Procurement, Management). All in all, I can recommend the FinOps Certified Practitioner Course very much.
In that course, they’ll also explain the stages of FinOps:
- Inform: gather data, aggregate them such that they make sense to organization
- Optimize: negotiate with your cloud provider, look into shared resource usage within the company and opt for down-/right-sizing wherever possible
- Operate: gather feedback, working your way towards new Inform-iterations
In short: get data, present them in a way your organization understand and start improving your business. Makes sense right? For GreenOps we can follow the exact same approach, but instead of monetary costs we focus on environmental costs.
BOOM! A new field is born! 😃
Azure Costs
As such, one of the most pivotal elements of a succesfull FinOps strategy is having decent data in the first place. You are thus likely to spent a good chunk of your initial time on gathering this data and building towards useful reports.
Compared to AWS and GCP, Azure takes somewhat of a different approach. Rather than providing you with a very powerful API to query for granulate details regarding usage and costs, they’ve decided that you are probably better off exporting the costs ad-hoc rather than through automatic API calls. Note that there is an API you can query, but you will be ratelimited quite soon if you do not pay attention. Therefore, larger organizations are typically advised to export their costs to a CSV through a service aptly named “Azure Cost Exports”.
It’s difficult to know the exact details, but a couple months ago I did some research on the topic to submit a feature request at the Cloud Carbon Footprint. Iterating some of those findings:
- At the moment of writing, the “Usage Details - List” API still exists, and many integrations make use of it. See the implementation here.
- First of all, its rate limit is pretty tight here. Although it’s not clear how many rows are included in each page, it seems to be capped at 1000 nextPage calls here. And that’s at an Enrollment-level (doesn’t get higher than that).
- Secondly, the Usage Details - List API is also deprecated (here again, on the top and here for moving away.
So, what is Azure moving towards to:
- For small implementations, Azure recommends this, which I haven’t tested myself yet. But there seem to be implementations here
- For bigger implementations, from 2GB month-to-month onwards so around 2 million records, Azure recommends using the Exports option, which basically exports it as a csv to blob. See also here.
- So, to me it seems pretty difficult to go around, although you could in theory still set up some sort of ingestion and use a database in the backend for storing and caching. You will need to be careful with the limit, but Usage- and Cost- data is generally at least aggregated by hour (if not day or month).
- Nonetheless, from a security perspective, Azure Exports are not all that bad. You can set up the exports through a different account and let the identity running CCF just have access to the storage account where the data is stored. And you can easily restrict user access to Azure CostManagement and Azure Cost Exports in the first place.
- As a sidenote, Microsoft seems to be pushing for PowerBI, and that integration seems to be pretty neat as well. Perhaps I should look into that.
So, in short: the Azure Usage APIs are fine if you are a small Azure user, but otherwise you will want to go for Azure Exports at some point.
Azure Cost Exports
You can either go for a one-time export or for 3 different periodic exports. Azure provides excellent documentation on the topic of getting stated with Azure Cost Exports, see here. There are a couple of things to note:
- There is a monthly, weekly and a daily month-to-date option
- Meaning that daily is as realtime as you can get, although there is a little caveat at each end of the month. Depending on the actual timing of your export, you might miss the last hours of each month.
- Personally, I believe this is actually quite problematic, since it might touch on the accuracy of your numbers. In the end, any reports you make through the exported data should exactly match what your peers can see in their personal cost overview dashboards, otherwise you just might get stuck in explaining your numbers.
- Additionally, FinOps is not about getting realtime cost data, but merely getting that data at the right moment in the hands of the right teams/people. As such, you are probably well off with weekly updates if not monthly.
- Note that you can either export the Actual Costs or the Amortized Costs. If you have reservations, the Amortized costs will split reservation quota into daily billing