Checklist to save your Azure cloud cost

shalini Pahwa
4 min readJan 25, 2023
Photo by <a href=”https://unsplash.com/@dianamia?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">C Dustin</a> on <a href=”https://unsplash.com/s/photos/cloud-computing?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

Let discuss about how to reduce and control cost on Azure cloud.

These are generalized ways to reduce costs. Make decisions while considering the criticality of the resources and environment.

  1. First deallocate VMs when not in use/configure it to auto-shutdown/reduce the number of hours a VM runs.
  2. When you stop a VM, it should be in stop and deallocated stage. If you shut down and VM’s state is PoweredOff or Stopped (Allocated) then it will still incur a cost.
  3. When you deallocate VMs, start with the front end and then the backend VM. Otherwise, you will get false alerts.
  4. When your VM is running, you are charged for compute, disk, software licenses, Microsoft Defender and service bought as pay-as-you-go model for your VM . Make it sure you have deallocated those resources as well.
  5. You can deallocate your Dev/Test environment VMs during off hours or weekend.
  6. Chose smaller VM instance size. Don’t prefer VM with nice features that you don’t need. Start with small and scale according to usage.
  7. If a VM is running more than 15–20% idle, resizing VM will immediately reduce your cost. So if you have over-provisioned VM then resize it.
  8. Its good to store the configuration that worked for you as ARM template and add it to your source control.
  9. Use B-series VMs when you don’t need full performance of the CPU continuously. Actually It uses your VM’s accumulated credits that burst above the baseline using up to 100% of the vCPU. And formula from Microsoft’s website is :((Base CPU perf of VM — CPU Usage) / 100) * 60 minutes.
  10. You can reduce cost by analyzing the region that cost you less for your resources. But be careful when you are transferring data. A large volume of data transfer over the network incurs extra cost.
  11. Use Azure Spot Virtual Machines for workloads such as batch processing jobs, Dev/test environments, Big data, analytics, HPC, stateless applications. These workloads are independent, repeatable and may require more compute capacity for some time. You can get up to 90 percent compared to pay-as-you-go price.
  12. Use your on premises Windows server or Sql Server licenses to reduce compute cost.
  13. Analyze how much base reserve capacity you needed always. If you know that these VMs or resource you will run over the year or longer, you can reserve that resource. Azure reserve instance can significantly reduce cost.
  14. Save storage cost by analyzing your backups, snapshots, logs frequently to check what is required and what is not required.
  15. You can create an Azure budget for a monthly, quarterly, or annual period and define your cost threshold. When a budget threshold is met, email notifications will be sent to your email address.
  16. You can also create an action group at various levels of cost thresholds. For example when you have spent 60% of your budget then send an email and when its 90% then send Email+SMS to the admin group.
  17. Even if you have created budget, Azure wont stop you from spending, its your call to take action.
  18. There are various access tiers and when you move from hot-> cool->Archive access tier the cost of storing data keep decreasing. You can also use “Life Cycle Management” feature. Keep less frequently used data in cool tier or even storing them in Archive.
  19. Before moving data to cool tier/archive, you need to evaluate access patterns and decide accordingly. Accessing data from archive and cool tier is rather more expensive, even deleting that data incur cost.
  20. VM scale set saves you from over-provisioning resources by setting rules for different thresholds for example CPU% , Memory %, DiskQueue length, http queue length etc. It allows you to scale-in or scale-out according to demand.
  21. You can add multiple resources in Azure Pricing calculator and get a consolidated cost for all of those resources. Using this calculator, you can get to know the prices beforehand so that you don’t get a surprise.
  22. Keep monitoring the cost and your spending in regular intervals and analyze where cost can be reduced. You can analyze your services’ performance and cost in “Cost Management”.
    Cost Analysis tab gives you more granular information about your costs for example you can filter cost by resource groups, cost by service, daily cost and also forecast of your future costs etc.
  23. Use “Azure Advisor” for recommendations for cost, performance, operational excellence and security etc.
  24. Keep a check on Orphaned resources. Even after you delete a VM, resources attached to it still be there, incurring costs like disk, Public IP address, backups. If you don’t need them, then delete them.
  25. If a VM is backup enabled, check the recovery vault and clear any unneeded backups, otherwise, it will be retained for retention period.
  26. When you delete all app services, you have to make sure that you delete the associated service, if you don’t delete the associated service plan, it will still continue to add up to your bill.
  27. Enterprise agreement helps you to save 15–45% saving or more. Higher the usage commitment and upfront payments, have more discounts in enterprise agreement. It’s usually signed for a period of three years. It also gives you some other advantages like 24x7 technical support, trainings and other features.
  28. There are different pricing models for different service
    a) VM pricing depends on overall CPU time, time spent with public IP access, ingress and egress traffic, disk size and R/W operations
    b) Pay/GB: DB storage, storage service, network traffic(between region)
    c) Charges/operations: storage services/cosmos DB
    d) Pay/execution: server-less, azure functions, logic apps, server-less DB
    e) Charged per user licenses-azure active directory premium

--

--