Ten Ways to Reduce Azure Costs
Reducing operational and infrastructure costs is one of the most common reasons for migrating on-premises infrastructure to Azure. However, Azure can get really expensive if it is not used prudently. There are many ways to reduce the bottom line on our Azure bill, so let’s learn about ten great ones.
- Reserved Instances
- Azure Hybrid Benefit
- Enterprise Agreement Subscriptions
- Azure Budgets
- Azure Advisor
- Pricing Calculator
- Azure Spot Virtual Machines
- Turning Off Virtual Machines
- Serverless
- Azure Blob Storage Access Tiers
1. Reserved Instances
Azure reserved instances allow us to purchase cloud capacity up-front in exchange for a significant discount. Reserved instances can be up to 72% cheaper when compared with pay-as-you-go prices. If we have a predictable number of virtual machines for our workload, reserved instances can save us a lot of money.
It’s important to purchase just enough reserved instances to maximize the savings from the discount while not underutilizing our reservations. When purchasing reservations in the Azure portal, Azure will give us automatic recommendations based on our past usage data. We can purchase reservations for either a one-year term or a three-year term.
Even after purchasing reservations in Azure, we still have the flexibility of exchanging them for other reservations. For example, we can exchange an Azure Virtual Machine reservation for an Azure Dedicated Host reservation. It’s also possible to refund a reservation. Currently, Azure doesn’t charge an early termination fee for refunding reservations, but that may change. Please note that there are some restrictions on exchanging and refunding reservations.
To learn more about Azure reservations, check out this great Microsoft Learn module.
2. Azure Hybrid Benefit
If we already possess on-premises licenses for Windows and SQL Server, we can use the Azure Hybrid Benefit for cost savings up to 85%. Using the Azure Hybrid Benefit will significantly reduce costs for Windows Azure Virtual Machines, SQL Server on Azure Virtual Machines, Azure SQL and Azure SQL Managed Instances. Azure Hybrid Benefit can be combined with Azure reserved instances for even greater savings.
To get a better idea of how much can be saved with the Azure Hybrid Benefit, have a look at the Azure Hybrid Benefit Savings Calculator.
3. Enterprise Agreement Subscriptions
Enterprise agreement subscriptions offer better Azure pricing in exchange for more up-front commitment. They can offer discounts of 15-45% percent depending on the amount of up-front commitment. They are intended for larger organizations and can include other Microsoft services such as Microsoft 365. The typical minimum commitment for an enterprise service agreement with Microsoft is three years. To learn more about Microsoft enterprise agreements, see the official web page.
4. Azure Budgets
Azure budgets let us create alerts to notify us when spending thresholds are exceeded and to respond to those alerts using automation. We can scope budgets to management groups, subscriptions, resource groups and even individual resources. The budget can be set for monthly, quarterly or annual periods.
We can attach an Azure action group to a budget alert, which lets us use any kind of notification which action groups support including e-mails and text messages. It’s important to note that a budget alert by itself will not stop or deprovision Azure resources. However, through the budget’s action group, we can respond to the alert using various forms of automation such as Azure Automation runbooks and webhooks.
For more information on Azure budgets, check out the Microsoft documentation.
5. Azure Advisor
Azure Advisor gives us recommendations to better adhere to the pillars of the Microsoft Azure Well-Architected Framework. One of those pillars is cost optimization, so Azure Advisor can give us many great suggestions for reducing costs. Azure Advisor will analyze our usage data and accordingly advise us to take steps such as:
- Changing virtual machines to a cheaper SKU
- Eliminating unprovisioned ExpressRoute circuits
- Deleting idle virtual network gateways
- Purchasing reserved instances
- Deleting unused public IP addresses
While Azure Advisor is very useful for cost optimization, it can also provide recommendations for improving operational excellence, performance efficiency, reliability and security. Complete this Microsoft Learn module for a great introduction to Azure Advisor.
6. Pricing Calculator
Prevention is better than cure, right? The Azure pricing calculator lets you determine how much a potential solution will cost without ever deploying it. The pricing calculator is a great tool for experimenting with different solution designs and determining the most cost-effective one. It offers pricing calculations for most Azure services and even includes some example scenarios to help you get started quicker. Try out the pricing calculator here!
7. Azure Spot Virtual Machines
Azure Spot Virtual Machines are up to 90% cheaper than regular virtual machines, and are a great way to significantly reduce costs. The caveat with spot instances is that Azure can evict them at any time. For this reason, it’s best to use them for workloads that can handle interruptions such as batch-processing and dev environments.
Spot instances can be created with two different types of eviction policies: deallocate and delete. The decallocate eviction policy lets us redeploy the evicted virtual machine at a later time, but requires us to continue paying for the virtual machine’s storage while it is deallocated. The delete policy will completely remove the evicted virtual machine and it will not be deployable again. We can use Azure Scheduled Events to finish up the work on the spot instance thirty seconds before it is deprovisioned.
To learn more about Azure Spot Virtual Machines, see the official documentation.
8. Turning Off Virtual Machines
When Azure Virtual Machines are running, we are charged for compute by the minute, even when we are not using the virtual machines. For workloads which do not run at all times, we can save money by stopping the virtual machines when they aren’t needed. For example, a development environment running on virtual machines would be a good candidate for shutdown during non-business hours if development is only done during business hours. Automatically turning virtual machines on and off according to a schedule can be done using Azure Automation.
9. Serverless
Serverless Azure services such as Azure Functions and Azure Logic Apps allow us to pay only for the compute we use. Instead of constantly paying for provisioned compute, we are billed only when our application or function is executed and for the resources used during that execution. For an Azure Function, billing is based on the number of executions, the length of execution time and the amount of memory used.
Serverless Azure services are perfect for event-driven or scheduled workloads as we just pay for the events we process. However, they are not a good fit for applications that need to be immediately responsive at all times like web APIs. This is because serverless services will take some time to start themselves up if they haven’t been used for a while. The premium SKU of Azure Functions can help with this cold start problem as it always keeps one instance ready to use.
Check out these Microsoft Learn modules for an excellent introduction to Azure’s serverless offerings:
10. Azure Blob Storage Access Tiers
Azure Blob Storage is a key Azure service which lets us store and manage blobs (files) in the cloud. Many cloud-based applications heavily rely on Azure Blob Storage and store a large number of blobs. When using Blob Storage, we pay not only for the blobs we store, but also for the operations performed on them. We can optimize these costs by placing the blob in the most appropriate access tier. There are three access tiers offered by Azure Blob Storage:
- Hot
- Highest storage costs
- Lowest access costs
- Intended for frequently accessed blobs
- Cool
- Medium storage costs
- Medium access costs
- Intended for infrequently accessed blobs
- Archive
- Very low storage costs
- High access costs
- Intended for very rarely accessed blobs
To learn more about Azure Blob Storage access tiers, see the official documentation here.