Following az-cli command not supporting metric for auto-scaling instances on azure app services.
# Create cpu autoscale rule
az monitor autoscale rule create --resource-group $COMMON_RESOURCE_GROUP_NAME \
--subscription $SUBSCRIPTION_ID \
--resource $WEBAPP_NAME \
--resource-type 'Microsoft.Web/sites' \
--autoscale-name "test" \
--condition "Percentage CPU > 75 avg 5m" \
--scale out 1
Response - Exception of type 'Microsoft.WindowsAzure.Management.Monitoring.MonitoringServiceException' was thrown.. [Code: "UnsupportedMetric"]
I followed this Microsoft documentation - https://learn.microsoft.com/en-us/cli/azure/monitor/autoscale/rule?view=azure-cli-latest
I know, how to do auto-scale through azure portal but I want to do this using script.
Basically you create a rule based on how many request the web app gets and scales out its related service plan.