Context

To change a Container App’s scale rules in place (for example the start and end metadata of a KEDA cron rule), the obvious route is: read the app with az containerapp show, edit properties.template, and send it back with az rest --method patch.

Insight

That PATCH fails with:

Bad Request: Unknown properties imageType in ContainerAppContainer are not supported

The containerapp CLI extension adds fields such as imageType to its output that the ARM API version does not accept. So read the resource with az rest against the same api-version you PATCH with, change only what you need, and send the rest back unchanged.

A template PATCH also creates a new revision. Each app shows provisioningState: InProgress for a minute or two, so wait for Succeeded before reading the result. Until then the old values can still show up.

Snippet

Terminal window
url="https://management.azure.com/subscriptions/$SUB/resourceGroups/$RG/providers/Microsoft.App/containerApps/$APP?api-version=2025-01-01"
az rest --method get --url "$url" --query properties.template > template.json
# edit template.json (e.g. scale.rules[].custom.metadata.start/end)
az rest --method patch --url "$url" \
--body "{\"properties\":{\"template\":$(cat template.json)}}"
# wait until every app has settled
az containerapp list -g "$RG" --query "[].{n:name,state:properties.provisioningState}" -o table

az containerapp update --min-replicas/--max-replicas is fine for simple scale values. For custom scale-rule metadata, use the GET → PATCH round trip above.