Quick Ways to Reduce Your Azure Costs

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.

Top tips to optimize cost savings using free tools and plans as you run workloads in Azure. Identify unnecessary spend in Azure Advisor through cost cutting, take advantage of new commitment-based savings plans based on expected utilization, employ cost avoidance tactics, such as setting budgets and monitoring with Microsoft Cost Management, and contain spend through new automation options. 

 

Matt McSpirit, Azure expert, shares quick ways to save money for existing Azure customers.

 

Main Pic.png

 

Cut unnecessary spend.

1- Commitment based.png

Identify underutilized resources & implement commitment-based savings plans. Get an automated assessment and recommendations to save costs with Azure Advisor.

 

Understand, monitor, and forecast cloud costs.

2- Cost Management.png

See how to use Microsoft Cost Management.

 

Start and stop VMs on a schedule. 

3- budget limits.png

Tips to manage budgets in Azure with automated runbooks.

 

Watch our video here.


QUICK LINKS: 

00:00 — Introduction 

00:54 — Savings with Azure Hybrid Benefit 

02:18 — Constrained vCPU options 

03:30 — Commitment-based savings plans 

05:03 — Savings plans and reserved instances 

06:12 — Microsoft Cost Management 

06:44 — Budget limits and automation runbooks 

08:57 — Azure VM Scale Sets 

11:24 — Storage cost management 

13:00 — Tags 

13:50 — Wrap up

 

Link References: 

Guidance for Azure cost savings at https://aka.ms/Azure-DMWL 

More on Azure Hybrid Benefit at https://aka.ms/HybridBenefit 

Sample scripts for budget automation at https://aka.ms/ACMrunbook 

Best practices for tagging at https://aka.ms/costmgmt/videos

 

Unfamiliar with Microsoft Mechanics? 

As Microsoft’s official video series for IT, you can watch and share valuable content and demos of current and upcoming tech from the people who build it at Microsoft. 

 

Keep getting this insider knowledge, join us on social: 


Video Transcript:

Jeremy Chapman (00:03):
Up next if you’re an existing Azure customer and want to save money now, in the next few minutes we’ll share top tips for how you can do more with less as you run your workloads in Azure, using free tools and plans available to you. Including — cost cutting by identifying unnecessary spend in Azure Advisor, taking advantage of new commitment-based savings plans based on your expected utilization, employing cost avoidance tactics such as setting budgets and monitoring with Microsoft Cost Management, and containing your spend through new automation options and much more. And joining us today to take us through everything is Azure expert, Matt McSpirit, welcome back to the show.

 

Matt McSpirit (00:37):
Always a pleasure. Thanks for having me.

 

Jeremy Chapman (00:38):
Likewise. So now today’s show is part of a two-part series where we start by helping you look for ways to save money right now in Azure. Now we’ll follow that with a second show on tips for workload strategies to achieve ongoing efficiency and also growth. So let’s get right into this, Matt. So where should we look today first as we start to identify workloads where we can save in Azure?

 

Matt McSpirit (00:59):
Well, the advantage of the cloud is you pay for what you use and costs are tied to compute and storage along with the underlying software licensing fees. And there are powerful ways to save on all of these cost factors. So I’ve got two important tips here right out of the gate. Firstly, software licensing can make up to 30 to 40% of your cloud bill. And I cannot stress this enough — if you aren’t already doing so, when you provision your VMs, take advantage of Azure Hybrid Benefit, which lets you reuse existing and even future software licenses in return for 40% savings or more. Now, license portability includes bringing over your RedHat Enterprise Linux and SUSE licenses to Azure, as well as your Windows and SQL Server licenses for reuse across your VMs in Azure or Azure SQL Database PaaS services.

 

(01:47):
So here for example, I’ve got a D series VM with four cores and 14 gigs of RAM. And as soon as I apply the Azure Hybrid Benefit, the average cost per month is reduced by 45%. And there are many other scenarios supported by the Azure Hybrid Benefit, including the use of the Azure Kubernetes Service and Azure Stack HCI on-premises. Additionally, you can get unlimited Windows Server virtualization rights to run on Azure Dedicated Host or on Azure Stack HCI. And you can learn more about this at aka.ms/HybridBenefit.

 

(02:18):
Second, if you have database workloads running in virtual machines that aren’t CPU-intensive, you can save significant costs on compute and licensing by using constrained vCPU capable VMs. Now notice here I’ve got three E16 ads VMs highlighted with 16 cores, 8 cores, and 4 cores. The cost of compute is around $923 regardless of the core count. Now let’s move over to the pricing calculator. If you look at the same VM with 16 cores first, you’ll see that SQL licensing adds almost $4,400 per month to the total cost. And if I choose the constrained 4-core version of the same VM, my licensing costs are reduced to around $1,100, and I still have the same IoPs, and memory, and storage. And that’s because SQL is licensed by cores. So the less cores you have, the less you pay. And the good news is you can switch between sizes in Azure without having to rebuild your instance.

 

Jeremy Chapman (03:18):
And that’s really a great example in terms of right-sizing your resource consumption based on what you actually need. Of course, consumption related costs account for about 60 to 70% of your cloud bills. So what can we do there?

 

Matt McSpirit (03:30):
So this is where knowing your resource consumption for specific workloads is key. Now, not only will this help you stop wasting money on underutilized resources, but knowing your average consumption can help you to take advantage of commitment-based pricing plans that give you significant discounts in return to an agreed amount of spend in Azure. Now, a great starting point for this visibility, that I recommend for everybody, is Azure Advisor. So it’s available to you for free in the Azure Portal and it gives you an automated assessment of your Azure tenant with tailored recommendations across multiple areas, as you can see here. So it defaults to the cost category and there’s a percentage score, which is an indicator of how well I’m acting on the recommendations generated for me. Now, importantly, down the page, I can see recommendations to save costs. So here for example, I can see that I’ve got VMs that are underutilized and there’s a recommendation to right-size them along with the potential yearly savings if I do.

 

(04:24):
Now right sizing your VMs is an important consideration as you look at ways to save based on an agreed level of committed spend in Azure. Now notice that among the top recommendations in the cost score view is to take advantage of an Azure savings plan. Now, if we dig in to see the recommendation details, you’ll see it’s assessed your compute usage over the last 30 days. And with the savings plan, select compute services are unlocked when you commit to spending a fixed hourly amount. Now, if you go above that, you’re billed at regular pay-as-you-go prices. So you can save up to 65% compared to pay-as-you-go prices on many compute services. And the greatest savings, of course, come with a three-year term.

 

Jeremy Chapman (05:03):
And these savings plans, they’re relatively new. So why don’t we go over the difference between savings plans and reserved instances that you might use for compute.

 

Matt McSpirit (05:10):
Well both give you discounts based on level of commitment to Azure. Savings plans for compute give you more flexibility if your resource consumption changes as you can shift to pay-as-you-go pricing when you exceed your average committed consumption. Reserved instances, on the other hand, are for stable, predictable workloads. But for the right workload, there’s a bigger discount, so you can save up to 80% of the cost of compute. So the good news is, is you can use reserved instances and Azure savings plans together, so that whatever compute isn’t covered by reserved instances is covered by your savings plan.

 

Jeremy Chapman (05:42):
And these are all really good levers and big levers actually for capping unnecessary spend. So how can you more proactively then drive cost avoidance?

 

Matt McSpirit (05:50):
Well, there are a number of things that we can do here. So firstly, I recommend setting up an alert for the cost category to get up to date notifications from Azure Advisor on new potential actions for you to take. And by the way, a study by Forrester Research that looked at the total economic impact concluded that you can save up to 20% by acting on Azure Advisor recommendations. Now that said, Microsoft Cost Management gives you the best granular visibility into accumulative spend across your workloads and related resources, and it’s also free. Now to access it, you just open the Azure portal and search for cost, select cost management and billing. From the overview, go to cost analysis. And this gives you a bird’s eye view of actual costs and forecasted spend. It’s easy to gauge your spending patterns and any anomalies if you have them. So it’s a critical resource for understanding, monitoring and forecasting your cloud costs.

 

(06:43):
Now, from a cost avoidance perspective, one of the most important things you can do is to set budgets, which can be for an account or department cost center, or against a specific resource type, subscription, and more. So for example, here I’ve got an accumulative spend view at a subscription level, and the red line indicates where I’m likely to exceed budget. Now, when you set a budget, you can specify up to five thresholds to alert you to different levels of utilization. For example, I’ve got a budget that I’ve started here, and as a best practice, I’ve set up alerts at 50%, 75% and 100%, and specified that I want an email notification for where my thresholds are met. Additionally, and importantly, for any of these alerts, I can assign a specific action group that will trigger specific actions to be taken at either a subscription or resource group level when the budget threshold is reached. So I’ve decided to trigger a VM shutdown when we hit a hundred percent. Now the actions taken by the action groups are easy to define, so you can select from any number of action types to trigger or take action. Here we’re selecting to use an automation runbook, and from there I can choose the runbook I want in this case “Stop VM”, and that’s going to trigger when I hit my specified budget threshold. And if you want to learn more about enforcing budget caps through automation, you can see our sample scripts at aka.ms/ACMrunbook.

 

Jeremy Chapman (08:05):
Automation is probably one of the most impactful things that you can do to keep costs down in the first place.

 

Matt McSpirit (08:09):
Yeah, it is, and there are quite a few levers that we can pull here. There are lots of automation runbooks that you can use. One of the most popular is to start and stop VMs on a schedule, which can be good, for example, for resources like Dev/Test VMs where all virtual machines with a “DevTest” tag are automatically shut down after working hours. Then another good automation area is to manage desktop virtualization. So in Azure Virtual Desktop, you can gain a lot of efficiency by using its built-in depth-first load balancing algorithm. Now this works by only provisioning new hosts as existing hosts reach their utilization limit.

 

Jeremy Chapman (08:44):
I really like that example because automating load balancing and also auto scale can make sure that you aren’t unnecessarily overprovisioning resources, which is an area where you know, Azure VM scale sets can really make a big difference too.

 

Matt McSpirit (08:57):
Right. Azure VM scale sets are great for creating and managing a group of load balanced VMs. They automatically load balance the number of VM instances and work by increasing or decreasing VMs in response to demand or defined schedule. Now I’m glad you mentioned them, because there are some new options with Virtual Machine Scale Sets to more precisely predict the scale-out compute you need and even specific VM types to keep your costs down. Starting with a new capability called Predictive Autoscale that lets you take advantage of machine learning to anticipate when autoscaling is required so that the scale-out occurs precisely when needed based on patterns it sees in trending data from the past seven days or more. Now, this works especially well for workloads that have periodic spikes. Once the system predicts that the percentage CPU load of your Virtual Machine Scale Set will spike, new instances are added based on the minimum and maximum instances set for your VM Scale Set.

 

(09:51):
Now, you can also configure how far in advance you want new instances to be provisioned up to one hour before the predicted workload spike will occur. So this capability can also be set to forecasting your load balancing needs where you don’t necessarily want to trigger a scaling action based on the prediction, but want the forecasting insights. So here, for example, the top chart shows an overlaid comparison of actual versus predicted total CPU percentage. You can view charts from 12 hours to as far back as seven days, and you can also enable predictive autoscale from here once you’re confident in the forecasting model. Now, second and importantly, something I think is a bit of a game changer for VM Scale Sets is the ability under flexible orchestration to now configure the percentage allocation for the number of standard VMs that need to be running at any given time, along with the percentage of Spot VMs in the same scale set. And from there, the system will apply that mix during the scale out. And of course, the great thing about mixing and matching standard VMs and Spot VMs is that you can take advantage of the best pricing in Azure when you need more compute.

 

Jeremy Chapman (10:56):
That’s a super useful tip. And by the way, if you’re new and not familiar with Spot VMs, these are really great for workloads that can handle interruptions like maybe batch processing jobs. And these allow you to really take advantage of capacity that’s in Azure at lower prices. And then when Azure needs that capacity back, it will evict those Spot VMs. And in return, you benefit from significant cost savings. So, so far you’ve really focused on immediate ways that we can reduce our compute and licensing spend. What quick wins then are there in terms of managing the cost of storage?

 

Matt McSpirit (11:27):
So Azure offers multiple storage options and a variety of access tiers for blob storage like hot, which is immediately accessible, followed by cool for data that’s less readily available. And there’s also archive to store your rarely accessed data. Now, matching storage types to your requirements can help save considerable costs, hot being the most expensive. But now in terms of quick wins, there’s a brand new option. Now, it used to be that the larger your disk storage capacity, the more performance potential would come with it. So for example, let’s say your app needs 5,000 IoPs. Now in this case, you’d need to purchase and provision one terabyte of capacity. Azure disk storage premium SSD V2 changes all of that by decoupling storage capacity from your performance requirements for your data disk, which means you don’t have to provision large disk sizes to get the performance you need. Now here’s where it gets interesting. You always get included a baseline performance of 3000 IoPs and 125 megabytes per second, and you can configure the maximum IoPs and throughput that you want so that you aren’t paying for performance that you don’t need. So here I’ll configure my disk size at 10 gigabytes and 5,000 IoPs as before and keep my throughput at 200 megabytes per second. And to put this into context, take a look at the impact on price performance. So you’ll see in this case, I’ve saved around 90%.

 

Jeremy Chapman (12:49):
And all of these costs avoidance tips really manage consumption costs along with license portability and Azure Hybrid Benefit and commitment-based savings plan. All of this, kind of an aggregate together, is really going to add up.

 

Matt McSpirit (13:00):
That’s right. And there’s one more thing on my list of quick wins for cost avoidance. Inherent to both cost management and automation actions is the use of tags. Tags can be assigned at the level of your subscriptions, resource groups, and all the way down to specific resources. And while you can add tags to existing subscriptions and resources, the most effective way of instrumenting them is to set policies to ensure that they’re tagged at the time of deployment. So here in Azure Policy for example, there are multiple pre-built policies that can help you to tag your subscriptions, resource groups and resources. And by the way, you can learn more about best practices for tagging at aka.ms/costmgmt/videos.

 

Jeremy Chapman (13:41):
And these are all really a great set of tips and great overview of all the things that you can do to do more with less and save money right now in Azure. So where can everyone watching learn more?

 

Matt McSpirit (13:52):
Well, I mentioned a number of resources available to you for free. The two key ones are Azure Advisor and Microsoft Cost Management in the Azure Portal. So please check those out. And more guidance can be found at aka.ms/Azure-DMWL.

 

Jeremy Chapman (14:06):
Thanks Matt, and looking forward to inviting you back for part two in our series where we’re going to explore how you can do more with less and look at tips on workload strategies for ongoing efficiency and growth in Azure. Of course, keep checking back to Microsoft Mechanics for all the latest tech updates. Subscribe to our channel if you haven’t already. And as always, thank you for watching.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.