Cost Optimization in Azure: The Building Blocks

Converting CAPEX to OPEX is one of the top and most lucrative benefits driving organizations toward cloud adoption. The onus is always on fast-paced migration: If we can just get to the cloud quickly, all of our problems will be solved. But is that really the case? Unfortunately, the answer is no. 

Your monthly cloud bill might still be a shocker if you don’t have the right cost management measures in place. Overprovisioned VMs that are rarely used, machines provisioned and forgotten, test machines running 24/7—these are only a few of the many resources hidden in plain sight that could be driving up your monthly cloud bill.

Having worked with many enterprise customers in various phases of their digital transformation journey using Azure, I’ve noticed that even the organizations with the best IT teams need a helping hand when it comes to making the pay-as-you-go model work to their benefit. BP’s Azure adoption story is a great example, as the oil and gas “supermajor” maintains more than 25% of its workloads in Azure.

However, BP experienced some hiccups initially, where manual governance and management processes were simply unable to deliver the level of cost optimization they were hoping for. Eventually, with the help of native tools like Azure Cost Management and Azure Monitor, they were able to reduce their cloud spend by 40%. This reduction was sustained even though their cloud usage doubled when additional workloads were later migrated.

If BP’s success story is any proof, it’s clear that continuous monitoring and optimization of Azure costs should be an integral part of every cloud adoption plan. The first part of this blog series will explore the various tools and services available in Azure to help monitor the cost of resources deployed in the platform. The second part of this blog post will cover the many ways customers can optimize the platform as well as best practices for minimizing cloud spending.

Cloud Cost Monitoring in Azure: Key Considerations

When it comes to Azure cost management and optimization, it can be difficult to know what to look out for, especially for those customers who are new to the platform. Below are some pointers to get you started.

Analyze Usage Patterns

As with any other resource, cloud deployments are also in danger of being deployed and then forgotten until the shocker of a bill arrives. That’s why it’s important to keep a close eye on cloud usage patterns across the board. Visibility into these patterns from the early stages will enable you to make any necessary adjustments. This will also allow you to predict your monthly, quarterly, and yearly cloud bill with greater accuracy.

While Azure’s pricing calculator can be useful during the planning phase, it offers more of an informed estimate. On the ground, the reality will be different; there could be unexpected components resulting in additional costs, such as hosted applications that end up using more network egress and increasing the bandwidth cost. It’s also useful to group resources in order to review usage. For example, if your finance team resource group spending is higher than expected, this could be a call to action to drill down and check for unused premium disks, orphaned VMs, the wrong storage tier, and other issues.

Need Azure content for your tech blog? Talk to us

Cost Allocation

In the pay-as-you-go model, you’re charged only for the resources provisioned and used in your subscription. This, however, can lead to a false sense of security among customers that costs will always remain under control. Reality checkif you don’t want your cloud spend to escalate exponentially, cost allocation and budgets will become more relevant in the OPEX model than in CAPEX.

In order to streamline financial accountability, your business should decide on the cost allocation for subscriptions or resource groups. Maintaining a well-organized cloud resource structure is a prerequisite for this. Once your Azure cloud landscape has been divided into subscriptions and resource groups, it’ll be easy to determine the cost allocation for each business unit within your organization in order to help you monitor cloud usage against the budget.

Rightsizing Resources

Cloud sprawl is real, and it can contribute to a major chunk of your cloud bill if not constantly monitored. Organizations need to identify the cloud resources that are provisioned, used, and discarded but not deleted from the platform at the end of their lifecycle.

It’s equally important to pinpoint underutilized resources. A classic example is the usage of larger SKU VMs for production workloads that do not require high compute power most of the time. A larger SKU is often used simply as a safety net for possible spikes in the production environment. It could even be the result of a 1:1 capacity mapping between on-premises and an Azure VM during a cloud migration. However, an Azure VM has much more advanced scaling capabilities than an on-premises VM. In this example, the larger VM SKU can easily be replaced by a lower VM SKU, which can then be configured to scale horizontally (using VM scale sets) or vertically during peak hours.

For development and test environments, you may also want to consider options such as low-priority VMs or Spot VMs (in preview). In fact, automating the startup and shutdown of dev/test VMs so that they run only during office hours can also lead to significant savings for customers with large-scale deployments in Azure. Rightsizing resources or finding the Azure service that best suits your application requirements is thus the first step towards a cost-optimized cloud deployment.

Tools and Services for Cost Monitoring 

If left unchecked, cloud costs can really pile up and become a nightmare. Thankfully, Azure has a number of built-in tools and services available to help customers optimize their cloud deployments to keep their monthly bills under control. Azure Cloud Management, Cloudyn, and Azure Advisor are all capable of delivering immediate cost benefits for users.

Azure Cost Management

Listed as “cost management + billing” in the Azure portal, the Azure Cost Management service’s cost analysis feature offers comprehensive insights into the costs incurred by your Azure resources—starting from the subscription level. This can then be drilled down to specific resource groups and/or resources.

The service also provides an overview of current costs as well as a monthly forecast based on the current consumption rate. In addition, Azure Cost Management displays cost per service, per location, resource group, and so on, so you can determine where costs are accruing. It also allows you to set a monthly budget for management or resource groups and subscriptions. Moreover, it can be configured to generate alerts to inform admins or business unit owners if the set limit has been exceeded.

Let’s take a look at the sample output from a test subscription below:

Figure 1: Sample report from Azure cost management

This offers an overview of the subscription’s current charges as well as a forecasted cost for the entire month. It also gives a bird’s-eye view of the resource types that are accruing the highest charges; in this case, it’s the storage. There’s an additional cost-by-resource view available, which shows specific resource costs in a tabular format. The level of granularity provided by the service enables administrators to create a breakdown of costs and identify usage trends.

Are you a tech blogger?

We're currently seeking new cloud experts to join our network of influencers. Devops? Serverless? Machine learning?

Azure Advisor

Unused or underutilized VMs, unprovisioned ExpressRoute circuits, idle virtual network gateways, unassociated public IPs, usage of premium storage for snapshots, failed data factory pipelinesthese are all optimization opportunities that may be missed. Azure Advisor monitors such resources and provides recommendations for resizing, deleting, or reconfiguring them. The service also allows you to create alerts so that respective stakeholders are immediately notified when a cost-optimization recommendation is generated.

For organizations that deploy mostly IaaS workloads, Azure Advisor can be a life-saver, as it is able to analyze resources across all subscriptions to identify those elusive overprovisioned or unused VMs. For example, it reviews VM CPU utilization and provides recommendations for rightsizing when the current user-facing workload utilization is found to be less than 40%. Current and target SKU information is provided for such recommendations.

Unused virtual network gateways are another costly resource that can impact your bill. If any of the provisioned gateways have not been used for the past 90 days, the unused gateway will show up in the Azure Advisor cost recommendations, allowing customers to either delete or reconfigure it. Virtual network gateways can rack up $353/month, leading to an annual cost of $4,236. Thus, deleting unused gateways will definitely lead to significant savings on your cloud bill.

Cloudyn

Cloudyn is a cross-platform cost management tool that helps track resource usage across Azure, AWS, and Google Cloud. The tool was acquired by Microsoft, and the features are now being integrated into native Azure cost management. Cloudyn also offers a dashboard for visibility into cost allocation, cost showback, and chargeback. 

CSP subscription users will benefit most from the service, as the Azure cost management service has yet to be deployed for CSP subscriptions. Similarly, AWS cost optimization recommendations are also currently available only through Cloudyn. For these reasons, customers with Azure CSP subscriptions or hybrid cloud deployments can leverage Cloudyn to implement cost control.

Set the Tone for Cost-Optimized Deployments

There are additional tools and services available to help you develop an airtight plan for cost optimization straight from the planning phase, even before the first resource has been deployed in Azure. The first logical step is to use the Azure pricing calculator, which allows you to toggle between the different resource SKUs available to identify those that will deliver the right cost-performance balance. Organizations migrating Windows workloads to Azure should consider the Azure Hybrid Use Benefit (HUB) if they have Windows Server or SQL server licenses.

For example, an Azure SQL Enterprise VM using D4 v2 normally costs $2,873/month, including both compute and license charges. But with HUB, compute costs are reduced to $683/month, which is a whopping 76% in monthly savings for a single VM. Azure Migrate is another tool that can be used to assess and migrate on-premises workloads to rightsized VMs in Azure.

In addition to the tools discussed in this blog post, it’s also important to implement cost optimization best practices for each resource type (e.g., compute, storage, network, identity services, and so on). In part 2 of this blog series, we’ll explore these best practices along with some tried-and-tested tips and tricks to keep your Azure bill under control.

Related posts