Open paulbeattie opened 3 weeks ago
Thank you for opening this issue, we will look into it.
👋 just wondered if there is any update on this?
Hi @paulbeattie
Currently with following command we only support set one scale rule:
az containerapp create --scale-rule-name azure-http-rule --scale-rule-type http --scale-rule-http-concurrency 50
If you want to set multiple scale rules, for workaround, you can use Portal
Or you can use az containerapp create/update --yaml
:
az containerapp show -n {containerapp-name} -g {resource-group-name} -o yaml
properties.template.scale.rules
in {your-yaml-file.yaml}az containerapp update --yaml {your-yaml-file.yaml}
Thanks
Thanks for the reply @Greedygre
This is what we're doing at the moment, well a mix. First we deploy the container app using a similar command to what's outlined above. Once created we then pass scaling rules in a separate command/call. The problem here is we're seeing deploy times of up to 20 mins to fully complete a deploy and cutover.
Looking at the logs the initial deploy is then completed, then the command with the scaling rules is executed by deploying another replica which then has to become healthy before cutover can occur.
I guess in this scenario we need to either migrate fully to the YAML configuration (as you cannot mix standard command opts + YAML) or move to ARM or Bicep to handle our requirements?
I guess in this scenario we need to either migrate fully to the YAML configuration (as you cannot mix standard command opts + YAML) or move to ARM or Bicep to handle our requirements?
Hi @paulbeattie
Yes. I think in this scenario because you need to set multiple scale rules, it would better to migrate to the YAML configuration with az containerapp create/update --yaml
.
Describe the bug
When setting CPU scaling rules as per documentation you cannot set more than one scaling rule.
During the parsing it seems that the CLI only matches against the last scaling rule, all others before the last rule are ignored.
Related command
az containerapp create --name --resource-group --environment --image --registry-server reg.azurecr.io --registry-username --registry-password --target-port 3000 --ingress external --cpu 1 --memory 2 --min-replicas 0 --max-replicas 10 --subscription --scale-rule-name azure-http-rule --scale-rule-type http --scale-rule-http-concurrency 50 --scale-rule-name cpu-scaling-rule --scale-rule-type cpu --scale-rule-metadata "type=Utilization" "value=75" --scale-rule-name memory-scaling-rule--scale-rule-type memory --scale-rule-metadata "type=Utilization" "value=50"
Errors
No errors observed, additional scaling rules are ignored and application deploys successfully.
Issue script & Debug output
Expected behavior
All scaling rules should be respected. Or the documentation should make it explicitly clear that this is not supported and not to supply more than one scaling rule.
Environment Summary
➜ ~ az --version azure-cli 2.63.0
core 2.63.0 telemetry 1.1.0
Extensions: containerapp 0.3.53
Dependencies: msal 1.30.0 azure-mgmt-resource 23.1.1
Python location '/opt/homebrew/Cellar/azure-cli/2.63.0/libexec/bin/python' Extensions directory '/Users/nlbeat/.azure/cliextensions'
Python (Darwin) 3.11.9 (main, Apr 2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response