Our Azure bill is HOW much?? — Process tips and tooling

Dave Rothwell
OS TechBlog
Published in
4 min readMay 23, 2022

(Or … “How to placate your CFO by insisting that you really are looking at cost optimisation in Azure, and no, you never said the cloud would be cheaper”).

For the technology-specific sequel, see here.

Photo by Towfiqu barbhuiya on Unsplash

The idea that the cloud saves you money no longer abounds on the Internet. Sure, if you pay too much to a service provider to host a data centre in central London, it may well do. But our offices in Southampton (opened in 2010) use geothermal and solar energy on-site and with waste heat either being stored in the ground or heating the building. Even given this, we still make extensive use of the cloud (Azure mostly nowadays) for agility, for some pretty cool artificial intelligence and machine learning solutions and to create solutions that can be deployed to other countries.

However, cost optimisation is most certainly a consideration and one of the greatest advocates is Microsoft themselves. Cost Optimisation is even a key component of the Microsoft Azure Well-Architected Framework and they do a course on how to pay Microsoft less!

In this post, I’ll focus on examples from my experience and that of colleagues here at Ordnance Survey, starting with brief thoughts on processes and some tools that may help you reduce unnecessary costs.

The second part of this blog will give some insight into what costs us the most and how we keep that as low as possible. If this is like your organisation, start at the top of the list and work down! I’ll wrap up with some tooling from Microsoft that we find useful, and I hope you will too.

Process Tips

1. Have an “owner” who has a responsibility to ensure that costs are optimised as part of their job. Depending on your organisation, this could be done via Communities of Practice. I must write a blog on good Communities of Practice, but in essence, take them seriously with a clear structure, good leadership, a core membership, clear scope, ongoing review and actions and research good practice.

2. Be aware of your costs. Raise the visibility of what each system is spending each week. Examine the trends from previous weeks. Establish a cost optimisation plan, especially while systems are developed. This plan may include:

  • Considerations on using Azure technology A over technology B or C, because…
  • Brief notes on any tooling or approaches used and Azure resources to which they apply. Examples would be Azure DevOps, Azure automation, PowerShell, Azure SQL etc.
  • Useful links to any docs or blogs or how-to guides (no need to recreate the Microsoft docs).
  • Mentions of any other systems that include real examples (no need to repeat the work of your colleagues).
  • Consider setting Azure Budgets, Alerts, and using Power BI cost dashboards.

3. Azure supports setting budgets and alerting on a configurable percentage threshold — see Azure Budgets tutorial.

  • Everybody using Azure should be at least aware of this capability, its limitations and use it if it complements other methods and can save money for your scenario.
  • The current major limitation on Azure Budgets is that the minimum granularity for an Azure budget is ‘monthly’. This impairs your ability to react quickly without requiring further development.
  • Make a note of any resources that are created as a test or for investigation so that it’s clear that these resources don’t need to persist. Consider using Azure Resource Tags for this purpose, perhaps tagging them with a date for removal.

3. You can, of course, create your own tools to support cost optimisation. At OS we have tools for:

  • Cost Management Alerting, which uses current spending levels to predict future spending (on a monthly basis) and will post to Teams when it looks like spending will exceed a given monthly budget.
  • Cost Management Dashboard — an easy view of costs per resource group for a given system in each time period and comparing against previous time periods to see trends.
  • Cost Management API (for in-code stakeholders) — the native Azure API for costs is not user friendly. We wrapped the Azure API with a more user-friendly version that facilitates developers to create their own custom dashboards.

4. Look at full continuous deployment where you end-to-end deploy test environments from scratch so that they only live for the period of the test and are not sitting idle between runs. Think “cattle, not pets”. Doing this gives confidence in repeatability too.

5. Make your deployment pipelines fast, so that you don’t need long-lived environments. One of the reasons teams feel they need to have long-lived environments is because they have a slow deployment pipeline, making environments time consuming to build. They then leave these environments up at night, at weekends, over holidays etc. Invest time in making pipelines fast and reap the cost benefits over the long term. Look at the parallelisation of build steps.

Tooling

Microsoft does provide tooling to help optimise costs. Below are two we find helpful.

Azure Advisor

Azure Advisor is a free service that analyses your Azure usage and provides recommendations on how you can optimize your Azure resources to reduce costs, boost performance, strengthen security, and improve reliability. There are several recent Azure Advisor recommendations to help you get the most out of your Azure subscriptions, such as when to use Reserved Instances to help you save over pay-as-you-go costs, when you have subscriptions missing Azure Service Health alerts, when you should consider upgrading to a support plan that includes technical support, recommendations to solve common configuration issues with Traffic Manager profiles, and more.

Well worth investing some time in.

Power BI Cost Analysis

At Ordnance Survey, each system in Azure has a Power BI cost chart. It is an excellent way of viewing Azure costs. Note that to view the above you need access to the underlying Dataset.

--

--