az monitor autoscale rule
Manage autoscale scaling rules.
For more information on autoscaling, visit: https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitoring-understanding-autoscale-settings.
Commands
Name | Description | Type | Status |
---|---|---|---|
az monitor autoscale rule copy |
Copy autoscale rules from one profile to another. |
Core | GA |
az monitor autoscale rule create |
Add a new autoscale rule. |
Core | GA |
az monitor autoscale rule delete |
Remove autoscale rules from a profile. |
Core | GA |
az monitor autoscale rule list |
List autoscale rules for a profile. |
Core | GA |
az monitor autoscale rule copy
Copy autoscale rules from one profile to another.
az monitor autoscale rule copy --autoscale-name
--dest-schedule
--index
--resource-group
[--source-schedule]
Required Parameters
Name of the autoscale settings.
Name of the profile to copy rules to.
Space-separated list of rule indices to copy, or '*' to copy all rules.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Name of the profile to copy rules from.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az monitor autoscale rule create
Add a new autoscale rule.
For more information on autoscaling, visit: https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitoring-understanding-autoscale-settings.
az monitor autoscale rule create --autoscale-name
--condition
--scale
[--cooldown]
[--profile-name]
[--resource]
[--resource-group]
[--resource-namespace]
[--resource-parent]
[--resource-type]
[--timegrain]
Examples
Scale to 5 instances when the CPU Percentage across instances is greater than 75 averaged over 10 minutes.
az monitor autoscale rule create -g {myrg} --autoscale-name {myvmss} \
--scale to 5 --condition "Percentage CPU > 75 avg 10m"
Scale up 2 instances when the CPU Percentage across instances is greater than 75 averaged over 5 minutes.
az monitor autoscale rule create -g {myrg} --autoscale-name {myvmss} \
--scale out 2 --condition "Percentage CPU > 75 avg 5m"
Scale down 50% when the CPU Percentage across instances is less than 25 averaged over 15 minutes.
az monitor autoscale rule create -g {myrg} --autoscale-name {myvmss} \
--scale in 50% --condition "Percentage CPU < 25 avg 15m"
Create autoscale settings via a guest vm metric enabled from diagnostic extensions. You can use counterSpecifier field retrieved from 'az vmss diagnostics get-default-config' in the `--condition`.
az monitor autoscale rule create -g {myrg} --autoscale-name test --scale out 1 --condition "/builtin/memory/percentavailablememory > 80 total 5m"
Required Parameters
Name of the autoscale settings.
The condition which triggers the scaling action.
Usage: --condition ["NAMESPACE"] METRIC {==,!=,>,>=,<,<=} THRESHOLD {avg,min,max,total,count} PERIOD [where DIMENSION {==,!=} VALUE [or VALUE ...] [and DIMENSION {==,!=} VALUE [or VALUE ...] ...]]
Dimensions can be queried by adding the 'where' keyword and multiple dimensions can be queried by combining them with the 'and' keyword. Values for METRIC and appropriate THRESHOLD values can be obtained from the az monitor metric
command. Format of PERIOD is "##h##m##s".
The direction and amount to scale.
Usage: --scale {to,in,out} VAL[%] Fixed Count: --scale to 5 In by Count: --scale in 2 Out by Percent: --scale out 10%.
Optional Parameters
The number of minutes that must elapse before another scaling event can occur.
Name of the autoscale profile.
Name or ID of the target resource.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Target resource provider namespace.
Target resource parent path, if applicable.
Target resource type. Can also accept namespace/type format (Ex: 'Microsoft.Compute/virtualMachines').
The way metrics are polled across instances.
The form of the timegrain is {avg,min,max,sum} VALUE. Values can be obtained from the az monitor metric
command. Format of VALUE is "##h##m##s".
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az monitor autoscale rule delete
Remove autoscale rules from a profile.
az monitor autoscale rule delete --autoscale-name
--index
--resource-group
[--profile-name]
Required Parameters
Name of the autoscale settings.
Space-separated list of rule indices to remove, or '*' to clear all rules.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Name of the autoscale profile.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az monitor autoscale rule list
List autoscale rules for a profile.
az monitor autoscale rule list --autoscale-name
--resource-group
[--profile-name]
Examples
List autoscale rules for a profile. (autogenerated)
az monitor autoscale rule list --autoscale-name MyAutoscale --profile-name MyProfile --resource-group MyResourceGroup
Required Parameters
Name of the autoscale settings.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Name of the autoscale profile.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.