Saurabh Pisolkar
Saurabh Pisolkar

Reputation: 21

Adding Metric Source to Autoscale in AzureCLI for WebApp

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]

enter image description here

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

enter image description here

Any help on this topic would be highly apprciated. Thank you.

Upvotes: 2

Views: 144

Answers (1)

Delliganesh Sevanesan
Delliganesh Sevanesan

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

Related Questions