OpsCanary
azurecontainer appsPractitioner

Mastering Scaling Rules in Azure Container Apps

5 min read Microsoft LearnJul 26, 2026Reviewed for accuracy
Share
PractitionerHands-on experience recommended

Scaling rules in Azure Container Apps exist to ensure your applications can handle varying loads without manual intervention. By setting these rules, you can automatically adjust the number of replicas based on real-time demand, which helps maintain performance and control costs. This is particularly vital in cloud environments where traffic can be unpredictable.

Azure Container Apps leverages KEDA (Kubernetes Event-driven Autoscaling) to manage scaling automatically. You define limits on the minimum and maximum number of replicas, and set rules that dictate when to add or remove these replicas. Key parameters include minReplicas (default 0) and maxReplicas (default 5). For HTTP scaling, you can specify concurrentRequests to determine when to scale out. Similarly, for TCP connections, you can use concurrentConnections. This flexibility allows you to tailor scaling behavior to your application's specific needs.

In production, be aware of some important considerations. You won't incur charges if your app scales to zero, but idle replicas may still incur lower costs. During platform upgrades, you might notice more replicas than expected. Also, scaling rules for Container Apps jobs are limited; they don’t support HTTP or TCP scaling rules. Ensure you understand these limitations to avoid unexpected behavior in your deployments.

Key takeaways

  • Define `minReplicas` and `maxReplicas` to control scaling limits effectively.
  • Utilize HTTP scaling rules with `concurrentRequests` to manage web traffic.
  • Implement TCP scaling rules using `concurrentConnections` for real-time applications.
  • Monitor for unexpected replicas during platform upgrades or maintenance.
  • Remember that idle replicas may still incur costs, albeit at a lower rate.

Why it matters

Effective scaling rules can significantly improve application responsiveness and reduce costs by ensuring resources are only used when needed. This is essential for maintaining performance during traffic spikes while avoiding unnecessary expenses.

Code examples

Bicep
1resource symbolicname 'Microsoft.App/containerApps@2025-02-02-preview' = {
2  ...
3  properties: {
4    ...
5    template: {
6      ...
7      scale: {
8        maxReplicas: 0
9        minReplicas: 5
10        rules: [
11            name: 'http-rule'
12            http: {
13              metadata: {
14                concurrentRequests: '100'
15
CLI
1az containerapp create \
2  --name <CONTAINER_APP_NAME> \
3  --resource-group <RESOURCE_GROUP> \
4  --environment <ENVIRONMENT_NAME> \
5  --image <CONTAINER_IMAGE_LOCATION>
6  --min-replicas 0 \
7  --max-replicas 5 \
8  --scale-rule-name azure-http-rule \
9  --scale-rule-type http \
10  --scale-rule-http-concurrency 100
Bicep
1resource symbolicname 'Microsoft.App/containerApps@2025-02-02-preview' = {
2  ...
3  properties: {
4    ...
5    template: {
6      ...
7      scale: {
8        maxReplicas: 0
9        minReplicas: 5
10        rules: [
11            name: 'tcp-rule'
12            http: {
13              metadata: {
14                concurrentConnections: '100'
15

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
DigitalOceanSponsor

Simple, affordable cloud — VMs, Kubernetes, and managed databases in minutes. Trusted by 600,000+ developers. Spin up a Droplet in 60 seconds.

Try DigitalOcean →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.