skip to content
Alvin Lucillo

Apply container app config yaml file

/ 1 min read

Using yesterday’s entry’s app-config.yaml, the autoscaling configuration is modified for faster scale-down and larger maximum replica count.

Before:

    scale:
      cooldownPeriod: 300
      maxReplicas: 1
      minReplicas: 1
      pollingInterval: 30

After:

    scale:
      cooldownPeriod: 200
      maxReplicas: 5
      minReplicas: 1
      pollingInterval: 30

Pass the config yaml file via --yaml argument

az containerapp update \
    --name $CONTAINER_APP_NAME \
    --resource-group $RESOURCE_GROUP \
    --yaml app-config.yaml
The behavior of this command has been altered by the following extension: containerapp
{
  "id": "[REDACTED]",
  "identity": {
    "principalId": "[REDACTED]",
    "tenantId": "[REDACTED]",
    "type": "SystemAssigned"
  },
  "location": "[REDACTED]",
  "name": "[REDACTED]",
  "properties": {
    "environmentId": "[REDACTED]",
    "latestRevisionFqdn": "[REDACTED]",
    "latestRevisionName": "[REDACTED]",
    "outboundIpAddresses": ["[REDACTED]"],
    "provisioningState": "Succeeded",
    "runningStatus": "Running",
    "template": {
      "containers": [
        {
          "image": "[REDACTED]",
          "name": "[REDACTED]"
        }
      ],
      "scale": {
        "cooldownPeriod": 200,
        "maxReplicas": 5,
        "minReplicas": 1,
        "pollingInterval": 30,
        "rules": null
      }
    }
  },
  "resourceGroup": "[REDACTED]",
  "systemData": {
    "createdBy": "[REDACTED]",
    "lastModifiedBy": "[REDACTED]"
  }
}

Retrieving the autoscaling configuration now shows updated rules.

az containerapp show \
    --name $CONTAINER_APP_NAME \
    --resource-group $RESOURCE_GROUP \
    --query "properties.template.scale"
The behavior of this command has been altered by the following extension: containerapp
{
  "cooldownPeriod": 200,
  "maxReplicas": 5,
  "minReplicas": 1,
  "pollingInterval": 30,
  "rules": null
}