Blog Feed Post

22 tips to lower Azure pricing and optimize hosting costs

Microsoft Azure provides a powerful set of services to help developers build and deploy their apps. Azure makes it so easy to use… that you can quickly let your Azure hosting costs get out of control…

money out the window

At Stackify, we have been using Azure for over 4 years. We have grown up with Azure as we like to say. We leverage a wide array of different Azure services and spend a small fortune on it every year. We are writing this article to share some of our best tips to lower your azure pricing and optimize your overall Azure costs.

We are going to focus on 5 different ways to lower your costs

  1. Lower your actual azure prices
  2. Figure out what your current costs are
  3. Optimize how you deploy your apps
  4. Improve the performance of your app
  5. Other tips

How to lower Microsoft Azure pricing & effective Azure cost management

One of the easiest thing you can do is simply get some discounts on your bill or get something for free!

1. Pre-pay to get a discount, even on a pay-as-you-go account

Microsoft has offered discounts of 2.5-5% based on 6 or 12 months pre-payment. Check to see if you can take advantage of this. However, an EA agreement may be a better option.

2. Get an EA Agreement for maximum azure discounts

EA agreements require selecting an annual monetary commitment and that locks in a discount rate. You are then billed quarterly for any overages beyond your annual commit.

An EA agreement can save you up to 30% or so for some Azure products. Be warned, the discounting rate schedules are a mess. Just as an example, your discount rate on SQL Azure could be 5% but Cloud Services could be 30% and it is different for every single SKU they sell. There are thousands of SKUs. So be sure to know what Azure services you really need and maximize the discount on those SKUs in your EA agreement.

3. Can you sign up for Bizspark?

Stackify was originally in Bizspark and was able to get a lot of awesome free benefits. Microsoft advertises up to $120,000 in free benefits for startups. Not a bad deal!

4. Can you switch Azure regions for better azure pricing?

Azure pricing varies from one region to another, even in the US. Double check the pricing in various regions to see if you can save a little.

Example: A2 VM in West US is $133.92 but $126.48 in West US 2. Australia East is $168.14

5. Get free money from Microsoft by working with an Azure partner on a project

If you have a big project to move to Azure, you can get some discounts to help incentivize and pay for a Microsoft partner to assist making it happen. We were able to do this to help do a bunch of work with Chef as one example.

Figure out what your current Azure costs are, and organize reporting

Odds are, you don’t know what you don’t know when it comes to how much you are spending and what you are spending it on. It is so each with Azure to spin up new resources and simply forget about them.

6. Know how much you spend on what, which is hard without a tool for it

Microsoft has a couple tools you can use to analyze your billing:

Both of these leave a lot to be desired for any advanced level of reporting. You can connect your EA data to PowerBI which opens up some more opportunities for crunching the data, but you really need to segment the data by project, departments and etc to get more insights in to it.

There are a lot of third party tools available, although appallingly, many of them over $1,000 a month! We recommend using a service called Azure Costs (https://azure-costs.com/) which is inexpensive and does a great job. It has a free tier and paid options from $29 – $199 a month.

Just to give you an idea, you can group the reporting a bunch of different ways to understand if you are spending a lot on VMs, SQL Azure, App Services, etc.

Azure cost management

Group by various fields in Azure Costs

7. Assign Azure spending by project, environment, or client for better reporting

At Stackify we host our production, pre-production, QA, development, and test apps all Azure. When looking at our bill at a high level, there is no good way to know how much we are spending on which environment, which is important to us.

How much we spend in production impacts our margins as a business and we want to also minimize costs in dev/test environments.

We use Azure Costs to organize what we are spending money on. We simply tag each Azure resource and then we can get reporting by the tags to easily see expenses per environment.

Azue pricing tag resources

Tag resources in Azure Costs

We can then get reporting by each tag to understand how we are spending our money

Reporting by tag in Azure Costs

Reporting by tag in Azure Costs

Optimize how you to deploy your apps to save money on Azure

If you are moving an application to Azure, there are a few ways to save money that you may not even be thinking of. Also want to give you some tips on optimizing App Services, Cloud Services, etc.

8. Pick the right type and size of Virtual Machines

If you are using Azure for hosting Virtual Machines, make sure you pick the correct type of instance. There are literally dozens of different types and sizes. Make sure you select the right type based on if you need more memory, CPU, faster disk, etc.

9. Use Azure DevTest Labs to ensure test VMs get auto shutdown to save money

Nothing is more annoying than someone setting up a test server and finding out later you have been paying for it for months and months. Azure DevTest Labs is awesome for creating servers that you need occasionally or just certain hours of the day.

DevTest Labs can automatically turn them on and shut them down on a schedule. This helps a lot with solving the issue of your QA team forgetting to shut down servers before they leave for the day or weekend.

Note: DevTest Labs does not cost anything additional to use. You simply pay for the VMs themselves.

10. Avoid paying for staging slots on Cloud Services

With Azure Cloud Services for Web and Worker roles, you pay the full price for staging slots just like you do production slots. It is a good idea to deploy to staging slots and then swap staging into production to minimize downtime.

Be sure you delete the staging slots as fast possible. Nothing makes me more mad then logging into Azure and seeing a bunch of stuff deployed in staging slots sitting there for no reason.

11. Combine web apps with Azure App Service Plans to reduce server count

One of the absolute best features of Azure is App Services. You can create an App Service Plan which represents 2-3 or more servers and then pack as many web applications as you want on to them.

This is a huge advantage over paying for an entire server for a web application that hardly does anything. We have used Cloud Service Web Roles forever and in some cases have 3 instances for high availability on a web app that gets virtually no traffic. It is a huge waste.

12. Stop using Cloud Service Web Roles unless you have to

Unless you have to use Azure Cloud Services for Web Roles, I would work towards switching your apps to App Services to take advantage of combining multiple apps to fewer servers.

Cloud Services also take FOREVER to deploy to. App Services are light years faster for deploying to.

13. Use Azure Service Fabric or Container Service to combine apps

For the exact same reasons I mention above with App Services and Web roles, look at moving your Worker Roles to Service Fabric or Container Service. Both follow the pattern like App Service Plans where you basically provision a group of servers and then throw a bunch of apps on them.

14. Use auto scaling to reduce costs during off hours

Most apps have busier and slower periods throughout a week or day. Take advantage of auto scaling built into Azure to save some money during slow periods.

These deployment types all support auto scaling:

  • Cloud Services
  • App Services
  • VM Scale Sets (Including Batch, Service Fabric, Container Service)

15. Use Azure PaaS features, don’t roll your own on VMs, unless you have to

I have talked to several people who use Azure and their version of using Azure is setting up some VMs and hosting their app and SQL Server on those VMs.

Leveraging Azure for virtual machines and IaaS is fine, but you are missing out on a lot of opportunity to reduce management costs and lower azure costs as a whole. Unless you have a really, really good reason to use SQL in a VM, buy some third party load balancer running in a VM and other scenarios, just don’t.

At Stackify we leverage every PaaS feature of Azure we can. Including SQL Azure, Redis, Table Storage, Service Bus, etc. The thought of setting up VMs for Redis or some other queuing service seems like a really terrible idea. The only exception to that for us is elasticsearch.

Azure Search is available and is a basic elasticsearch PaaS offering. Due to the sheer size and scale of our elasticsearch cluster, it makes more sense to manage it ourselves.

16. Use SQL Elastic Pools

If you have a lot of databases, you should consider SQL Elastic pools.

With Azure you have to pick a performance tier for each individual database. This works very well and provides a predictable level of performance. However, it also results in over provisioning performance in a lot of cases.

Think of an Azure SQL Elastic Pool as more of a server and you can get assign a bunch of databases to that server. That allows the performance of each database to ebb and flow within the total resources of the server.

At Stackify every one of our clients has their own SQL databases. We literally have hundreds of them and we add new ones and deprovision some every single day. SQL Elastic Pools are critical for us to manage that many databases at scale.

Improve the performance of your application itself

OK, if you have maximized how much you spend on Azure when it comes to your overall azure pricing and how you deploy your apps, it is time to start doing some performance tuning.

I would suggest using some type of APM tool like Retrace, Azure Application Insights, or New Relic.

17. Time to get out the profilers!

If you want to optimize the performance of your code, you need to do some code profiling. There are three different types of profilers and you may need all three to really improve your code.

  • Standard profiler – profile your code on your workstation to look for slow methods in your code
  • Transaction tracing – capture complete web requests via an ASP.NET profiler and review what is happening
  • APM – Track the overall performance of your application and it’s dependencies

18. Identify your most used and slowest web requests or transactions

Look for requests that are taking a lot of time or happen a moderate number of times but take way too long. Look at ASP.NET transaction traces to see if too many SQL queries are happening, slow web services, etc.

Most modern applications are more bound by database or web service calls. If your code itself may be slow, you probably want to use a standard .NET profiler, like the Visual Studio profiler to try and figure out why.

Top Web Requests from Retrace APM

Top Web Requests from Retrace APM

19. Optimize SQL database performance

Every busy application can usually benefit from some basic SQL tuning. SQL Azure has some great basic functionality for performance reporting and index tuning recommendations.

If you need to go deeper, be sure to query the DMVs in SQL to identify which queries are accessed the most, use the most IO, take the longest, etc. Also be careful to see how long the queries take from the point of view from your app.

You can also leverage your APM tool to identify which queries are used the most and what actions in your software are calling them.


Top SQL Queries view from Retrace APM

20. Track usage and performance of all application dependencies

Beyond just SQL server, you application probably makes web service calls, uses queues, caching, and other dependencies, including other Azure features like DocumentDB, Azure Storage, etc.

Make sure that all of those dependencies are performing well and properly scaled via Azure.

Other Ideas to lower azure costs

Here are some other ideas to consider to help lower how much you are spending on azure.

21. Can use a CDN?

A CDN like Cloudflare makes it really easy to add caching of all your static files with no code changes. Cloudflare also has a ton of cool features that can be used to optimize performance.

Azure does have a very simple CDN offering as well that you can try, but it doesn’t do what Cloudflare does.

22. Can use the new Azure cold storage option?

Azure now offers warm and cold Azure storage. Warm is designed for data that is used frequently and cold for data that is rarely used. If you have a lot of data that is hardly used, backups, archives, or other data, be sure to check out cold storage.

Optimizing azure cloud hosting costs

I hope you found this list to be helpful. Be sure to start with some of the simplest ideas to implement and leave optimizing your code for last.

Optimizing your code is by far the hardest part to do and can take an enormous amount of time and regression testing. At Stackify we have APIs that get called millions and millions of times a day. If you have code that gets called as many times as ours, it is definitely worth investing in the low level code optimizations, otherwise… maybe not.

Have any other tips on how to save money on your Azure bill? Please tell us in the comments below!

The post 22 tips to lower Azure pricing and optimize hosting costs appeared first on Stackify.

Read the original blog entry...

More Stories By Stackify Blog

Stackify offers the only developers-friendly solution that fully integrates error and log management with application performance monitoring and management. Allowing you to easily isolate issues, identify what needs to be fixed quicker and focus your efforts – Support less, Code more. Stackify provides software developers, operations and support managers with an innovative cloud based solution that gives them DevOps insight and allows them to monitor, detect and resolve application issues before they affect the business to ensure a better end user experience. Start your free trial now stackify.com

Latest Stories
Modern software design has fundamentally changed how we manage applications, causing many to turn to containers as the new virtual machine for resource management. As container adoption grows beyond stateless applications to stateful workloads, the need for persistent storage is foundational - something customers routinely cite as a top pain point. In his session at @DevOpsSummit at 21st Cloud Expo, Bill Borsari, Head of Systems Engineering at Datera, explored how organizations can reap the bene...
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
Kubernetes is an open source system for automating deployment, scaling, and management of containerized applications. Kubernetes was originally built by Google, leveraging years of experience with managing container workloads, and is now a Cloud Native Compute Foundation (CNCF) project. Kubernetes has been widely adopted by the community, supported on all major public and private cloud providers, and is gaining rapid adoption in enterprises. However, Kubernetes may seem intimidating and complex ...
In his session at 21st Cloud Expo, Michael Burley, a Senior Business Development Executive in IT Services at NetApp, described how NetApp designed a three-year program of work to migrate 25PB of a major telco's enterprise data to a new STaaS platform, and then secured a long-term contract to manage and operate the platform. This significant program blended the best of NetApp’s solutions and services capabilities to enable this telco’s successful adoption of private cloud storage and launching ...
In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It’s clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Tha...
In his general session at 21st Cloud Expo, Greg Dumas, Calligo’s Vice President and G.M. of US operations, discussed the new Global Data Protection Regulation and how Calligo can help business stay compliant in digitally globalized world. Greg Dumas is Calligo's Vice President and G.M. of US operations. Calligo is an established service provider that provides an innovative platform for trusted cloud solutions. Calligo’s customers are typically most concerned about GDPR compliance, application p...
Digital transformation is about embracing digital technologies into a company's culture to better connect with its customers, automate processes, create better tools, enter new markets, etc. Such a transformation requires continuous orchestration across teams and an environment based on open collaboration and daily experiments. In his session at 21st Cloud Expo, Alex Casalboni, Technical (Cloud) Evangelist at Cloud Academy, explored and discussed the most urgent unsolved challenges to achieve f...
You know you need the cloud, but you’re hesitant to simply dump everything at Amazon since you know that not all workloads are suitable for cloud. You know that you want the kind of ease of use and scalability that you get with public cloud, but your applications are architected in a way that makes the public cloud a non-starter. You’re looking at private cloud solutions based on hyperconverged infrastructure, but you’re concerned with the limits inherent in those technologies.
With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
Most technology leaders, contemporary and from the hardware era, are reshaping their businesses to do software. They hope to capture value from emerging technologies such as IoT, SDN, and AI. Ultimately, irrespective of the vertical, it is about deriving value from independent software applications participating in an ecosystem as one comprehensive solution. In his session at @ThingsExpo, Kausik Sridhar, founder and CTO of Pulzze Systems, discussed how given the magnitude of today's application ...
The dynamic nature of the cloud means that change is a constant when it comes to modern cloud-based infrastructure. Delivering modern applications to end users, therefore, is a constantly shifting challenge. Delivery automation helps IT Ops teams ensure that apps are providing an optimal end user experience over hybrid-cloud and multi-cloud environments, no matter what the current state of the infrastructure is. To employ a delivery automation strategy that reflects your business rules, making r...
As you move to the cloud, your network should be efficient, secure, and easy to manage. An enterprise adopting a hybrid or public cloud needs systems and tools that provide: Agility: ability to deliver applications and services faster, even in complex hybrid environments Easier manageability: enable reliable connectivity with complete oversight as the data center network evolves Greater efficiency: eliminate wasted effort while reducing errors and optimize asset utilization Security: imple...
The 22nd International Cloud Expo | 1st DXWorld Expo has announced that its Call for Papers is open. Cloud Expo | DXWorld Expo, to be held June 5-7, 2018, at the Javits Center in New York, NY, brings together Cloud Computing, Digital Transformation, Big Data, Internet of Things, DevOps, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
Blockchain is a shared, secure record of exchange that establishes trust, accountability and transparency across business networks. Supported by the Linux Foundation's open source, open-standards based Hyperledger Project, Blockchain has the potential to improve regulatory compliance, reduce cost as well as advance trade. Are you curious about how Blockchain is built for business? In her session at 21st Cloud Expo, René Bostic, Technical VP of the IBM Cloud Unit in North America, discussed the b...