
Cloud
Learning Level
Azure Cost Management helps track, analyze, and optimize cloud spending.
By the end of this lesson, you'll understand:
# Enable cost management
az costmanagement export create \
--name myexport \
--scope /subscriptions/{subscription-id} \
--storage-account mystorageaccount \
--storage-container costdata \
--timeframe MonthToDate \
--recurrence Monthly# Create budget
az consumption budget create \
--budget-name "monthly-budget" \
--amount 1000 \
--time-grain monthly \
--category cost \
--start-date 2024-01-01
# Set alert threshold
az consumption budget create \
--budget-name "monthly-budget" \
--threshold 80 \
--contact-emails admin@example.com# Purchase RI
az reservations purchase \
--sku Standard_B2s \
--scope Single \
--term P1Y \
--billing-scope /subscriptions/{subscription-id}# Create Spot VM (up to 90% discount)
az vm create \
--resource-group myResourceGroup \
--name mySpotVM \
--image UbuntuLTS \
--priority Spot \
--eviction-policy Deallocate# Tag resource
az resource tag \
--ids /subscriptions/.../myVM \
--tags environment=production project=myproject
# View costs by tag
az costmanagement query create \
--scope /subscriptions/{subscription-id} \
--filter "tags/environment eq 'production'"Explore advanced optimization strategies, or learn about Azure Policy for governance.
Resources
Ojasa Mirai
Master AI-powered development skills through structured learning, real projects, and verified credentials. Whether you're upskilling your team or launching your career, we deliver the skills companies actually need.
Learn Deep • Build Real • Verify Skills • Launch Forward