Monday, February 26, 2024

Understand your Azure spending: Harnessing Power BI to analyze monthly expenditure

Cloud cost management, a component of FinOps, presents a complex challenging exercise. Azure, being a public cloud, hosts diverse workloads across different service tiers and regions, making cost management a difficult task.

In this article, I will demonstrate how I developed a Power BI dashboard to delve into and analyze the costs associated with my usage

There are several methods to access usage and associated costs. While utilizing the Azure cost management API is one approach, for this article, I will opt for the monthly usage file, which offers a more convenient solution.

As the first step we need to navigate to the subscription and navigate to the invoices section.




Afterward, proceed to the 'More Options' section and download the usage file in CSV format for a designated billing period

Next, upload the CSV file to your Power BI environment. Once uploaded, you'll be able to view the schema in the data pane.











Let's begin creating our dashboard. Firstly, we'll analyze the cost by each resource type. To do this, drag the 'Cost' and 'MeterCategory' columns onto the canvas. Then, convert the visualization to a Pie Chart.


Now, let's proceed to our second visualization. This visualization will enable us to analyze the cost of each service based on the plan or tier. To achieve this, we will create a table displaying the 'Cost', 'MeterSubCategory', and 'MeterName'.
















We've already gained some valuable insights! However, let's continue to delve deeper. We can examine the daily costs for specific resources. To do this, add another table displaying 'Cost', 'Date', and 'MeterName' as indicated below.
















Moving on to our final chart, let's visualize the usage pattern for specific services over time. To accomplish this, we'll create a line chart incorporating the 'Cost', 'Date', and 'MeterName' fields.



















Now, let's enhance the visual appeal by adding titles and formatting






















Let's analyze a specific resource. If I want to analyze my costs and usage specifically on Cognitive Services, I can select that service from the first chart (Cost by Resource Type), and the other charts will filter accordingly.






















I notice that I've spent more on GPT4 prompt tokens. To analyze further, I can navigate to my second chart (Cost by Resource Plan/Tier) and click on the relevant item.






















This process helps me identify cost patterns and gain a better understanding of how Azure costing operates.

Sunday, February 18, 2024

Optimize Your Azure Spending: How to visualize expenditure across services with Azure Cost Management - Cost Analysis

Managing our cloud expenditures can present a formidable challenge. The presence of multiple tiers and a diverse range of services further complicates the task. However, cost management is very important in building a well-architected cloud.

Azure provides a feature called Cost Management, which is the central place to monitor and govern our cloud expenditure.

The landing page of the Cost Analysis will give you a basic idea on your cloud cost. Additionally, it will show which categories to look after in order to control and govern your costs.



However, you can't drill down to each service to further analyze what products/services caused the expenditure. But, this is analysis is mandatory to implement the Cost Optimization pillar as per the Azure well-architected framework.

Fortunately, the Cost Analysis tool offers distinct dashboards tailored for examining expenses at the service level.

To access these dashboards, simply select the "Services" option from the Cost by Resource menu as shown in the diagram below.


Now you will be navigated to a different dashboard with interesting insights.











If you have multiple workloads originating from a particular service, you can expand that service to view the expenditure breakdown for each individual product or component.




Clicking on a specific service, such as Azure App Service, will navigate you to another dashboard. Notably, this dashboard provides a suggested monthly budget value to assist with financial planning.



With insights gleaned from the aforementioned dashboards, we can make informed decisions regarding our cloud expenditure. By creating tailored budgets for specific services and setting up alerts to notify us when these services are nearing predefined thresholds, we can effectively manage our spending and optimize resource utilization.

Wednesday, February 7, 2024

Interact with the cache using Azure Cache for Redis - Redis Console

Azure Cache for Redis proves immensely valuable for optimizing response times by caching data, thereby mitigating latency. Utilizing this service enables significant enhancements in performance.

You can interact with your Redis cluster redis-cli by installing required tools in your client workstation.

Alternatively, Azure offers a convenient solution directly within the Azure portal: the Redis Console. Accessible through the Console menu, this integrated feature provides a user-friendly interface for streamlined management of your Redis cache.







Within Redis Console, you can interact with your redis cluster using redis-cli commands. Following are some examples

scan 0 //Get current keys

GET hello //Get value for a specific key

HGETALL userprofile //Get value for a specific key where the value is a collection, object





Overall, the experience with Redis console is seamless.