New-AzAutoscaleProfile
Skapar en autoskalningsprofil.
Syntax
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>]
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>]
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>]
Description
Cmdleten New-AzAutoscaleProfile skapar en autoskalningsprofil.
Exempel
Exempel 1: Skapa en enskild profil med ett fast datum
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}
Det första kommandot skapar en autoskalningsregel med namnet Begäranden och lagrar den sedan i variabeln $Rule. Det andra kommandot skapar en profil med namnet Profile01 med ett fast datum med hjälp av regeln i $Rule.
Exempel 2: Skapa en profil med ett schema
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}
Det första kommandot skapar en autoskalningsregel med namnet Begäranden och lagrar den sedan i variabeln $Rule. Det andra kommandot skapar en profil med namnet SecondProfileName med ett återkommande schema med hjälp av regeln i $Rule.
Exempel 3: Skapa profiler med två regler
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}
De första två kommandona skapar regler och lagrar dem i variablerna $Rule 1 respektive $Rule 2. Det tredje kommandot skapar en profil med namnet ProfileName med hjälp av reglerna i Regel1 och Regel2 och lagrar den sedan i variabeln $Profile 1. Det sista kommandot skapar en profil med namnet SecondProfileName med hjälp av reglerna i Regel1 och Regel2 och lagrar den sedan i variabeln $Profile 2.
Exempel 4: Skapa en profil utan schema eller fast datum
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"
Det första kommandot skapar en autoskalningsregel med namnet Begäranden och lagrar den sedan i variabeln $Rule. Det andra kommandot skapar en profil utan schema eller ett fast datum och lagrar den sedan i variabeln $Profile.
Parametrar
-DefaultCapacity
Anger standardkapaciteten.
Typ: | String |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure
Typ: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
standardvärde: | None |
Obligatorisk: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EndTimeWindow
Anger slutet av tidsfönstret.
Typ: | DateTime |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MaximumCapacity
Anger den maximala kapaciteten.
Typ: | String |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MinimumCapacity
Anger den minsta kapaciteten.
Typ: | String |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Anger namnet på profilen som ska skapas.
Typ: | String |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RecurrenceFrequency
Anger upprepningsfrekvensen. De godtagbara värdena för den här parametern är:
- Nej
- Second
- Minute
- Hour
- Dag
- Vecka
- Månad
- År Alla dessa värden stöds inte.
Typ: | RecurrenceFrequency |
accepterade värden: | None, Second, Minute, Hour, Day, Week, Month, Year |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Rule
Anger listan över regler som ska läggas till i profilen.
Typ: | List<T>[ScaleRule] |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleDay
Anger de schemalagda dagarna.
Typ: | List<T>[String] |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleHour
Anger schemalagda timmar.
Typ: | List<T>[Nullable<T>[Int32]] |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleMinute
Anger de schemalagda minuterna.
Typ: | List<T>[Nullable<T>[Int32]] |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleTimeZone
Anger schemats tidszon.
Typ: | String |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-StartTimeWindow
Anger början av tidsfönstret.
Typ: | DateTime |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TimeWindowTimeZone
Anger tidszonen för tidsperioden.
Typ: | String |
Position: | Named |
standardvärde: | None |
Obligatorisk: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Indata
List<T>[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
List<T>[[System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
List<T>[[Microsoft.Azure.Management.Monitor.Management.Models.ScaleRule, Microsoft.Azure.PowerShell.Cmdlets.Monitor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]