New-AzureRmAutoscaleProfile
自動スケーリングのプロファイルを作成します。
警告
AzureRM PowerShell モジュールは、2024 年 2 月 29 日の時点で正式に非推奨になりました。 引き続きサポートを受け、更新を受け取れるようにするために、AzureRM から Az PowerShell モジュールに移行することをお勧めします。
AzureRM モジュールは引き続き機能する可能性がありますが、メインが維持またはサポートされなくなり、ユーザーの判断とリスクで引き続き使用できます。 Az モジュールへの移行に関するガイダンスについては、移行リソースを参照してください。
構文
New-AzureRmAutoscaleProfile
-Name <String>
-DefaultCapacity <String>
-MaximumCapacity <String>
-MinimumCapacity <String>
-Rule <System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.ScaleRule]>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
New-AzureRmAutoscaleProfile
-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>]
New-AzureRmAutoscaleProfile
-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>]
説明
New-AzureRmAutoscaleProfile コマンドレットは、自動スケール プロファイルを作成します。
例
例 1: 固定日のプロファイルを 1 つ作成する
PS C:\>$Rule = New-AzureRmAutoscaleRule -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-AzureRmAutoscaleProfile -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}
最初のコマンドは、Requests という名前の自動スケール ルールを作成し、$Rule変数に格納します。 2 番目のコマンドは、$Ruleのルールを使用して、固定日付の Profile01 という名前のプロファイルを作成します。
例 2: スケジュールを使用してプロファイルを作成する
PS C:\>$Rule = New-AzureRmAutoscaleRule -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-AzureRmAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -Rule $Rule -Name "SecondProfileName" -RecurrenceFrequency Minute -ScheduleDays "1", "2", "3" -ScheduleHours 5, 10, 15 -ScheduleMinutes 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}
最初のコマンドは、Requests という名前の自動スケール ルールを作成し、$Rule変数に格納します。 2 番目のコマンドは、$Ruleのルールを使用して定期的なスケジュールで SecondProfileName という名前のプロファイルを作成します。
例 3: 2 つのルールを使用してプロファイルを作成する
PS C:\>$Rule1 = New-AzureRmAutoscaleRule -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-AzureRmAutoscaleRule -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-AzureRmAutoscaleProfile -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-AzureRmAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -Rule $Rule1, $Rule2 -Name "SecondProfileName" -RecurrenceFrequency Week -ScheduleDays "1" -ScheduleHours 5 -ScheduleMinutes 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}
最初の 2 つのコマンドはルールを作成し、それぞれ変数 $Rule 1 と $Rule 2 に格納します。 3 番目のコマンドは、Rule1 と Rule2 のルールを使用して ProfileName という名前のプロファイルを作成し、$Profile 1 変数に格納します。 最後のコマンドは、Rule1 と Rule2 のルールを使用して SecondProfileName という名前のプロファイルを作成し、$Profile 2 変数に格納します。
例 4: スケジュールまたは固定日付のないプロファイルを作成する
PS C:\>$Rule = New-AzureRmAutoscaleRule -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-AzureRmAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -Rule $Rule -Name "ProfileName"
最初のコマンドは、Requests という名前の自動スケール ルールを作成し、$Rule変数に格納します。 2 番目のコマンドは、スケジュールまたは固定の日付を指定せずにプロファイルを作成し、$Profile変数に格納します。
パラメーター
-DefaultCapacity
既定の容量を指定します。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
Azure との通信に使用される資格情報、アカウント、テナント、サブスクリプション
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EndTimeWindow
時間枠の終了を指定します。
Type: | DateTime |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MaximumCapacity
最大容量を指定します。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MinimumCapacity
最小容量を指定します。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
作成するプロファイルの名前を指定します。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RecurrenceFrequency
繰り返しの頻度を指定します。 このパラメーターの有効値は、次のとおりです。
- なし
- Second
- 分
- Hour
- Day
- 週
- Month
- Year これらの値のすべてがサポートされているわけではありません。
Type: | RecurrenceFrequency |
Accepted values: | None, Second, Minute, Hour, Day, Week, Month, Year |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Rule
プロファイルに追加するルールの一覧を指定します。
Type: | List<T>[ScaleRule] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleDay
スケジュールされた日数を指定します。
Type: | List<T>[String] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleHour
スケジュールされた時間を指定します。
Type: | List<T>[Nullable<T>[Int32]] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleMinute
スケジュールされた分数を指定します。
Type: | List<T>[Nullable<T>[Int32]] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleTimeZone
スケジュールのタイム ゾーンを指定します。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-StartTimeWindow
時間枠の開始を指定します。
Type: | DateTime |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TimeWindowTimeZone
時間枠のタイム ゾーンを指定します。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
入力
List<T>[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
List<T>[[System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
List<T>[[Microsoft.Azure.Management.Monitor.Management.Models.ScaleRule, Microsoft.Azure.Commands.Insights, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null]]