New-AzureRmAutoscaleProfile
Creates an Autoscale profile.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
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>]
Description
The New-AzureRmAutoscaleProfile cmdlet creates an Autoscale profile.
Examples
Example 1: Create single profile with a fixed date
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}
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-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}
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-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}
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-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"
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.
Parameters
-DefaultCapacity
Specifies the default capacity.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EndTimeWindow
Specifies the end of the time window.
Type: | DateTime |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MaximumCapacity
Specifies the maximum capacity.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MinimumCapacity
Specifies the minimum capacity.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of the profile to create.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | 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.
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
Specifies the list of rules to add to the profile.
Type: | List<T>[ScaleRule] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleDay
Specifies the scheduled days.
Type: | List<T>[String] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleHour
Specifies the scheduled hours.
Type: | List<T>[Nullable<T>[Int32]] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleMinute
Specifies the scheduled minutes.
Type: | List<T>[Nullable<T>[Int32]] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ScheduleTimeZone
Specifies the time zone of the schedule.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-StartTimeWindow
Specifies the start of the time window.
Type: | DateTime |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TimeWindowTimeZone
Specifies the time zone of the time window.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
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]]