0
0
Azurecloud~30 mins

VM pricing models in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
VM Pricing Models in Azure
📖 Scenario: You are working as a cloud assistant helping a small company understand different Azure Virtual Machine (VM) pricing models. The company wants to compare pay-as-you-go and reserved instance pricing for specific VM types.
🎯 Goal: Build a simple data structure to hold VM pricing information, add a configuration for the pricing model, calculate the monthly cost based on the model, and finalize the configuration for deployment.
📋 What You'll Learn
Create a dictionary with VM types and their pay-as-you-go hourly prices
Add a variable to select the pricing model ('payg' or 'reserved')
Calculate the monthly cost for each VM type based on 730 hours per month
Add a final configuration key to indicate the pricing model used
💡 Why This Matters
🌍 Real World
Cloud architects and cost analysts often compare VM pricing models to optimize cloud spending.
💼 Career
Understanding VM pricing helps in budgeting, cost optimization, and advising clients or teams on cloud infrastructure choices.
Progress0 / 4 steps
1
Create VM pricing dictionary
Create a dictionary called vm_prices with these exact entries: 'Standard_B1s': 0.012, 'Standard_D2s_v3': 0.096, 'Standard_F4s': 0.169. These represent the pay-as-you-go hourly prices in USD.
Azure
Need a hint?

Use curly braces to create a dictionary with the exact keys and values.

2
Add pricing model configuration
Add a variable called pricing_model and set it to the string 'payg' to represent the pay-as-you-go pricing model.
Azure
Need a hint?

Assign the string 'payg' to the variable pricing_model.

3
Calculate monthly VM costs
Create a new dictionary called monthly_costs that calculates the monthly cost for each VM type by multiplying the hourly price from vm_prices by 730 hours. Use a dictionary comprehension with vm and price as variables.
Azure
Need a hint?

Use a dictionary comprehension with for vm, price in vm_prices.items() and multiply price by 730.

4
Add final pricing model key
Add a new key 'pricing_model' to the monthly_costs dictionary and set its value to the pricing_model variable.
Azure
Need a hint?

Assign the pricing_model variable to the 'pricing_model' key in monthly_costs.