TIPS & TRICKS TO OPTIMIZE YOUR CLOUD SPENDING — LEVEL — BEGINNER

Cost Optimization in Azure

RK Iyer
7 min readAug 23, 2021

Co-Author — Venkatesh Sankaranarayanan

Walkthrough of different tools that help in optimizing Azure cost

Photo by Blogging Guide on Unsplash

❑ Background

I vividly remember my childhood days where my late grandfather would explain me the importance of savings with a famous proverb “A penny saved is a penny earned”. This saying not only applies to individuals but to organizations who have been trying to manage, optimize their cloud cost & deliver meaningful gains in cost.

In this blog, I will discuss the set of processes & tools which will surely help in overcoming the different cost related challenges & help in controlling, managing & optimizing your Azure cloud spend.

❑ List of all challenges faced by Customer

Usually an Enterprise or even startups born in cloud face some or most of these below challenges.

Various challenges faced by customer

Cost Optimization is a 3-step continuous process

In order to overcome the above challenges, We need to come up with a 3-Step cost optimization process to understand & forecast your cost, control your cost & cost optimize your workloads.

Please note that Cost optimization is not a one time activity but a continuous process.

Cost Optimization -A 3-step continuous process

1. Understand & Forecast your costs

  • Monitor & analyze your Azure bill

It is very important to understand and analyze your Azure spend. Cost Analysis provides you mechanism to view cost and usage information.

Cost Analysis

There are also many ways to customize cost views for deeper analysis looking into Actual cost, Forecast, Budget, Daily costs. Cost Management also has many grouping and filtering options. Now you can apply filters by selecting subscription, date range , month, quarter & tags.

Once you customize your view, Pin your view to a dashboard for quick access, and then share the dashboard with your team so everyone can track costs from a single place.

Please refer Quickstart — Explore Azure costs with cost analysis | Microsoft Docs for more details.

  • Set budget and allocate spending to teams & projects —

Using Budgets, You can create a budget for a monthly, quarterly, or annual period for a scope — subscription or for a management group.

Create Budget — 1
Create Budget — 2

You can select any filters that you want to add such as resource groups in a subscription, or a particular service like virtual machines. You can also configure budget alerts which requires at least one cost threshold (% of budget), and a corresponding email address(upto 5 threshold and 5 email id’s) to receive alerts if the threshold is breached.

Please refer below links for more details —

Tutorial — Create and manage Azure budgets | Microsoft Docs

Quickstart — Create a budget with an Azure Resource Manager template | Microsoft Docs for more details.

  • Estimate the costs for your next Azure projects using Pricing Calculator—
Azure Pricing Calculator

Azure Pricing Calculator will help in estimating the cost for next Azure project. The Azure Pricing Calculator is a free, web-based cost management tool that helps in configuring and estimating the costs for Azure products and features for your specific scenarios.

You can access Azure Pricing Calculator by using this link. Sometimes use “In Private Mode” or “Incognito Mode”. One of the important option is to save & share it as a link or export it as an Excel file, then you can email it and share it with your organization.

2. Control your cost with cloud governance

  • Azure Advisor

Azure Advisor analyzes your configurations and usage telemetry and offers personalized, actionable recommendations to help you optimize your Azure resources for reliability, security, operational excellence, performance, and cost. Azure Advisor provides you with real-time recommendations on your deployed resources.

Azure Advisor score is a key feature of Azure Advisor that aggregates Advisor recommendations into a simple, actionable score. Please refer aka.ms/advisor for more details.

Azure Advisor
  • Identify Orphaned resources

Sometimes you have orphaned resource for which you pay unknowingly. For e.g. When you delete a virtual machine (VM) in Azure, by default, any disks that are attached to the VM aren’t deleted. After a VM is deleted, you will continue to pay for unattached disks. Use the below link to find and delete unattached managed and unmanaged disks. It is important to find out unused or orphaned resources.

Find & delete unattached disks

Find and delete unattached Azure managed and unmanaged disks — Azure Virtual Machines | Microsoft Docs

3. Cost optimize your workloads

It is sometimes very difficult to estimate the workload traffic during peak hours, peak season. It is important to make sure that auto scaling features are used to ensure that the component scales automatically based on the demand. Some workloads are CPU-bound, others memory-bound. For example, you could have a web app that handles millions of requests during the day and none at night. Autoscale can scale your service by any of these metric or by a custom metric you define.

Most of the PaaS components in Azure have auto-scaling feature. e.g. App Gateway, App Services, Azure Databricks, Event hub, Cosmos DB, AKS which helps in scaling up based on high demand and also saving costs by scaling down during off-peak/low demand scenario.

Please refer Autoscaling guidance — Best practices for cloud applications | Microsoft Docs for more details.

  • Well-Architected Review

The Azure Well-Architected Framework is a set of guiding tenets that can be used to improve the quality of a workload. The framework consists of five pillars of architecture excellence: Cost Optimization, Operational Excellence, Performance Efficiency, Reliability, and Security. Incorporating these pillars helps produce a high quality, stable, and efficient cloud architectures.

Well architected review comes up with a list of questions and provides score and recommendation based on answers.

Azure Well Architected Review

Well Architected Cost Optimization pillar helps in managing costs to maximize the value delivered. Please refer http://aka.ms/architecture/review for more details.

Based on my experience below are 8 ways to quickly optimize your Azure costs today –

  1. Shut down unused resources: Identify idle virtual machines, ExpressRoute circuits, and other resources with Azure Advisor. Get recommendations on which resources to shut down and see how much you would save.
  2. Right-size underused resources: Find underutilized resources with Azure Advisor and get recommendations on how to reduce spending by reconfiguring or consolidating them.
  3. Reserve instances for consistent workloads: Save money when you reserve resources in advance. Plus, enjoy monthly payment options at no extra cost.
  4. Take advantage of the Azure Hybrid Benefit: Realize major savings when you bring your Windows Server and SQL Server on-premises licenses with Software Assurance to Azure.
  5. Get Azure Dev/Test pricing for development environments: Get rate discounts on Azure to support development and testing scenarios.
  6. Set up budgets and allocate costs to teams and projects: Create and manage budgets for the Azure services to monitor & control your organization’s cloud spending — with Azure Cost Management.
  7. Explore serverless technologies and new architectures: Optimize your workloads with guidance by using serverless & auto scaling technologies using best practices and proven patterns.
  8. Use B-series VMs: B-series VM’s are used for typically idle applications that have sudden usage bursts. B-series VMs use baseline-level CPU power having you paying only for the minimal usage. When there’s a sudden burst, CPU power increases and you pay extra for the extra used capacity.

❑ Reference

Pricing Calculator | Microsoft Azure

Introduction to analyzing costs and creating budgets with Azure Cost Management — Learn | Microsoft Docs

I hope this blog helped you in familiarizing with tools to help in analyzing, controlling & optimizing costs in Azure.

Till then, Happy Learning!!!

Please Note — All opinions expressed here are my personal views and not of my employer.

Thought of the moment-

Sun is alone too, but still it Shines…

--

--

RK Iyer

Architect@Microsoft, Technology Evangelist, Sports Enthusiast! All opinions here are my personal thoughts and not my employers.