Azure cost optimization: 8 ways to save when using Azure
1. Move away from traditional databases
Using traditional databases like MS SQL and others can rack up your Azure expenses pretty quickly. To add to this, Virtual Machines (VMs) are often expensive and database instances are frequently used in a less than optimal way, meaning database VMs aren’t always appropriate way to distribute loads between instances.
For many organizations, transitioning to a PaaS is the best solution. By using PaaS infrastructure, you remove the need to perform low-level work or hire more people to set it up and maintain it that usually requires considerable amount of money to do. And, you’ll only be paying for the database resources you’re using at any given moment.
If your company is really looking to optimize your Azure costs, an SQL elastic pool might just be the answer. Doing this allows you to reserve many resources that can be shared across hundreds of databases, rather than reserving resources to use across a single database—your resources (and your money) will be able to stretch further, hence elastic. If you’re working with a database where the usage is much higher than that in your other databases, you may need to purchase a more expensive elastic pool tier to ensure your infrastructure can fully withstand the usage peaks.
To make really effective cost savings, consider using a serverless Azure SQL. This is designed to automatically scale computing power and usage according to the workload amount, meaning you are billed for computing power used per second and therefore only for what you use. On top of this, serverless SQLs can automatically pause the database when it’s inactive and resume when necessary, so you’re only paying for periods in which you actually used it.
2. Find the correct size of Virtual Machine
Azure Virtual Machines (Virtual Machines) are designed with a range of hardware and performance capabilities, so finding the right one for your workload is important, to ensure you’re getting maximum performance while optimizing your Azure costs. It can take a while to find the right combination suitable for your unique projects, but once you’ve got it figured out be sure to keep it in place and use auto-scaling features to automatically adjust the number of VMs according to your actual workloads.
3. Switch workloads to containers
Containers are a much more lightweight way of storing your workloads, especially compared to Virtual Machines. Depending on your workflow and resources, you may be able to run numerous containerized applications on a single host, and sometimes manage many containers per host. Companies that can repackage their applications as containers will reduce the need for Virtual Machines, meaning their Azure cost optimization efforts will be even more effective.
Before you shift your workloads into containers, it’s important to note that doing this can sometimes increase your costs. So, make sure you’re speaking to an Azure expert about your unique project before you make any changes.
Although it’s not always possible, you should always aim for 100% VM utilization to ensure your costs are optimal. But how do you do this? By monitoring your metrics with Azure Monitor and using auto-scaling features to add and delete machines as and when you need them, according to your utilization percentage at any one time.
4. Make use of storage tiering
Because of the sheer amount of it needed for many businesses, storage can be one of the costliest parts of using Azure, so taking the time to consider how best to optimize this aspect can mean you greatly reduce your overheads.
Implementing a tiered storage model means you can keep costs lower depending on your project requirements. For example, the Azure Blob Storage model offers Premium, Hot, Cool, and Archive storage tiers with pricing to match, so you can discover what’s right for you. For example, if you’re looking to make quite significant Azure cost savings, storing your data on a lower-cost tier can decrease your monthly costs and can create a substantial reduction further down the line for you, as well.
5. Base VMs stop/start schedule on your usage
To optimize your Azure costs properly, it’s highly recommended that you perform an analysis of your usage patterns and availability so you can create a VM stop/start schedule that is optimal for your individual business. Combine your custom scheduling with autoscaling and you’re sure to reap benefits including added elasticity, and better cost-effectiveness in the long run.
So, how can you do this? Azure Automation Runbooks gives you the tools needed to implement automatic stop/start functions. Scheduling your usage in this way can be effective, particularly in a test environment where you don’t always need to be operating. Alternatively, using autoscaling in VMSS is a great solution if your applications need to be run on VMs because of its inner mechanism which makes it easy to add or remove instances according to the autoscaling rule.
6. Remove unused virtual disks
Currently Azure doesn’t have the option to automatically delete virtual disks when you delete a virtual machine from your infrastructure, because of this your costs can continue to go up without you knowing. To tackle this and better optimize your Azure costs, you’ll need to locate your unused virtual disks via the Disks screen in your Azure portal. Here, you’ll find all active managed virtual disks in your current storage account, and identify any without an owner which would imply it’s empty.
Should a disk have no VM, it’s likely you can then delete it to ensure you’re managing your Azure costs and not overpaying for parts you don’t need.
7. Monitor your application dependencies
As well as your SQL server, it’s likely your app has further functionalities such as using queues and caching, other dependencies, and Azure features like CosmosDB and Azure Storage. But what can you use to track these app dependencies, and make further Azure cost savings down the line?
- Azure Cache for Redis: Allows you to store your data in memory rather than on disk, and can process requests within milliseconds, giving you delivery of fast cache operations and very scalable data tiers.
- Microsoft Azure Service Bus: Can be used to decouple apps and services to create a reliable platform that can transfer data and state via messages.
To make the most of your Azure cost optimization efforts, be sure that all your dependencies can be scaled well and performing optimally.
8. Choose the right payment option for your needs
Microsoft knows that flexibility is key for businesses and professionals alike, and that’s why there are several payment options available to suit how you do things. You can either:
- Pay-as-you-go: Although this is the most flexible option, giving you the ability to add infrastructure on demand, it can also be the most expensive.
- Reserved instances: This type of payment requires an upfront commitment of between 1-3 years, but as with any bulk purchases, can land you a sweet deal (up to 70% off!).
Spot instances: This type of payment is designed to utilize unused compute capacity, and as they can be suspended at any time, are best for projects that aren’t time-bound. Similar to reserved instances, the Azure cost savings to be made here are great – up to 90% reduction!