How to optimize your Azure Investments ?

Tarun Ghai
5 min readOct 17, 2023

Organizations always want to do “more” with “less”. Optimizing the cloud investments is always an ongoing activity for every business house.

After working with several customers on cost optimization , I am sharing my learnings that can help organizations optimize the cloud cost.

1)To start with , it is really necessary that we monitor the cost for any new application/workload. For any new application that we want to deploy, we should estimate a monthly budget. Once we know this budget, we can set alerts when this budget reaches 80% and if it cross 100%.
We can review the consumption once these alerts are triggered and take some corrective action. We may also need to fine tune the budget as per our business requirements from time to time.

Microsoft Cost Management | Microsoft Azure

2) We must track the resources which are un-used, underused or orphaned as they are costing us without giving any business value. We can run below script regularly to find such resurces.

GitHub — dolevshor/azure-orphan-resources: Centralize orphan resources in Azure environments

3. Azure Hybrid Benefit is a great tool to use to get high discount for Windows and SQL workload. Buying Windows/SQL Licenses upfront can also be economical compared to PayG license cost.

For long running workloads buying upfront license can be better option and for Dev/Test, PayG can be a beter option. Always check if buying license is more economical compared to PayG.

Azure Hybrid Benefit — hybrid cloud | Microsoft Azure

There are some free tiers available for different services that can be used for Dev/Test environments.

https://learn.microsoft.com/en-us/azure/azure-sql/database/free-offer?view=azuresql

4) Reserve Instances — For long running workload that we know will run for 1+ years we should use Reserved Instances as they can save up-to 70% of the cost of VM.

Azure Reserved Virtual Machine Instances | Microsoft Azure

5) There is critical workload that needs to run 24X7 but there is some workload that need to run only in business hours. for such workloads, we should shutdown resources which are not needed in the night time or during weekend. We can use Azure Automate to shutdown resources in non business hours and bring them up in business hours. please refer below.

Azure Automation Start/Stop VMs during off-hours overview | Microsoft Learn

6) Right Sizing is a great tool that can make sure our resources are not under utilized and we are only paying for the resources that we need. Many a times customers migrate to azure without doing a proper discovery & assessment. We must use Azure Migrate that does discovery , assessment and uses right-sizing to provide suggestions on right Azure resources we should be using during migration to Azure. We should also monitor this frequently as the usage can change over time.

Azure Migrate documentation | Microsoft Learn

7) Many a times we use IaaS services to save the cost but their equivalent PaaS offerings rather may help us save the cost. There is always a 15–20% administration cost for IaaS services that PaaS can save along with the auto scaling that comes with PaaS. PaaS comes up with a a given SLA for availability and security. IaaS may have this hidden cost that we must consider.

8) Azure advisor is your personal cloud consultant that observes your cloud usage and offers actionable recommendations to help you optimize. e.g. It observes a long running VM or an underutulized VM and provides recommendation for Reservation or right sizing. We should continuously take action on the cost recommendations given by Azure Advisor.

Azure Advisor — Azure Best Practices | Microsoft Azure

9) Auto scaling is a great tool that can help us optimize. We should have a scale-in and scale-out policy for most of our workloads.

Overview of autoscale with Azure Virtual Machine Scale Sets — Azure Virtual Machine Scale Sets | Microsoft Learn

Scale resources — Azure SQL Database | Microsoft Learn

10) While choosing the storage, we should choose the right storage tier. There is a significant cost saving with cold tier instead of Hot tier for infrequently accessed data.

11) We should choose the right data store. Many a times we choose a relational database for use cases where a NoSQL database is more than enough. Choosing a NoSQL database can help us save heavily over costly relational databases.

Azure Cosmos DB — NoSQL and Relational Database | Microsoft Azure

12) The egress/inter-region data transfer can some times cost us. We should use data deduplication, compression and also find other ways to reduce inter-regional data transfers in our application architecture. Designing our apps(e.g. ott) to only download the “delta” differences in data can also help reduce the egress cost.

13) Reduce load on expensive servers — We can also save by introducing a caching layer in front of a database as every call to database costs us in many cases.

14) Arm–based processor or AMD based processor VM’s provide significant cost savings compared to Intel based VM’s. Do test your workloads and if it certifies on AMD or Arm–based processor VM’s, you can save the cost further.

AMD and Azure | Microsoft Azure

Generally available: New Azure Virtual Machines with Ampere Altra Arm-based processors | Azure updates | Microsoft Azure

15) Choose the right Region — Azure cost is different in different region and this difference can be 5–10%. So we should always check if we have a more “economical” Azure region for our workload.

16) For low priority workload that can run in non business hours, we can choose Spot VMs as they provide huge cost advantage.

Spot Virtual Machines — Spot Pricing and Features | Microsoft Azure

17) Last but not the least , observe the costliest resources you are using and see if you really need them and if they can be replaced by an economical alternative.

We should also use Cost tagging which can help find the cost for different business units, departments or environments.

In case we are fine with longer RTO , we need not to have active replica in DR region and we can bring up the requisite Infra/resources once production site goes down.

We may be using services that we may not need. e.g. Using DDos protection service for an internal departmental application may not be needed.

P.S. This list may not be exhaustive. We will always keep finding new ways to optimize the cost that we will update here.

--

--