Billing and cost management for SaaS workloads on Azure

Running a successful SaaS business requires careful financial planning. You need to manage both how your customers are billed for your solution, and your own resource expenditures. Although these concerns are related, they're distinct. You must optimize both to succeed.

Understanding the costs of running your solution is critical. You need to analyze, manage, optimize, and control these costs. SaaS differs from many other software types because its business model and pricing strategy are directly linked to the solution architecture.

This article provides guidance on billing customers for your solution. It also describes some strategies for understanding and optimizing costs within your business model.

Billing

Most billing models are based on customer usage. A billing model typically requires one or more meters, which track the way your customers use your solution. Common models include license-based billing (such as per user or a flat monthly rate) and consumption-based billing (for example, per transaction). You can use multiple meters together. For example, you can combine per-user and transaction charges.

Design considerations

  • Align billing with costs. You should use customer-friendly billing meters, even though your COGS relies on technical metrics like data volumes and API calls. Mismatches between billing and costs can be risky. Identify and address scenarios where high resource usage doesn't lead to higher customer bills, and adjust your pricing and cost model accordingly.

  • Design for billing. The way in which you bill your customers can influence your solution design.

    For example, you might offer different billing tiers that have varying functionality, performance, or deployment models. You might offer bronze, silver, and gold editions of a solution. Bronze customers might use shared infrastructure, silver customers might use a mix of shared and dedicated, and gold customers might use dedicated and isolated environments. Or you might enable or disable features based on billing plans.

    Planning your billing model early is crucial because retroactive changes can be challenging, although commercial pressures might necessitate adjustments.

Design recommendations

Recommendation Benefit
Design billing meters that are meaningful to your customers.

For example, the number of users or business transactions processed are meters that your customers can understand.
Avoid using metrics that are easy for you to measure but hard for customers to understand, like API requests.
This approach gives your customers confidence in their understanding of your service. It also helps them model their own costs effectively.
Plan the implementation of billing plans or SKUs carefully.

If you offer multiple billing tiers, use a systematic approach.
This approach helps you avoid making last-minute changes to your solution. It also prevents the need for customizing your solution for a single customer, which could lead to operational complexity in the future.
Plan the implementation of discounts carefully.

Pricing discounts can be complex to manage, even if they only affect billing processes.
You'll prevent customer disappointment for discounts that your solution or processes can't deliver.
Consider publishing your solution through the Azure Marketplace, especially if you deploy into customer environments. Azure Marketplace provides a range of services, including management of billing.

Develop a cost model

Before you can optimize your costs, you need to itemize them. Your cost of goods sold (COGS) is the direct cost of delivering your solution. Azure spend is often a significant part of these costs. You might also consider third-party solutions, or you might choose to build custom software. Be aware that all of these options have varied levels of cost, including hidden costs.

Tradeoff: Cost efficiency, functionality, and complexity. When you build your own tooling or supporting software, you can customize it to your needs. However, there are costs to building your own tooling, some of which might not be obvious, such as ongoing maintenance and keeping up with security standards. You offload the responsibility of specialized software to a third party, enabling you to focus on development efforts for your own core business value.

Knowing all of those costs and measuring cloud spend provides a baseline for your solution. It's also important to have a cost model because it can help you to reduce your COGS by identifying high-value items for optimization.

In SaaS development, understanding how customers affect costs is crucial. A cost model represents the marginal cost per customer and identifies how business metrics influence costs. Key metrics include the number of customers, users, and transactions. Azure resource consumption is measured by:

  • Direct resource costs.
  • Usage metrics that indicate the cost proportion for specific customers, such as operations performed on behalf of a specific customer or data volume that you need to store for a customer.

Refer to CO:02 Recommendations for creating a cost model.

Design considerations

  • Estimate your Azure costs and understand how Azure resources are billed. Use tools like pricing calculators to forecast expenses before deployment. After your resources are deployed, analyze, manage, and optimize your cloud spending.

    These Azure tools are essential for cost modeling:

  • Understand how your costs relate to your tenancy model. Your cost model's granularity should reflect and depend on your tenancy model and resource deployment for each of your customers.

    • Dedicated resources. If you host resources for each customer, use tools like Microsoft Cost Management to track costs per customer and roll up costs based on customer-specific resource tags.
    • Shared resources. If the deployed resources are shared among multiple customers, approximate cost splits based on customer size or usage metrics. For example, you can allocate costs by estimating each customer's size by using selected criteria. Alternatively, measure transactions or other metrics per customer. However, the latter method can be complex and time-consuming.
    • Customer-hosted resources. If customers host their resources in their own Azure environments, you might not have direct resource costs, but you should still consider management expenses.
  • Start simple and build gradually. Having a rough cost model is better than not having one. Although cost modeling can be time-consuming and complex, it's crucial for business planning and optimizing costs. Start with a high-level model that uses approximate values, such as:

    • Each customer requires resources X and Y, which cost $100 each.
    • Customers that have more than 500 users need resource Z, which costs $50.
    • 10% of customers require a new load balancing system, which costs $100.

    Add more details as you need to, like if you need to directly charge customers for their consumption, and include other expenses like staff time and support costs.

Design recommendations

Recommendation Benefit
Understand how your Azure resources are billed. You can model your costs more effectively, and you can identify ways to optimize costs.
Develop a service catalog of specific Azure resources and resource SKUs that are part of your architecture. Knowing the specific resources that are required helps you determine the total cost of your solution.
Understand Azure services quotas and limits.

Quotas can limit resource deployment in a subscription, restrict request volumes for a resource, or alter resource behavior.
SaaS solutions are at particular risk of exceeding quotas because of the way they scale. Understanding quotas helps you avoid hard limits and unnecessary costs.
Create a baseline cost model. Cost models help you to understand and forecast your costs and make informed decisions about your architecture based on the effects to your COGS.
Focus on identifying important metrics or approximating costs rather than measuring every detail. Collecting excessive metrics for usage measurement can be counterproductive. It complicates data processing, making it harder to understand customer usage accurately. Additionally, it increases storage and processing costs.
Set a budget per customer or per service. This approach gives you a systematic way to avoid over-spending on customers.
Determine your scale points.

Scaling decisions often depend on key metrics such as the number of customers, users, and transactions. Sales teams can provide projections for these metrics to help with planning.
Scale points help you forecast your costs, relate costs to revenue, and use business metrics to plan for growth in your technical architecture.

Optimize your costs

After you establish a baseline for your cloud spending by measuring costs, you can start optimizing costs. The goal of optimization is to reduce overall expenses while maintaining performance targets.

You should optimize costs in conjunction with good governance practices. For more information, see the cost governance guidance in Governance for SaaS workloads on Azure.

Design considerations

  • Identify cost optimization opportunities. Your cost model, aligned with growth plans, can help you identify high or increasing costs that you can optimize. It can also set customer budgets for ongoing monitoring. Starting with the largest costs, look for opportunities to optimize.

  • Share resources among customers. This approach can help you improve cost efficiency. For example, you might use shared multitenant infrastructure for the front end and dedicated infrastructure for the back-end data layer.

    Tradeoff: Cost efficiency, performance, and capabilities. Ensure that you can manage both shared and dedicated usage, mitigate noisy neighbor issues, and meet data residency and other customer constraints. In some cases, it might not be appropriate to share resources. You might instead need to deploy dedicated infrastructure for each customer by using the Deployment Stamps pattern.

  • Take advantage of Azure offers and discounts. Azure provides a variety of different subscription types, such as the Microsoft Customer Agreement, Enterprise Agreements, and pay-as-you-go. Special subscriptions and credits are available through the Microsoft AI Cloud Partner Program.

    Azure offers reduced rates on certain Azure services for non-production use. Even after you're running your production workload, you can continue to take advantage of the rates through a separate dev/test subscription.

    For more information see, Azure Dev/Test pricing.

    Discounted pricing is available for some services if you commit to a certain expenditure. If you know you need resources for a certain period of time, Azure Reservations discount can be beneficial. Consolidating customer resources can help you qualify for these discounts.

    For more information, see What are Azure Reservations?.

    Refer to CO:05 Recommendations for getting the best rates from providers.

  • Right-size your resources, and eliminate resources you no longer use. Consider the options that Azure provides for resources. For example, Azure offers various options, such as different series of virtual machines, to help you optimize resource allocation.

    For information about choosing the right VM for your solution, see Virtual machine selector.

Design recommendations

Recommendation Benefit
Review the Cost Optimization checklist, a guide for cost management in the cloud. You'll learn approaches that you can use across a variety of Azure services and solution types.
Share costs between customers when feasible, while ensuring that you meet requirements like isolation.

For resources with limited capacity, consider bin packing to share resources.
This approach reduces your overall COGS and your marginal cost for each customer.
Use Azure billing constructs, like credits, subscription types, reservations, and saving plans, to reduce your costs.

For reservations, choose the longest duration you can commit to for the highest discount.
When you use the right type of subscription or commit to a certain level of consumption, you receive significant discounts and reduce your overall COGS.
Adjust the uptime, size, and type of resources to match your business needs and business hours. This approach allows you to take advantage of the elasticity of cloud infrastructure and focus spending on critical times for your business.
Identify and remove unused resources. This approach reduces waste.
Enable Microsoft Cost Management. You'll get access to tools that analyze, monitor, and optimize your spend in the Microsoft Cloud.
Monitor each resource's utilization to ensure optimal use.

Use Azure Advisor and its library of cost optimization recommendations.
This approach ensures that you use deployed and paid resources more effectively. By optimizing resource use, you can achieve better efficiency and cost management.

Additional resources

Multitenancy is a core business methodology for designing SaaS workloads. These articles provide more information about billing considerations:

Next step

Learn about governance to reduce risks, help ensure compliance, and support your organization's business objectives.