0
0
Azurecloud~5 mins

Azure Savings Plans - Commands & Configuration

Choose your learning style9 modes available
Introduction
Azure Savings Plans help you save money on your cloud costs by committing to use a certain amount of compute power over time. This way, you pay less compared to paying for compute resources as you go.
When you know your app will run steadily for a long time and want to reduce costs.
When you want to plan your cloud budget with predictable monthly expenses.
When you want to save money on virtual machines or other compute services without changing your usage.
When you want to avoid surprises from fluctuating cloud bills.
When you want to commit to a one- or three-year plan to get discounts.
Commands
This command creates a new Azure Savings Plan named 'mySavingsPlan' in the East US region. It commits to 100 compute units for one year (P1Y). This commitment helps reduce your compute costs.
Terminal
az savingsplan create --name mySavingsPlan --location eastus --plan-type Compute --commitment 100 --term P1Y
Expected OutputExpected
{ "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.SavingsPlans/savingsPlans/mySavingsPlan", "name": "mySavingsPlan", "planType": "Compute", "commitment": 100, "term": "P1Y", "location": "eastus", "provisioningState": "Succeeded" }
--name - Sets the name of the savings plan.
--plan-type - Specifies the type of savings plan, here for compute resources.
--commitment - Defines the amount of compute units you commit to.
--term - Specifies the duration of the savings plan commitment, e.g., P1Y for one year.
--location - Specifies the Azure region for the savings plan.
This command shows the details of the savings plan named 'mySavingsPlan' in East US. It helps you verify the plan was created and see its current status.
Terminal
az savingsplan show --name mySavingsPlan --location eastus
Expected OutputExpected
{ "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.SavingsPlans/savingsPlans/mySavingsPlan", "name": "mySavingsPlan", "planType": "Compute", "commitment": 100, "term": "P1Y", "location": "eastus", "provisioningState": "Succeeded" }
--name - Specifies the savings plan to show.
--location - Specifies the Azure region of the savings plan.
This command lists all savings plans in the East US region. It helps you see all your active savings plans and their details.
Terminal
az savingsplan list --location eastus
Expected OutputExpected
[{ "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.SavingsPlans/savingsPlans/mySavingsPlan", "name": "mySavingsPlan", "planType": "Compute", "commitment": 100, "term": "P1Y", "location": "eastus", "provisioningState": "Succeeded" }]
--location - Filters savings plans by region.
Key Concept

If you remember nothing else from this pattern, remember: committing to a fixed amount of compute usage with Azure Savings Plans lowers your cloud costs compared to pay-as-you-go pricing.

Common Mistakes
Trying to create a savings plan without specifying the location.
Azure requires a location to know where to apply the savings plan, so the command fails.
Always include the --location flag with a valid Azure region like eastus.
Setting a commitment value that is too low or too high compared to actual usage.
If commitment is too low, you miss savings; if too high, you pay for unused capacity.
Estimate your average compute usage and set the commitment accordingly.
Not verifying the savings plan after creation.
You might think the plan is active when it failed or is pending.
Use az savingsplan show to confirm the plan's provisioning state is 'Succeeded'.
Summary
Create an Azure Savings Plan with az savingsplan create to commit to compute usage and save money.
Check your savings plan details with az savingsplan show to confirm it is active.
List all savings plans in a region with az savingsplan list to manage your commitments.