OpsCanary
Back to daily brief
azurecontainer appsPractitioner

Mastering Scaling Rules in Azure Container Apps

5 min read Microsoft LearnApr 22, 2026
PractitionerHands-on experience recommended

Scaling rules in Azure Container Apps are essential for managing your application's performance and resource efficiency. They allow your app to automatically adjust the number of replicas based on real-time demand, ensuring that you can handle varying loads without manual intervention. This dynamic scaling helps maintain performance while minimizing costs, especially since you aren't billed when your app scales to zero.

Azure Container Apps utilizes KEDA (Kubernetes Event-driven Autoscaling) to manage scaling through a set of declarative rules. You can set parameters like minReplicas and maxReplicas to define the limits of your scaling. For instance, setting minReplicas to 0 and maxReplicas to 5 allows your app to scale between these limits based on traffic. You can implement HTTP scaling rules that trigger additional replicas when concurrent HTTP requests exceed a specified threshold. Similarly, TCP scaling rules can be set to manage concurrent TCP connections. This flexibility allows you to tailor your scaling strategy to your specific application needs.

In production, be aware of some important considerations. You won't incur charges if your app scales down to zero, but idle replicas may still incur a lower billing rate. If you're using Functions on Container Apps, scaling rules are automatically configured, and manual adjustments are not possible. Additionally, TCP scaling rules must be configured using the Azure CLI or Bicep, as they aren't supported in the Azure portal. Always remember to set activeRevisionsMode to single when using non-HTTP event scale rules to avoid unexpected behavior.

Key takeaways

  • Define `minReplicas` and `maxReplicas` to control scaling limits effectively.
  • Implement HTTP scaling rules to manage traffic by setting concurrent request thresholds.
  • Use the Azure CLI or Bicep for configuring TCP scaling rules, as the Azure portal does not support them.
  • Remember that scaling to zero incurs no charges, but idle replicas may still cost you.
  • Set `activeRevisionsMode` to single for non-HTTP event scale rules to ensure proper functionality.

Why it matters

Properly configured scaling rules can significantly reduce costs and improve application responsiveness during traffic spikes. This ensures a better user experience and efficient resource management in production environments.

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

Container Apps jobs don't support HTTP scaling rules or TCP scaling rules. If your application relies on these features, consider alternative solutions that better fit your scaling needs.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.