Azure Cost Optimization

A cloud implementation can be a lot like New Year’s Resolutions. Everything’s great for a month or two and then things start to slip and by the time the next New Year rolls around, you’re wondering just what could have happened.

If that sounds like you, then the long-term solution is to develop a robust cloud strategy to bring your cloud costs under control. If, however, you need to bring down your cloud spending as quickly as humanly possible, here are some “quick fixes” that can also have benefits over the long term.

Delete unused disks

One key point you need to understand about Azure is that it does not automatically delete your disks when you delete a virtual machine. What’s more, it’s highly unlikely that it’s ever going to for the simple reason that Microsoft is highly unlikely ever to want to be held responsible for you losing data you wanted to keep. This means that the onus is on you to remember to do it yourself.

Deleting disks in Azure can be a bit of a pain, but it’s important to make a point of doing it. Realistically, you want to instill it into everyone that they must clean up their disks after each use and then, once a week or so, do a double-check and clean up anything anyone’s missed. If the same people are routinely failing to clean up after themselves, take it up with them and/or their manager.

Deal with idling resources

Sometimes you need to leave a virtual machine idling, but there is a potential solution to this. Most times, however, idling resources are, bluntly, a sign of bad Azure cost management or, in other words, just a waste of money.

Often the easiest way to deal with the issue of idling resources is to give every asset an owner who is responsible for managing the Azure billing and, ideally, handing over the money out of their own departmental budget. If nobody is willing to own a resource, then it gets turned off. If nobody screams, it isn’t needed. Ideally, you will want to back this up with support to help them with their Azure cost optimization because there is a good chance that the issue is going to boil down to rightsizing and that is a genuine challenge.

Size your resources appropriately

Correct resource-sizing really is the foundation of all Azure cost optimization and it is not as easy as it sounds. In fact, realistically, instead of spending human blood, sweat, toil and tears on the matter, it’s probably a very good idea just to invest in a cloud cost optimization tool to analyze your usage and make recommendations on sizing. This is likely to end up working out substantially more affordable (and less hassle) than the number of staff hours it would take to achieve the same result – assuming you could work it out by yourself.

Check out B machines

Over the long term, platform-as-a-service may come to be seen as standard, but for now, a lot of the time, virtual machines are the most practical way to go. The problem with virtual machines is that they are billed the whole time they are powered on, regardless of whether or not they are actively in use. In principle, the answer to this is to power off the virtual machines. In practice, however, there may be instances when a virtual machine has to be kept available at all times, even though it’s hardly ever going to be used and that can have a painful impact on your Azure billing. One potential solution is to use “B machines” or burstable machines, which are designed for this specific purpose and can offer significant cost savings over standard virtual machines.

Split out your databases

In simple terms, if you have a SQL database that needs a lot of computing power, then you’re probably just as well to move from a regular SQL server to Azure SQL. Even if you have a SQL database that uses minimal computing power but which has predictable usage patterns, it may be just as well to move from regular SQL to Azure SQL.

If, however, you have a collection of databases with “spiky” usage patterns, then you may find that regular Azure SQL gets very expensive very quickly because you have to resource for peak periods and leave the resource lying idle (but being charged) the rest of the time. If this sounds like you, then Azure SQL elastic pools could be just what you need.

Basically, as their name suggests, this allows you to buy a “pool” of resources that you can share amongst various databases. Ideally, you want all the databases in the pool to have similar usage patterns so they can all use the resources equitably. If you have databases with higher resource requirements, then it’s usually best either to split them off into their own pool or to set them up under regular Azure SQL.

See Also

AWS Fargate Price Reduction