Tops Tricks to Save Your Money with Azure Virtual Machines

Contributed by Daniyal Saleem |  Azure MVP

Daniyal Saleem

has a variety of strong technical & management skills.He has also been awarded by Microsoft Most Valuable Professional (MVP) 2016, "Windows Development", Microsoft community Contributor 2011-2016, Microsoft Student Partner 2012-2014. He has received more than 30+ awards in his career.

linkedin.com/in/daniyalsaleem

http://daniyalsaleemmvp.blogspot.co.uk/

This post contains tips and tricks you can use to save your money on your Virtual Machines (VMs) running in the Microsoft Azure cloud. The cost analysis of the cloud can be scary at first, and it’s actually one of the reasons companies are shy to start adopting the cloud. Once you know these tricks you’ll feel confident that you won’t overspend and go broke in Microsoft Azure.

Some of these tips are almost secrets, as they aren’t really talked about anywhere. I know these from my years of experience working with Microsoft Azure and getting to know many of the ins and outs of the platform. So, read below, and benefit from my years of Azure experience in just a few minutes.

Using these tips will certainly help you save your company or organization money, and will likely impress your boss!

 

 

Research Azure Region Pricing

There’s a little known secret to the pricing of Virtual Machines in Microsoft Azure. The secret is…
Not all Azure Regions will have the same pricing for the same resources. This includes Virtual Machine pricing tiers as well. Yes, you are understanding this correctly! The cost of Azure actually varies from Azure Region to Region!
While you generally should provision your Virtual Machines and other resources within the closest Azure Region to your customer and users, you may find there to be a pricing benefit of choosing one Azure Region over another.

Deallocate VMs when not in use:

There are many Virtual Machine workloads that are only needed a certain amount of time. These VMs may be used to run a monthly process or are only used to connect to with Remote Desktop during business hours. There could also be other reasons your VMs might only be used a fraction of the time that’s FAR less than 24 hours a day / 7 days a week.

By Deallocating (or stopping) your VM when they’re not in use, you can save hosting costs pretty amazingly. The reason this works is that the CPU, Memory and other hardware reserved for the VM is released. This allows Azure to let someone else’s VM use that hardware, so you are no longer on the hook to pay for it. Then when you need to use the VM again, you can simple start it back up again and get to work.

There are 2 ways to manage Deallocating VMs when they aren’t in use:

- Manually Stop (Deallocate)

The first option is to go into the Azure Portal, navigate to the Virtual Machine blade for the VM in question and then click the “Stop” button. This will essentially work to turn off your VM, and it will deallocate the resources for the VM as well.

Virtual Machines can also be Stopped this way to deallocate resources through the use of the Azure CLI (Cross-Platform Command-line) or the Azure PowerShell cmdlets.

- Configure Auto-shutdown:

The second option is to configure the Auto-shutdown feature of the Virtual Machine you wish to Stop and Deallocate. With VM Auto-shutdown you’re able to configure a specific Time (including Time Zone) when Azure is to automatically shutdown the VM and deallocate it’s resources.

This option can be particularly useful when there’s a chance that you or someone else might forget to Stop and Deallocate the VM manually.

Use Azure Storage for SMB File Shares

There are many times when you might be required to have an SMB File Share. Generally you would spin up a Virtual Machine with plenty of storage capacity to use. While you could do this in Azure, it’s actually more cost effective to make use of the Azure Storage PaaS (Platform as a Service) features for creating an Azure File Share instead.

With Azure Storage File Shares, you don’t need to maintain any Virtual Machines. This mean you don’t have to worry about any Operating System patches or software updates. The Storage service is completely managed for you by Microsoft since it is a PaaS offering.

Also, an added benefit you get from Azure Storage File Shares, over an on-premises setup, is that you automatically get data redundancy (in triplicate) as a built-in feature of the Azure Storage service. As compared to On-premises where you would need to setup and manage a hardware RAID or use Windows Storage Spaces to implement a similar data redundancy setup.

Delete Unnecessary Resources

Unused resources like VMs, Storage Accounts, Web Apps, and on, and on will keep costing you money in some fashion if you keep them around. If you’ll need them in the future then it may be necessary. However, if you will never need them again, then you should probably remove or delete those resources from your Azure Subscription.

Removing or Deleting resources in an Azure Subscription can easily be performed within the Azure Portal, or using the scripting tools like the Azure PowerShell cmdlets and Azure CLI (Cross-Platform Command-line interface)