Reputation: 21
I am trying to add an autoscale rule to my app webapp, where I need to scale up 1 instance based on the number of messages from a service bus queue (metric source). I am hoping if someone has insight on how this can be achieved using Azure CLI. The microsoft documentation on autoscale doesn't really cover how I can add metric source as part of the condition.
From the UI: [Metric Scale option from UI]
I am trying to to achieve something similar to this:
az monitor autoscale rule create --resource-group MyResourceGroup --resource MyPlan
--resource-type 'Microsoft.Web/serverfarms' --autoscale-name MyAutoScale
--condition "MessageCount > 20 avg 5m" `
--scale out 2
Looking at the json file, I am trying to get specify these fields in Azure cli
Any help on this topic would be highly apprciated. Thank you.
Upvotes: 2
Views: 144
Reputation: 4776
while creating the az monitor autoscale rule
you have to specify the valid --condition
to process your metrics.
Check the supported Metrics to achieve this.
Refer Service bus metrics to process the autoscale.
Upvotes: 1