New-AzAutoscaleProfile
Creates an Autoscale profile.
语法
CreateWithoutScheduledTimes
New-AzAutoscaleProfile
-Name <String>
-DefaultCapacity <String>
-MaximumCapacity <String>
-MinimumCapacity <String>
-Rule <System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.ScaleRule]>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
CreateWithFixedDateScheduling
New-AzAutoscaleProfile
-Name <String>
-DefaultCapacity <String>
-MaximumCapacity <String>
-MinimumCapacity <String>
-StartTimeWindow <DateTime>
-EndTimeWindow <DateTime>
-TimeWindowTimeZone <String>
-Rule <System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.ScaleRule]>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
CreateUsingRecurrentScheduling
New-AzAutoscaleProfile
-Name <String>
-DefaultCapacity <String>
-MaximumCapacity <String>
-MinimumCapacity <String>
-RecurrenceFrequency <RecurrenceFrequency>
-ScheduleDay <System.Collections.Generic.List`1[System.String]>
-ScheduleHour <System.Collections.Generic.List`1[System.Nullable`1[System.Int32]]>
-ScheduleMinute <System.Collections.Generic.List`1[System.Nullable`1[System.Int32]]>
-ScheduleTimeZone <String>
-Rule <System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.ScaleRule]>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
The New-AzAutoscaleProfile cmdlet creates an Autoscale profile.
示例
Example 1: Create single profile with a fixed date
PS C:\>$Rule = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:05:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "1"
PS C:\> $Profile = New-AzAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -StartTimeWindow 2015-03-05T14:00:00 -EndTimeWindow 2015-03-05T14:30:00 -TimeWindowTimeZone GMT -Rule $Rule -Name "Profile01"
Capacity : Microsoft.Azure.Management.Insights.Models.ScaleCapacity
FixedDate : Microsoft.Azure.Management.Insights.Models.TimeWindow
Name : adios
Recurrence :
Rules : {Microsoft.Azure.Management.Insights.Models.ScaleRule,
Microsoft.Azure.Management.Insights.Models.ScaleRule}
The first command creates an Autoscale rule named Requests, and then stores it in the $Rule variable.
The second command creates a profile named Profile01 with a fixed date using the rule in $Rule.
Example 2: Create a profile with a schedule
PS C:\>$Rule = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:05:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "1"
PS C:\> $Profile = New-AzAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -Rule $Rule -Name "SecondProfileName" -RecurrenceFrequency Minute -ScheduleDay "1", "2", "3" -ScheduleHour 5, 10, 15 -ScheduleMinute 15, 30, 45 -ScheduleTimeZone GMT
Capacity : Microsoft.Azure.Management.Insights.Models.ScaleCapacity
FixedDate :
Name : secondProfileName
Recurrence : Microsoft.Azure.Management.Insights.Models.Recurrence
Rules : {Microsoft.Azure.Management.Insights.Models.ScaleRule,
Microsoft.Azure.Management.Insights.Models.ScaleRule}
The first command creates an Autoscale rule named Requests, and then stores it in the $Rule variable.
The second command creates a profile named SecondProfileName with a recurring schedule using the rule in $Rule.
Example 3: Create profiles with two rules
PS C:\>$Rule1 = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:05:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "1"
PS C:\> $Rule2 = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:10:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "2"
PS C:\> $Profile1 = New-AzAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -StartTimeWindow 2015-03-05T14:00:00 -EndTimeWindow 2015-03-05T14:30:00 -TimeWindowTimeZone GMT -Rule $Rule1, $Rule2 -Name "ProfileName"
PS C:\> $Profile2 = New-AzAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -Rule $Rule1, $Rule2 -Name "SecondProfileName" -RecurrenceFrequency Week -ScheduleDay "1" -ScheduleHour 5 -ScheduleMinute 15 -ScheduleTimeZone UTC
Capacity : Microsoft.Azure.Management.Insights.Models.ScaleCapacity
FixedDate : Microsoft.Azure.Management.Insights.Models.TimeWindow
Name : profileName
Recurrence :
Rules : {Microsoft.Azure.Management.Insights.Models.ScaleRule,
Microsoft.Azure.Management.Insights.Models.ScaleRule}
Capacity : Microsoft.Azure.Management.Insights.Models.ScaleCapacity
FixedDate :
Name : secondProfileName
Recurrence : Microsoft.Azure.Management.Insights.Models.Recurrence
Rules : {Microsoft.Azure.Management.Insights.Models.ScaleRule,
Microsoft.Azure.Management.Insights.Models.ScaleRule}
The first two commands create rules, and store them in the variables $Rule1 and $Rule2, respectively.
The third command creates a profile named ProfileName using the rules in Rule1 and Rule2, and then stores it in the $Profile1 variable.
The final command creates a profile named SecondProfileName using the rules in Rule1 and Rule2, and then stores it in the $Profile2 variable.
Example 4: Create a profile with no schedule or fixed date
PS C:\>$Rule = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:05:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "1"
PS C:\> $Profile = New-AzAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -Rule $Rule -Name "ProfileName"
The first command creates an Autoscale rule named Requests, and then stores it in the $Rule variable.
The second command creates a profile without a schedule or a fixed date, and then stores it in the $Profile variable.
参数
-DefaultCapacity
Specifies the default capacity.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-EndTimeWindow
Specifies the end of the time window.
参数属性
类型: DateTime
默认值: None
支持通配符: False
不显示: False
参数集
CreateWithFixedDateScheduling
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-MaximumCapacity
Specifies the maximum capacity.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-MinimumCapacity
Specifies the minimum capacity.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-Name
Specifies the name of the profile to create.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-RecurrenceFrequency
Specifies the frequency of recurrence.
The acceptable values for this parameter are:
None
Second
Minute
Hour
Day
Week
Month
Year
Not all of these values are supported.
参数属性
类型: RecurrenceFrequency
默认值: None
接受的值: None, Second, Minute, Hour, Day, Week, Month, Year
支持通配符: False
不显示: False
参数集
CreateUsingRecurrentScheduling
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-Rule
Specifies the list of rules to add to the profile.
参数属性
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-ScheduleDay
Specifies the scheduled days.
参数属性
参数集
CreateUsingRecurrentScheduling
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-ScheduleHour
Specifies the scheduled hours.
参数属性
参数集
CreateUsingRecurrentScheduling
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-ScheduleMinute
Specifies the scheduled minutes.
参数属性
参数集
CreateUsingRecurrentScheduling
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-ScheduleTimeZone
Specifies the time zone of the schedule.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
CreateUsingRecurrentScheduling
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-StartTimeWindow
Specifies the start of the time window.
参数属性
类型: DateTime
默认值: None
支持通配符: False
不显示: False
参数集
CreateWithFixedDateScheduling
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
-TimeWindowTimeZone
Specifies the time zone of the time window.
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
CreateWithFixedDateScheduling
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): True
来自剩余参数的值: False
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 .
System.Collections.Generic.List
输出