Unlocking Azure Savings: Introducing the FinOps Best Practices Library

  • Thread starter Thread starter arthurclares
  • Start date Start date
A

arthurclares

Introduction



Have you ever wondered how the recommendations in the Azure Cost Optimization workbook are generated? Or perhaps you’ve thought about tailoring those recommendations to fit your organization’s unique requirements but didn’t know where to start?

That’s where the new FinOps Best Practices Library comes in.



What’s the FinOps Best Practices Library?



To address these challenges, we’ve created the FinOps Best Practices Library within the FinOps Toolkit. This resource is designed to be a comprehensive hub for Azure best practices, starting with the Azure Resource Graph (ARG) queries that power the Cost Optimization workbook’s recommendations. Now, you can not only see how these recommendations are built but also customize the ARG queries to meet your specific use cases.



Key Advantages of customizing ARG queries:



  • Transparency into Azure recommendations: Gain full visibility into the ARG queries that generate Cost Optimization recommendations.
  • Customization for specific scenarios: Easily adjust ARG queries to better align with your organization's infrastructure and financial goals.

Whether you’re aiming to improve your cloud financial operations or explore new ways to manage costs, this library will be your go-to resource.



Understand ARG Code Sections



To illustrate how these Azure Resource Graph (ARG) queries work, let’s break down an example. The code is divided into three sections:

  1. Identify Unmanaged Disks

In the first section, the query identifies all unmanaged disks by filtering through the Azure Compute resources and checks for disks that are not attached to any VMs.





Code:
resources
| where type =~ 'microsoft.compute/disks' and managedBy == ""





  1. Filter by Disk State and Tags

Next, it filters out disks that are in an inactive state or have specific tags indicating their use in replication scenarios, such as Azure Site Recovery (ASR).





Code:
| extend diskState = tostring(properties.diskState)
| where diskState != 'ActiveSAS'
and tags !contains 'ASR-ReplicaDisk'
and tags !contains 'asrseeddisk'





  1. Project Relevant Information

Finally, it displays the most relevant information about each disk, such as its name, size, SKU, and creation time.





Code:
| extend DiskId=id, DiskName=name, DiskSizeGB=tostring(properties.diskSizeGB), SKUName=sku.name, Location=location, TimeCreated=tostring(properties.timeCreated)
| order by DiskId asc
| project DiskId, DiskName, DiskSizeGB, SKUName, Location, TimeCreated







Here is the full code snippet:





Code:
resources
| where type =~ 'microsoft.compute/disks' and managedBy == ""
| extend diskState = tostring(properties.diskState)
| where managedBy == ""
    and diskState != 'ActiveSAS'
    and tags !contains 'ASR-ReplicaDisk'
    and tags !contains 'asrseeddisk'
| extend DiskId=id, DiskIDfull=id, DiskName=name, SKUName=sku.name, SKUTier=sku.tier, DiskSizeGB=tostring(properties.diskSizeGB), Location=location, TimeCreated=tostring(properties.timeCreated), SubId=subscriptionId
| order by DiskId asc 
| project DiskId, DiskIDfull, DiskName, DiskSizeGB, SKUName, SKUTier, resourceGroup, Location, TimeCreated, subscriptionId







Cost Optimization workbook



If you haven’t heard of the Cost Optimization workbook, it’s an essential Azure Advisor tool that helps organizations identify savings opportunities by analyzing cloud spending and providing actionable insights. Learn more about it here.



New to FinOps Toolkit?


The FinOps Toolkit is an open-source collection of resources to help you implement and optimize cloud financial operations in the Microsoft Cloud. It provides tools, automation, and guidance, such as the Implementing FinOps guide, which is perfect for getting started on your FinOps journey. You can find more about the toolkit and how to contribute on the FinOps Toolkit site.

Continue reading...
 
Back
Top