0
0
AzureHow-ToBeginner · 4 min read

How to Use Reserved Instances in Azure for Cost Savings

To use Reserved Instances in Azure, purchase a reservation for a specific VM size and region through the Azure portal or CLI, then assign it to your subscription. Azure automatically applies the reservation discount to matching running VMs, reducing your costs without changing your VM deployment.
📐

Syntax

Using Azure Reserved Instances involves these key steps:

  • Purchase Reservation: Choose VM size, region, and term (1 or 3 years).
  • Assign Reservation: Link the reservation to your subscription or resource group.
  • Automatic Discount: Azure applies the discount to matching running VMs automatically.
bash
az reservations reservation-order create --display-name "MyReservation" --reserved-resource-type VirtualMachines --term P1Y --billing-scope "/subscriptions/{subscription-id}" --sku "Standard_D2s_v3" --location "eastus" --quantity 1
💻

Example

This example shows how to buy a 1-year reserved instance for a Standard_D2s_v3 VM in the East US region using Azure CLI. The reservation will automatically apply to any matching VM running in your subscription.

bash
az reservations reservation-order create \
  --display-name "MyD2sReservation" \
  --reserved-resource-type VirtualMachines \
  --term P1Y \
  --billing-scope "/subscriptions/12345678-1234-1234-1234-123456789abc" \
  --sku "Standard_D2s_v3" \
  --location "eastus" \
  --quantity 1
Output
{ "id": "/providers/Microsoft.Capacity/reservationOrders/abcd1234", "name": "MyD2sReservation", "properties": { "provisioningState": "Succeeded", "term": "P1Y", "reservedResourceType": "VirtualMachines", "sku": "Standard_D2s_v3", "location": "eastus", "quantity": 1 } }
⚠️

Common Pitfalls

Common mistakes when using Azure Reserved Instances include:

  • Buying reservations for the wrong VM size or region, so discounts don't apply.
  • Not matching the reservation scope with the subscription or resource group where VMs run.
  • Assuming reservations apply to all VM types; they only apply to exact SKU matches.
  • Not monitoring usage to ensure reservations are fully utilized.
bash
## Wrong: Buying reservation for wrong region
az reservations reservation-order create --sku "Standard_D2s_v3" --location "westus" --quantity 1 --term P1Y --billing-scope "/subscriptions/{subscription-id}"

## Right: Match VM region
az reservations reservation-order create --sku "Standard_D2s_v3" --location "eastus" --quantity 1 --term P1Y --billing-scope "/subscriptions/{subscription-id}"
📊

Quick Reference

Tips for using Azure Reserved Instances effectively:

  • Choose the VM size and region that match your actual usage.
  • Use 1- or 3-year terms based on your long-term needs.
  • Assign reservations at the subscription level for broader coverage.
  • Monitor usage regularly to maximize savings.

Key Takeaways

Purchase Azure Reserved Instances matching your VM size and region to get automatic discounts.
Assign reservations to the correct subscription or resource group for the discount to apply.
Reserved Instances only apply to exact SKU matches, so choose carefully.
Monitor your usage to ensure you fully benefit from your reservations.
Use Azure CLI or portal to manage reservations easily and track savings.