0
0
Azurecloud~30 mins

Cost optimization pillar in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
Cost Optimization Pillar in Azure Cloud
📖 Scenario: You are working as a cloud engineer for a small company that wants to save money on their Azure cloud resources. Your manager asked you to create a simple setup that tracks resource usage and applies cost-saving configurations.
🎯 Goal: Build a basic Azure resource configuration that includes a list of resources with their costs, a budget threshold, and logic to identify which resources exceed the budget. Finally, add a tag to those resources to mark them for cost review.
📋 What You'll Learn
Create a dictionary of Azure resources with their monthly costs.
Add a budget threshold variable to compare costs.
Write logic to find resources exceeding the budget.
Tag the expensive resources with a 'CostReview' label.
💡 Why This Matters
🌍 Real World
Companies use cost optimization to avoid overspending on cloud resources by tracking usage and tagging expensive resources for review.
💼 Career
Cloud engineers and architects must understand cost management to design efficient, budget-friendly cloud environments.
Progress0 / 4 steps
1
Create Azure resources cost dictionary
Create a dictionary called azure_resources with these exact entries: 'VM1': 120, 'Storage1': 80, 'DB1': 150, 'AppService1': 90
Azure
Need a hint?

Use curly braces to create a dictionary with resource names as keys and costs as values.

2
Add budget threshold variable
Create a variable called budget_threshold and set it to 100 to represent the maximum allowed monthly cost per resource.
Azure
Need a hint?

Just assign the number 100 to the variable named budget_threshold.

3
Identify resources exceeding budget
Create a list called expensive_resources that contains the names of resources from azure_resources whose cost is greater than budget_threshold. Use a list comprehension with resource and cost as variables.
Azure
Need a hint?

Use a list comprehension to filter resources by cost.

4
Tag expensive resources for cost review
Create a dictionary called resource_tags where keys are resource names from azure_resources. For each resource in expensive_resources, set its tag to 'CostReview'. For others, set the tag to 'Normal'.
Azure
Need a hint?

Use a dictionary comprehension with a conditional expression to assign tags.