Detailed To-Do’s for Azure Cost Optimization
Hi, This blog is for the ones who have stumbled upon researching azure documentation for cost optimization and got confused about different resources listed on Azure Dashboard. Dont worry!! , I too felt the same.
I’ll mainly focus on “How to do” rather than “What to do”. For 2nd question, you will get millions of articles/blogs on the internet. So, Those who already know “What to do” can skip the first few sections.
This topic is vast so I’ll be dividing it into multiple parts. So, Stay Tuned for much deeper insights…
What is Cloud Cost Optimization (CCO)?
As we know with the advance in technology and services, more and more businesses are migrating to cloud-based infrastructure. As the demand increases we need more strategies to save cost.
CCO is finding ways of using cloud resources efficiently and with minimum cost usage.
Why do we need CCO?
Business Results directly depend on your Cost Spending. If you don't focus on how your cloud resources are managed then it can highly impact your account’s balance 😑. If you want to experience that just forget to turn off VMs on weekends.
Best Practices for CCO
Identify The Unused Resources. (orphan resources)
Rightsize the VM
Consolidate Idle Resources
Choose the right payment options.
Shift to containers.
Tagging Enforcement
Let's start with Unused Resources
As the name states any azure resource which is incurring 0 costs or barely getting used by any other dependent resource comes into the category of Unused resources. These unused/orphan resources should be identified and cleaned up/deleted from your account.
Now for scenarios where no. of resources is less in a project, we can conveniently find such resources manually or via Azure Advisor Service but for a large number of resources, we need some kind of Automation to identify those resources and delete them right!!
Now, the question is How can we say that a particular resource is unused?
Based on:
1. Telemetry logs of the instance
For this section, we will need to configure Azure Monitor Agent which can get us the required telemetry data like CPU, Memory utilization of the instances. And once Data is available we can extract it in CSV/excel format for more analysis or we can use Azure log Analytics Workspace to query the required information.
2. External properties of Azure
There are some metadata( based on user selection) that Azure sets while deploying any resources. That metadata is available under the Overview section of any resource in the Azure portal. Using this we can easily identify unused resources manually or we can use Azure Data Explorer Service for deeper Querying.
Example: How to Manually check whether Azure Disks is an Orphan or not.
Below Yellow color Highlighted Property can be used for identifying whether a particular Disk is getting used by any VM or not. If it is tagged as “unattached” then we can go ahead and delete it to save the extra cost.
Wrap up
In the next Blog, We will dive deeper into these use cases and we will also do some hands-on using KQL. Stay Tuned 😊
P.S.: This is my very first blog so if you like it pls do support me. If you didn't like it or have any suggestions Pls provide your valuable feedback in the comment section or via vishwanishastri@gmail.com. I’m open to all suggestions.
Thank you and keep following me for more such kind of content. 😊