Chapter 13 of 20
Cost Management in Azure: Pricing, Calculators, and Optimization
Translate Azure architecture decisions into real costs by learning how pricing works, how to estimate it, and which tools help keep spending under control.
Cost Management in Azure: Why It Matters
From Architecture to Cost
In Azure, every architecture decision has a cost impact. You must connect technical choices (region, SKU, service type) to how much you pay month to month.
Consumption-Based Pricing
Azure pricing is mostly consumption-based: you pay for what you use in compute, storage, networking, and higher-level services. But the bill depends on more than just 'hours used'.
Key Cost Drivers
Costs are influenced by the service you choose, the region, the SKU or tier, how much data you store and transfer, and whether you use pay-as-you-go or reservations.
Exam Connection
Cost optimization appears mainly in Azure Management and Governance (34%) and Azure Architecture and Services (38%). This module prepares you for those AZ-900 questions.
Key Factors That Influence Azure Costs
Service Selection
Different service models (IaaS, PaaS, SaaS) have different pricing patterns. IaaS charges for VMs and disks; PaaS often charges per capacity tier; SaaS is usually per user.
Region and Location
Azure regions are global locations with different prices. The same VM size can cost more or less depending on the region, and cross-region traffic can add cost.
SKU and Performance Tier
A SKU defines size and performance. More CPU, RAM, or IOPS means a higher price. Choosing an overpowered SKU is a common source of unnecessary cost.
Storage and Data Transfer
Storage type (HDD vs SSD) and redundancy (LRS, ZRS, GRS, RA-GRS) affect price. Inbound data is usually free; outbound data to the internet or other regions is often billed.
Comparing Cost Drivers: A Simple Web App Scenario
Two Design Options
Option A: 2 Windows VMs plus a SQL VM (IaaS). Option B: Azure App Service plus Azure SQL Database (PaaS). Both can host the same web app.
Service Model and Cost
IaaS charges per VM-hour and disk and may require extra licenses. PaaS charges per plan or tier and reduces management overhead, often lowering total cost for small apps.
Region and SKU Choices
Deploying in a region close to users can reduce latency and sometimes cost. Right-sizing SKUs (smaller VM sizes or lower App Service tiers) avoids overpaying.
Storage and Redundancy
Standard HDD with LRS is cheaper than Premium SSD with GRS. If the business does not require geo-redundancy, LRS can be a cost-optimized, exam-friendly option.
Consumption-Based Pricing, Reservations, and Free Services
Pay-As-You-Go
PAYG charges you based on usage: VM uptime, GB stored, GB transferred. It is flexible, with no long-term commitment, but unit prices are higher than reserved options.
Reservations
Reservations let you commit to 1 or 3 years for certain services in a region and SKU, in exchange for a lower price. They are ideal for predictable, always-on workloads.
Spot VMs
Spot VMs use spare capacity at deep discounts but can be evicted. Use them for interruptible tasks like batch jobs, not mission-critical production workloads.
Free and Included Features
Some Azure services have free tiers. Azure Cost Management is included for tracking and analyzing costs in Azure subscriptions and is often the right exam answer.
Using the Azure Pricing Calculator (Conceptual Walkthrough)
What the Pricing Calculator Does
The Azure pricing calculator is a web-based tool to estimate monthly costs for planned solutions before deployment by configuring services and usage.
Basic Workflow
You add services, choose region and SKU, set quantities and usage, then review the total estimated monthly cost and adjust design choices as needed.
VM Estimation Example
For a VM you pick region, OS, VM size, disk type and size, and outbound data. The calculator shows estimated compute, storage, and network costs.
Exam-Relevant Insight
When asked which tool estimates solution cost before deployment, the answer is Azure pricing calculator, not Cost Management or the Azure portal dashboard.
Azure Cost Management + Billing: Tracking and Analyzing Spend
What Cost Management Does
Azure Cost Management + Billing helps you monitor, analyze, and optimize actual and forecasted spending across subscriptions and resource groups.
Core Features
Key features are cost analysis, budgets with alerts, exporting cost data, and recommendations (for example, underutilized VMs) through Azure Advisor.
Billing Structure
Billing accounts receive invoices. Subscriptions are billing and management boundaries where resource charges accumulate before rolling up.
Calculator vs Cost Management
Use the pricing calculator to estimate future costs. Use Cost Management + Billing to view real charges, forecasts, and set budgets and alerts.
Practical Cost Optimization Techniques in Azure
Right-Sizing Resources
Pick VM sizes and tiers that match real needs, use auto-scaling, and shut down dev/test resources when not in use to avoid paying for idle capacity.
Favor PaaS When Possible
When full OS control is not required, PaaS services like App Service or Azure SQL Database can be cheaper and easier to manage than IaaS VMs.
Storage and Redundancy Choices
Use Standard storage and LRS when performance and geo-redundancy are not required. This often appears as the cost-optimized choice in exam questions.
Reservations, Hybrid Benefit, Cleanup
Reservations and Azure Hybrid Benefit cut costs for steady workloads. Regularly delete unused resources and use tags to find cost-saving opportunities.
Thought Exercise: Designing a Cost-Aware Solution
Work through this scenario step by step. You do not need to calculate exact prices; focus on which choices lower cost while still meeting requirements.
Scenario
A startup is building an internal HR web portal used only by employees in one country. Requirements:
- Moderate usage during business hours only
- No strict requirement for OS-level customization
- Must be available from 8:00 to 18:00 local time, Monday to Friday
- Data must be durable, but geo-redundancy is optional
Task 1: Choose service types
- Would you pick Azure Virtual Machines or Azure App Service for the web front end? Why, from a cost and management perspective?
- For the database, would you use a SQL Server VM or Azure SQL Database? Explain your choice.
Task 2: Apply cost levers
- How could you use scheduling or scaling to avoid paying for unused compute outside business hours?
- Which storage redundancy option (LRS or GRS) would you choose, given geo-redundancy is optional? Why?
- If the workload is expected to run for at least 3 years at a steady level, which pricing option (PAYG vs reservations) might be appropriate?
Reflect
Write brief bullet answers for each question. Then, compare your reasoning to these cost-optimization principles:
- Prefer PaaS when OS control is not required.
- Scale down or off during idle periods.
- Use the lowest redundancy level that still meets requirements.
- Use reservations for predictable, long-term workloads.
This is exactly the kind of qualitative reasoning AZ-900 will test, even without asking you to compute exact dollar amounts.
Quiz 1: Tools and Pricing Models
Answer this question to check your understanding of Azure cost tools and pricing models.
Your team is planning a new Azure solution and wants to estimate its monthly cost before deploying any resources. Which Azure feature is the MOST appropriate to use?
- Azure Cost Management + Billing
- Azure pricing calculator
- Azure Advisor security recommendations
- Azure Monitor metrics
Show Answer
Answer: B) Azure pricing calculator
The Azure pricing calculator is specifically designed to estimate the cost of proposed solutions before deployment. Azure Cost Management + Billing is used to analyze actual and forecasted charges after resources are running. Azure Advisor focuses on recommendations, and Azure Monitor tracks performance and health, not pricing estimates.
Quiz 2: Choosing Cost-Optimized Options
Answer this scenario-based question to practice cost-optimization reasoning.
A company runs a steady, always-on production workload on two identical Azure VMs. They expect to keep this workload for at least three years and want to reduce compute costs without changing performance. Which option is MOST appropriate?
- Move the VMs to Spot VMs
- Purchase 3-year reservations for the VM size and region
- Shut down the VMs during nights and weekends
- Change the VM OS from Windows to Linux without other changes
Show Answer
Answer: B) Purchase 3-year reservations for the VM size and region
For a predictable, always-on workload over several years, purchasing 3-year reservations for the specific VM size and region is the classic cost-optimization strategy. Spot VMs are not suitable for critical always-on workloads because they can be evicted. Shutting down VMs conflicts with 'always-on' requirements. Changing OS might affect licensing costs but is not guaranteed or described as acceptable here, whereas reservations directly address the requirement.
Key Cost Management Terms Review
Flip through these cards to reinforce core cost management concepts for AZ-900.
- Azure pricing calculator
- A web-based tool used to estimate the monthly cost of proposed Azure solutions before deployment by configuring services, regions, SKUs, and usage assumptions.
- Azure Cost Management + Billing
- An Azure service that helps you monitor, analyze, and optimize actual and forecasted cloud spending, set budgets and alerts, and understand costs across subscriptions and resource groups.
- Pay-as-you-go pricing
- A consumption-based model where you pay for Azure resources based on actual usage (for example, VM uptime, GB stored, GB transferred) with no long-term commitment.
- Reservations (Reserved Instances / Reserved Capacity)
- Pricing options where you commit to using specific Azure resources (such as VMs or databases) in a region for 1 or 3 years in exchange for a discount compared to pay-as-you-go rates.
- Spot VMs
- Deeply discounted virtual machines that use unused Azure capacity and can be evicted when Azure needs the capacity back; suitable for interruptible workloads, not critical production.
- Right-sizing
- The practice of selecting resource sizes (such as VM SKUs or service tiers) that closely match workload requirements to avoid overpaying for unnecessary capacity.
- LRS vs GRS
- Locally redundant storage (LRS) keeps multiple copies in one region and is cheaper; geo-redundant storage (GRS) replicates data to a secondary region for higher durability at a higher cost.
- Budget (in Azure Cost Management)
- A configurable spending limit for a subscription or resource group that can trigger alerts when actual or forecasted costs exceed defined thresholds.
Key Terms
- Spot VMs
- Deeply discounted virtual machines that use unused Azure capacity and can be evicted when Azure needs the capacity back; suitable for interruptible workloads.
- Reservations
- Pricing options where you commit to using specific Azure resources in a region for 1 or 3 years in exchange for a discount compared to pay-as-you-go rates.
- Right-sizing
- The practice of selecting resource sizes or tiers that closely match workload requirements to avoid overpaying for unused capacity.
- Azure Hybrid Benefit
- A licensing benefit that allows customers with eligible on-premises Windows Server or SQL Server licenses to reduce the cost of running corresponding workloads in Azure.
- Pay-as-you-go pricing
- A consumption-based model where you pay for Azure resources based on actual usage with no long-term commitment.
- Azure pricing calculator
- A web-based tool used to estimate the monthly cost of proposed Azure solutions before deployment by configuring services, regions, SKUs, and usage assumptions.
- Budget (Cost Management)
- A spending limit defined in Azure Cost Management that can trigger alerts when actual or forecasted costs exceed thresholds.
- GRS (Geo-redundant storage)
- A storage redundancy option that replicates data to a secondary Azure region, increasing durability and cost.
- Azure Cost Management + Billing
- An Azure service that helps you monitor, analyze, and optimize actual and forecasted cloud spending, set budgets and alerts, and understand costs across subscriptions and resource groups.
- LRS (Locally redundant storage)
- A storage redundancy option that keeps multiple copies of data within a single Azure region at a lower cost.