Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
New-AzAutoscaleScaleRuleObject
- Module:
- Az.Monitor Module
Create an in-memory object for ScaleRule.
Syntax
Default (Default)
New-AzAutoscaleScaleRuleObject
-MetricTriggerMetricName <String>
-MetricTriggerMetricResourceUri <String>
-MetricTriggerOperator <String>
-MetricTriggerStatistic <String>
-MetricTriggerThreshold <Double>
-MetricTriggerTimeAggregation <String>
-MetricTriggerTimeGrain <TimeSpan>
-MetricTriggerTimeWindow <TimeSpan>
-ScaleActionCooldown <TimeSpan>
-ScaleActionDirection <String>
-ScaleActionType <String>
[-MetricTriggerDimension <IScaleRuleMetricDimension[]>]
[-MetricTriggerDividePerInstance <Boolean>]
[-MetricTriggerMetricNamespace <String>]
[-MetricTriggerMetricResourceLocation <String>]
[-ScaleActionValue <String>]
[<CommonParameters>]
Description
Create an in-memory object for ScaleRule.
Examples
Example 1: Create scale rule object
$subscriptionId = (Get-AzContext).Subscription.Id
New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0))
Create scale rule object
Parameters
-MetricTriggerDimension
List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}].
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerDividePerInstance
a value indicating whether metric should divide per instance.
Parameter properties
| Type: | Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerMetricName
the name of the metric that defines what the rule monitors.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerMetricNamespace
the namespace of the metric that defines what the rule monitors.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerMetricResourceLocation
the location of the resource the rule monitors.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerMetricResourceUri
the resource identifier of the resource the rule monitors.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerOperator
the operator that is used to compare the metric data and the threshold.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerStatistic
the metric statistic type. How the metrics from multiple instances are combined.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerThreshold
the threshold of the metric that triggers the scale action.
Parameter properties
| Type: | Double |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerTimeAggregation
time aggregation type. How the data that is collected should be combined over time. The default value is Average.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerTimeGrain
the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute.
Parameter properties
| Type: | TimeSpan |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-MetricTriggerTimeWindow
the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes.
Parameter properties
| Type: | TimeSpan |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ScaleActionCooldown
the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format.
Parameter properties
| Type: | TimeSpan |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ScaleActionDirection
the scale direction. Whether the scaling action increases or decreases the number of instances.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ScaleActionType
the type of action that should occur when the scale rule fires.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ScaleActionValue
the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Outputs
ScaleRule
Azure PowerShell
Feedback
Was this page helpful?
