Best practices for virtual machine cost optimization

This article describes the best practices for managing costs for virtual machines.

If you'd like to see how the billing model works for virtual machines and how to plan for costs ahead of resource deployment, see Plan to manage costs. If you'd like to learn how to monitor costs for virtual machines, see Monitor costs for virtual machines.

In this article, you'll learn:

  • Best practices for managing and reducing costs for virtual machines
  • How to use Azure policies to manage and reduce costs

Best practices to manage and reduce costs for virtual machines

The following are some best practices you can use to reduce the cost of your virtual machines:

Use policies to help manage and reduce costs for virtual machines

You can use Azure Policy to help govern and optimize the costs of your resources.

There are built-in policies for virtual machines and networking services that can help with cost savings:

  • Allowed virtual machine SKUs - This policy enables you to specify a set of virtual machine size SKUs that your organization can deploy. You could use this policy to restrict any virtual machine sizes that exceed your desired budget. This policy would require updates to maintain as new virtual machine SKUs are added.
  • Network interfaces should not have public IPs - This policy restricts the creation of public IP addresses, except in cases where they are explicitly allowed. Restricting unnecessary exposure to the internet can help reduce bandwidth and virtual network data costs.

You can also make custom policies using Azure Policy. Some examples include:

Next steps

In this article, you learned the best practices for managing and reducing costs for virtual machines and how to use Azure policies to manage and reduce costs.

For more information on virtual machine cost optimization, see the following articles: