Welcome!

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.

img_5877c8b5d04bb

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
Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more business becomes digital the more stakeholders are interested in this data including how it relates to business. Some of these people have never used a monitoring tool before. They have a question on their mind like “How is my application doing” but no id...
Join us at Cloud Expo June 6-8 to find out how to securely connect your cloud app to any cloud or on-premises data source – without complex firewall changes. More users are demanding access to on-premises data from their cloud applications. It’s no longer a “nice-to-have” but an important differentiator that drives competitive advantages. It’s the new “must have” in the hybrid era. Users want capabilities that give them a unified view of the data to get closer to customers and grow business. The...
The current age of digital transformation means that IT organizations must adapt their toolset to cover all digital experiences, beyond just the end users’. Today’s businesses can no longer focus solely on the digital interactions they manage with employees or customers; they must now contend with non-traditional factors. Whether it's the power of brand to make or break a company, the need to monitor across all locations 24/7, or the ability to proactively resolve issues, companies must adapt to...
It is ironic, but perhaps not unexpected, that many organizations who want the benefits of using an Agile approach to deliver software use a waterfall approach to adopting Agile practices: they form plans, they set milestones, and they measure progress by how many teams they have engaged. Old habits die hard, but like most waterfall software projects, most waterfall-style Agile adoption efforts fail to produce the results desired. The problem is that to get the results they want, they have to ch...
IoT solutions exploit operational data generated by Internet-connected smart “things” for the purpose of gaining operational insight and producing “better outcomes” (for example, create new business models, eliminate unscheduled maintenance, etc.). The explosive proliferation of IoT solutions will result in an exponential growth in the volume of IoT data, precipitating significant Information Governance issues: who owns the IoT data, what are the rights/duties of IoT solutions adopters towards t...
Wooed by the promise of faster innovation, lower TCO, and greater agility, businesses of every shape and size have embraced the cloud at every layer of the IT stack – from apps to file sharing to infrastructure. The typical organization currently uses more than a dozen sanctioned cloud apps and will shift more than half of all workloads to the cloud by 2018. Such cloud investments have delivered measurable benefits. But they’ve also resulted in some unintended side-effects: complexity and risk. ...
With the introduction of IoT and Smart Living in every aspect of our lives, one question has become relevant: What are the security implications? To answer this, first we have to look and explore the security models of the technologies that IoT is founded upon. In his session at @ThingsExpo, Nevi Kaja, a Research Engineer at Ford Motor Company, discussed some of the security challenges of the IoT infrastructure and related how these aspects impact Smart Living. The material was delivered interac...
The taxi industry never saw Uber coming. Startups are a threat to incumbents like never before, and a major enabler for startups is that they are instantly “cloud ready.” If innovation moves at the pace of IT, then your company is in trouble. Why? Because your data center will not keep up with frenetic pace AWS, Microsoft and Google are rolling out new capabilities. In his session at 20th Cloud Expo, Don Browning, VP of Cloud Architecture at Turner, posited that disruption is inevitable for comp...
In 2014, Amazon announced a new form of compute called Lambda. We didn't know it at the time, but this represented a fundamental shift in what we expect from cloud computing. Now, all of the major cloud computing vendors want to take part in this disruptive technology. In his session at 20th Cloud Expo, Doug Vanderweide, an instructor at Linux Academy, discussed why major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform are all trying to sidestep VMs and containers wit...
While DevOps most critically and famously fosters collaboration, communication, and integration through cultural change, culture is more of an output than an input. In order to actively drive cultural evolution, organizations must make substantial organizational and process changes, and adopt new technologies, to encourage a DevOps culture. Moderated by Andi Mann, panelists discussed how to balance these three pillars of DevOps, where to focus attention (and resources), where organizations might...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
No hype cycles or predictions of zillions of things here. IoT is big. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, Associate Partner at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He discussed the evaluation of communication standards and IoT messaging protocols, data analytics considerations, edge-to-cloud tec...
When growing capacity and power in the data center, the architectural trade-offs between server scale-up vs. scale-out continue to be debated. Both approaches are valid: scale-out adds multiple, smaller servers running in a distributed computing model, while scale-up adds fewer, more powerful servers that are capable of running larger workloads. It’s worth noting that there are additional, unique advantages that scale-up architectures offer. One big advantage is large memory and compute capacity...
New competitors, disruptive technologies, and growing expectations are pushing every business to both adopt and deliver new digital services. This ‘Digital Transformation’ demands rapid delivery and continuous iteration of new competitive services via multiple channels, which in turn demands new service delivery techniques – including DevOps. In this power panel at @DevOpsSummit 20th Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, panelists examined how DevOps helps to meet the de...
Cloud applications are seeing a deluge of requests to support the exploding advanced analytics market. “Open analytics” is the emerging strategy to deliver that data through an open data access layer, in the cloud, to be directly consumed by external analytics tools and popular programming languages. An increasing number of data engineers and data scientists use a variety of platforms and advanced analytics languages such as SAS, R, Python and Java, as well as frameworks such as Hadoop and Spark...