Container Apps - Arm Definition - cooldownPeriod and pollingInterval - where to set?

mf 20 Reputation points
2025-04-10T10:48:34.69+00:00

ARM Template with Definition of Container App working fine with this definition:

                            "scale": {
                                "minReplicas": 0,
                                "maxReplicas": 1
                            }
                        }

but after adding:

                            "scale": {
                                "minReplicas": 0,
                                "maxReplicas": 1,
                                "cooldownPeriod": "500s",
                                "pollingInterval": "200s"
                            }
                        }

I see the error:
Invalid request body for container app. Path: $. Does not conform to Container App schema, please visit for more information https://docs.microsoft.com/azure/container-apps/azure-resource-manager-api-spec?tabs=arm-template#container-app

The entire section:

{
    "type": "Microsoft.Resources/deployments",
    "apiVersion": "2022-09-01",
    "name": "updateContainerAppWithWebhook",
    "dependsOn": [
        "[resourceId('Microsoft.App/containerApps', variables('appName'))]"
    ],
    "properties": {
        "mode": "Incremental",
        "template": {
            "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
            "contentVersion": "1.0.0.0",
            "resources": [
                {
                    "type": "Microsoft.App/containerApps",
                    "apiVersion": "2023-05-01",
                    "name": "[variables('appName')]",
                    "location": "[parameters('location')]",
                    "properties": {
                        "managedEnvironmentId": "[resourceId('Microsoft.App/managedEnvironments', concat(parameters('environmentName'), '-vnet'))]",
                        "configuration": {
                            "activeRevisionsMode": "Single",
                            "ingress": "[if(parameters('useHttpIngress'), variables('httpIngress'), variables('defaultIngress'))]"
                        },
                        "template": {
                            "containers": [
                                {
                                    "name": "app",
                                    "image": "mafamafa/haproxy-env-config:202504021902",
                                    "env": [...{variables romeved]...],
                                    "resources": {
                                        "cpu": "0.5",
                                        "memory": "1Gi"
                                    }
                                }
                            ],
                            "scale": {
                                "minReplicas": 0,
                                "maxReplicas": 1,
                                "cooldownPeriod": "500s",
                                "pollingInterval": "200s"
                            }
                        }
                    }
                }
            ]
        }
    }
},

Where the cooldownPeriod and pollingInterval should be? After I export template they are exacly in this place.

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
691 questions
{count} votes

Accepted answer
  1. Aki Nishikawa 2,455 Reputation points Microsoft Employee
    2025-04-10T11:40:06.1833333+00:00

    Hello, @mf !

    Indeed, the version you specified, 2023-05-01, does not contain either property. https://learn.microsoft.com/en-us/azure/templates/microsoft.app/2023-05-01/containerapps?pivots=deployment-language-arm-template#scale-1

    However, the latest version, e.g. 2025-01-01, contains both properties.

    https://learn.microsoft.com/en-us/azure/templates/microsoft.app/2025-01-01/containerapps?pivots=deployment-language-arm-template#scale-1

    Could you please retry with the latest version?

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Deepanshu katara 16,720 Reputation points MVP Moderator
    2025-04-10T11:31:34.26+00:00

    Hello , Welcome to MS Q&A

    cooldownPeriod and pollingInterval are not direct properties under scale. They belong inside each scaling rule definition.

    Place them inside rules like this:

    "scale": {
      "minReplicas": 0,
      "maxReplicas": 1,
      "rules": [
        {
          "name": "custom-scaler",
          "custom": {
            "type": "cpu",  // or http, memory, etc.
            "metadata": {
              "threshold": "75"
            }
          },
          "cooldownPeriod": "500",
          "pollingInterval": "200"
        }
      ]
    }
    
    
    

    NOTE: The type and metadata depend on what kind of scaling you're implementing — CPU, HTTP, etc.

    Reference

    Please let me know if any more ques

    Kindly accept answer if it helps

    Thanks

    Deepanshu

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.