Azure FinOps Essentials

Azure Container Apps: A Cost-Effective Approach to Scalable Hosting

In partnership with

Hi there, and welcome to this week's edition of Azure FinOps Essentials! 🎉

In this edition, I’m exploring Azure Container Apps (ACA) and how its unique pricing structure can help you achieve cost-effective container hosting. ACA offers a serverless, scalable solution tailored for dynamic workloads, with a flexible model that differentiates between active and idle usage.

We’ll break down the cost structure, compare hosting scenarios, and analyze how leveraging features like scaling and free quotas can optimize your expenses. Whether you’re considering ACA for your workloads or simply evaluating container hosting options in Azure, this edition will provide actionable insights to guide your decisions.

Cheers,
Michiel

Azure Container Apps and Cost-Effective Container Hosting

Azure offers several container hosting options, each suited for different scenarios. Among them, Azure Container Apps (ACA) stands out as a fully managed, serverless container service designed for dynamic scalability. Unlike Kubernetes-based solutions like AKS or traditional options like App Services, ACA focuses on simplicity, event-driven workloads, and scaling based on HTTP traffic or events.

This makes ACA a compelling choice for developers building microservices, APIs, or background processing tasks where cost efficiency and ease of use are key. In this edition, we’ll explore how ACA’s pricing model works, what workloads it’s best suited for, and how you can maximize its cost-effectiveness while maintaining flexibility and performance.

Understanding the Cost Structure of Azure Container Apps

Azure Container Apps (ACA) employs a flexible pricing model designed to align costs with actual resource consumption. This model includes a Consumption Plan with serverless, pay-as-you-go pricing and a Dedicated Plan for predictable pricing and specialized hardware. Here's how the cost structure works:

Consumption Plan: Pay-As-You-Go with Free Tiers

The ACA Consumption Plan is perfect for dynamic, event-driven applications. It follows a per-second billing model based on the resources consumed (vCPU and memory) and the number of processed requests. Here’s a breakdown:

  • Free Monthly Allowance:

    • 180,000 vCPU-seconds

    • 360,000 GiB-seconds

    • 2 million requests
      These free grants allow small workloads to run entirely free or help offset costs for larger applications.

  • Active Usage: Charges apply when:

    • A replica is processing requests.

    • CPU usage exceeds 0.01 cores or data received surpasses 1,000 bytes per second.

  • Idle Usage: When replicas are running but not actively processing requests, they incur reduced costs. This helps keep baseline capacity without significant expense.

  • Requests: HTTP requests are billed at $0.40 per million requests, with cost reductions available through savings plans.

Savings Plans for Cost Optimization

Savings plans offer discounts of 15% (1-year plan) or 17% (3-year plan) compared to pay-as-you-go rates. These plans apply to active, idle, and request charges, making them a great option for predictable workloads.

Dynamic Sessions

Dynamic sessions, designed for running untrusted code securely, are billed at $0.03 per session-hour on a pay-as-you-go basis, with similar savings for commitment plans.

Dedicated Plan: Predictable Pricing

For workloads requiring guaranteed single tenancy or specialized hardware, the Dedicated Plan provides consistent pricing based on allocated vCPU and memory resources:

  • Workload Profiles: Each profile specifies the vCPU and memory resources available per instance.

  • Base Management Fee: Ensures high availability and dedicated resources.

  • Multi-App Hosting: Multiple applications can run within a single workload profile to maximize resource efficiency.

The Dedicated Plan is ideal for applications requiring consistent performance, high resource allocation, or strict compliance.

Example: Simple Web Application with Azure Container Apps

Let’s consider a hypothetical workload: a simple web application with a couple of background services. This setup handles most traffic during the day, allowing us to scale down at night to save costs.

Scenario Details

  • Web Application:

    • Runs during the day with ~10 concurrent replicas at peak.

    • Scales down to 1 replica during low-traffic hours.

  • Background Services:

    • Runs batch processing and queue handling tasks.

    • Scales to 0 replicas when idle (event-driven).

Let’s estimate the monthly costs for this setup using the Consumption Plan:

Web Application Cost Estimate

  1. Peak Usage:

    • Active Period: 12 hours/day x 30 days = 360 hours.

    • Replicas: ~10 active replicas.

    • vCPU Allocation: 0.5 vCPU per replica.

    • Memory: 1 GiB per replica.

    Calculation:

    • vCPU Usage: 10 replicas x 0.5 vCPU x 360 hours = 1,800 vCPU-hours (6,480,000 seconds).

    • Memory Usage: 10 replicas x 1 GiB x 360 hours = 3,600 GiB-hours (12,960,000 seconds).

  2. Off-Peak Usage:

    • Active Period: 12 hours/day x 30 days = 360 hours.

    • Replicas: 1 active replica.

    • Same vCPU and memory allocations.

    Calculation:

    • vCPU Usage: 1 replica x 0.5 vCPU x 360 hours = 180 vCPU-hours (648,000 seconds).

    • Memory Usage: 1 replica x 1 GiB x 360 hours = 360 GiB-hours (1,296,000 seconds).

Background Services Cost Estimate

  1. Event-Driven Usage:

    • Active Period: 6 hours/day x 30 days = 180 hours.

    • Replicas: Scales to 1 active replica only when processing tasks.

    • vCPU Allocation: 0.25 vCPU per replica.

    • Memory: 0.5 GiB per replica.

    Calculation:

    • vCPU Usage: 1 replica x 0.25 vCPU x 180 hours = 45 vCPU-hours (162,000 seconds).

    • Memory Usage: 1 replica x 0.5 GiB x 180 hours = 90 GiB-hours (324,000 seconds).

Free Quota Adjustment

  • Free vCPU-seconds: 180,000 seconds (50 vCPU-hours).

  • Free GiB-seconds: 360,000 seconds (100 GiB-hours).

  • Free Requests: 2 million/month.

The free quota significantly offsets the costs for low-usage scenarios like idle replicas or lightweight workloads.

Estimated Monthly Costs (Pay-as-You-Go Pricing)

  • Web Application:

    • vCPU Usage: 6,480,000 + 648,000 - 180,000 (free) = 6,948,000 seconds x $0.000024 = $166.75.

    • Memory Usage: 12,960,000 + 1,296,000 - 360,000 (free) = 13,896,000 seconds x $0.000003 = $41.69.

  • Background Services:

    • vCPU Usage: 162,000 - remaining free 30,000 seconds = 132,000 seconds x $0.000024 = $3.17.

    • Memory Usage: 324,000 - 100,000 free (remaining) = 224,000 seconds x $0.000003 = $0.67.

Total Estimated Cost

  • Web Application: $208.44.

  • Background Services: $3.84.

  • Overall Monthly Cost: ~$212.28.

Key Takeaways

  • By taking advantage of scaling capabilities, you can reduce idle costs and stay within free quotas for lightweight workloads.

  • Scaling to 0 replicas for background services during off-hours minimizes unnecessary expenses.

  • Using Azure Container Apps for event-driven workloads ensures cost alignment with actual usage, making it a highly cost-effective solution.

Conclusion

Azure Container Apps (ACA) provides a flexible and scalable way to host containers, offering a pricing model that uniquely factors in vCPU and memory consumption, distinguishing between active and idle usage. This dynamic approach, combined with its ability to scale down to zero replicas, makes ACA an attractive option for workloads with varying demand.

However, it’s essential to weigh your options carefully. ACA is one of several container hosting services in Azure, each with its own pricing model and feature set. Additionally, keep in mind that pricing can vary by region, so choosing the right location can further optimize your costs.

For workloads that need to scale efficiently and take advantage of serverless container hosting, ACA can be a cost-effective and powerful solution tailored to your needs. Evaluate your use case, leverage the free quota, and carefully plan your architecture to maximize the value ACA offers.

For Those Who Seek Unbiased News.

Be informed with 1440! Join 3.5 million readers who enjoy our daily, factual news updates. We compile insights from over 100 sources, offering a comprehensive look at politics, global events, business, and culture in just 5 minutes. Free from bias and political spin, get your news straight.

Please help me by visiting my sponsor. And interested in sponsoring yourself, then visit the sponsor page.

Thanks for reading this week’s edition. Share with your colleagues and make sure to subscribe to receive more weekly tips. See you next time!

P.S. I have another newsletter about GitHub, Azure, and .NET news. Subscribe as well to keep informed:

MindByte Weekly Pulse: Quick GitHub, Azure, & .NET UpdatesGet to the heart of GitHub, Azure, and .NET with MindByte Weekly Pulse. Every week, find concise, expert-curated insights and trends straight in your inbox. Designed for IT professionals, it's your...

Want more FinOps news, then have a look at FinOps Weekly by Victor Garcia

FinOps WeeklyThe Latest FinOps News Delivered each Sunday

Reply

or to participate.