admin管理员组文章数量:1332994
Every time the update command runs, deletes the last Scale Rule, Custom type, a cron job and a memory utilization percentage set
The update command executes and it overlays the previous update, since the Azure Container App is already created. I want to update it after creation, with two or more scale rules (using just one script). How can I add that scale rules (two Custom types, one for Cron job and another one for memory utilization)?
How can I add them to the previously created Azure Container App, exists another kind of solution to add scale rules without using the update command (Azure CLI or Az Modules, other solutions)?
Or, if adding more than one scale rule after the Azure Container App, is creating it simply not possible?
For example, if I run this command again to add another scale rule it will overlay the previous one. How to fix this, if possible?
az containerapp update -n $name -g $rg --scale-rule-name $ruleName --scale-rule-type $customRuleType --scale-rule-metadata start=$start end=$end timezone=$timezone desiredReplicas=$desiredReplicas
Every time the update command runs, deletes the last Scale Rule, Custom type, a cron job and a memory utilization percentage set
The update command executes and it overlays the previous update, since the Azure Container App is already created. I want to update it after creation, with two or more scale rules (using just one script). How can I add that scale rules (two Custom types, one for Cron job and another one for memory utilization)?
How can I add them to the previously created Azure Container App, exists another kind of solution to add scale rules without using the update command (Azure CLI or Az Modules, other solutions)?
Or, if adding more than one scale rule after the Azure Container App, is creating it simply not possible?
For example, if I run this command again to add another scale rule it will overlay the previous one. How to fix this, if possible?
az containerapp update -n $name -g $rg --scale-rule-name $ruleName --scale-rule-type $customRuleType --scale-rule-metadata start=$start end=$end timezone=$timezone desiredReplicas=$desiredReplicas
Share
Improve this question
edited Nov 20, 2024 at 16:58
Thom A
96.1k11 gold badges61 silver badges94 bronze badges
asked Nov 20, 2024 at 16:57
Pedro CostaPedro Costa
271 silver badge6 bronze badges
2
- when you run the az containerapp update command with a scale rule, it will replace the existing scale rules with the new one. Plus, Azure CLI does not currently support adding multiple scale rules in a single command directly. You would need to use the az containerapp update command for each scale rule, but this will overwrite the previous scale rules. – Arko Commented Nov 21, 2024 at 4:16
- Found this on net- techcommunity.microsoft/blog/appsonazureblog/… and github/microsoft/azure-container-apps/issues/1040 – Arko Commented Nov 21, 2024 at 7:55
1 Answer
Reset to default 1When working with Azure Container Apps, the az containerapp update
command has a limitation where it replaces the scale
section entirely with each execution. This behavior can make it tricky to manage multiple scaling rules, as adding a new rule through this command will overwrite any previously configured rules.
To address this, you can manage scaling rules effectively by using a YAML configuration file. Start by exporting the current configuration of your Azure Container App to a YAML file. This ensures that none of the existing settings or rules are lost.
az containerapp show -n sample-app -g ark --output yaml > containerapp-config.yaml
Open the exported containerapp-config.yaml
and locate the scale
section. Modify this section to include all the scaling rules you need.
scale:
minReplicas: 1
maxReplicas: 10
rules:
- name: cron-rule
custom:
type: cron
metadata:
start: "0 0 * * *"
end: "0 1 * * *"
timezone: "UTC"
desiredReplicas: "2"
- name: memory-rule
custom:
type: memory
metadata:
type: "Utilization"
value: "75"
and do az containerapp update -n sample-app -g ark --yaml containerapp-config.yaml
At this time, Azure CLI does not support appending scale rules directly via individual commands. Every execution of az containerapp update
replaces the existing scale
section entirely. For now, managing scale rules through a YAML file is the most reliable approach.
本文标签:
版权声明:本文标题:powershell - Using script commands, how to add multiple scale rules to an Azure Container App? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742343141a2456999.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论