1 – Azure Hybrid Benefit
Azure services related to servers and direct infrastructure reservation require software licenses, such as Windows Server and SQL Server.
Microsoft offers what’s called Hybrid Benefit. When the software license is required, the service provisioning process asks if you would like to use the hybrid benefit.
If you already have on premises license of Windows or SQL Server, or both, the hybrid benefit is for you. It allows you to migrate your license from on premises to the cloud. After provisioning the resource you have 6 months to completely migrate your resources and disable the license on premises.
The price difference between enabling a resource with hybrid benefit or not is considerable. When you don’t use hybrid benefit you are leasing the license.
Virtual Machines need the license, but not only them. Azure SQL is an example. If you choose to provision your server based on vCores, the license will be required. The DTU provisioning doesn’t require a license.
2- Dev/Test Subscriptions
We always need multiple environments for development and test purposes. Microsoft is aware of this and provide us with a special subscription called Dev/Test subscription.
All the resources will provision on the dev/test subscription will be charged in a different way. Software licenses will not be charged on this subscription.
You can request a dev/test subscription from a MSDN Subscription. Once the subscription is enabled, you may provision all dev/test environments on it. The production environments will stay on your regular subscription.
If you use your regular subscriptions for development and tests your are wasting money.
3- Resource Reservation
If you know in advance you will need to use a resource for a specific amount of time, you can make a resource reservation.
Making a resource reservation you pay in advance for the use of an amount of resources for one year, 3 years or even more. The longer you make a reservation, more savings you have with your resources.
The reservation can be done for both IaaS resources, such as Virtual Machines, and PaaS resources as well, such as Azure SQL, CosmoDB. It’s an important solution to save money.
4- Pricing Calculator
Azure provides a pricing calculator you can use to estimate your expenses with azure services.
You can build your solutions on the pricing calculator, specifying the details of each service and receiving an estimate of the cost, including the total for the solution.
The pricing calculator allows you to build many different estimates, keep them saved and export to excel.
5- Azure Cost Management
Azure has a feature called cost management. You can find cost management on every subscription, but it can analyse information across subscriptions as well. Cost Management includes many other features to manage the cost of the services:
- Forecast: You can analyse a forecast of the service costs according the current costs
- Budgets: Budget objects are an expending limit broke down by each project the company is developing. This can be identified by subscription, resource group or even by tags used on the resources to identify the projects they belong to. The budget objects will generate alerts when some thresholds are reached.
- Alerts: You can create alerts over the costs to notify the correct employee if something goes different than usual
- Advisor: The advisor analyses your Azure usage and give you suggestions to optimize your usage
6- Power BI Cost Application and Power BI Cost Access
Sometimes, specially in big environments with multiple projects, the Cost Management in the portal may not be enough to analyse the costs with the cloud. Here comes Power BI.
Microsoft offers an Azure Cost Management Power BI App ready to analyse Cost Management data. The app can only be used by companies with Enterprise Agreement with Microsoft.
However, Power BI can connect to Cost Management even without an Enterprise Agreement, allowing you to build your own Cost Management solution.
7- Using Policies and Tags for Cost Management
Every Azure resource can receive tags, a set of key/value pair you can customize for you own purpose, to mark and classify resources according your own needs.
One of the pillars considered when planning the Cost Management feature is accountability. Who is responsible for each expense made in the cloud?
Using tags, we can classify each resource by project, department, company branch, or any kind of classification the company needs. The Cost Management features, such as budgets, alerts and many more can use the tags on the resources to break down reports by accountability.
Where the policies fit on this scenario? The policies can check and automatically add tags to the resources, ensuring the governance of the environment, making sure every resource will have the correct tags to be analysed by Cost Management.
I wrote a blog about policies, take a look on https://www.red-gate.com/simple-talk/blogs/how-essential-are-azure-policies/ and https://www.red-gate.com/simple-talk/blogs/azure-sql-tightening-the-security-using-integrated-authentication-only/
8- Optimize Resource Usage
Each resource on Azure has its own tricks about how to optimize the usage. We are not talking about small and simple tricks, but sometimes complex charging plans that requires a good amount of analysis to be used correctly. I will mention some of them:
Azure SQL has the elastic pools. You can include a set of Azure SQL databases into a single resource configuration, sharing the resources, specially when the databases have a different usage pattern.
Besides that you also have the Serverless database, which introduce some advantages but needs to be used very carefully, an unpredictable call to the database will put the server on.
The correct choice between DTU’s or vCores is also an important decision that will affect the cost of the service.
The storage has three different storage layers, Hot, Cold and Archive. If you use them correctly, you will save money, but if you make mistakes, you may be charged the double for each mistake made.
The most basic option is to ensure the virtual machine will be turned off when it’s not being used. For example, VM’s intended to be used during work hours can be turned off at night.
Besides that, the correct choice of the series and the spot machines feature are also important choices to control the costs
The first thing to be sure is if your workload can’t run in a simple Azure SQL Database.
Besides that, you still need to ensure to pause the Dedicated SQL Poll and Spark Poll when possible. This is very important to save money.
These examples illustrate how important a good amount of planning and monitoring is to ensure the costs will not go out of control.
9- Use policies to ensure Resource Usage Optimization
All the resource optimizations mentioned above and many more can be checked and enforced by the use of policies. The policies will show which services are following the best practices defined. They can also enforce them, actively changing the services configuration to make the services compliant.
Of course, you probably can’t enforce the same practices for the entire company. The practices may be different according the departments, projects, company branches and more. The policies support this scenario as well, you can enforce different policies in different levels of the organization.
The secret is to correctly manage the effect and remediation policies, responsible for changing the service to be compliant.
10- Regional Impact
The region of your services can affect the charges in two different ways:
1) The price of the same service in different regions can be different
2) Data transfers across regions are charged on a different rate than data transfers on the same region