< Back

Add-AzureRmAutoscaleSetting

Tue Jan 29, 2019 9:48 pm

NAME Add-AzureRmAutoscaleSetting



SYNOPSIS

Creates an Autoscale setting.





SYNTAX

Add-AzureRmAutoscaleSetting [-AutoscaleProfile

<System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.AutoscaleProfile]>] [-DefaultProfile

<IAzureContextContainer>] [-DisableSetting] -Location <String> -Name <String> [-Notification

<System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.AutoscaleNotification]>] -ResourceGroupName <String>

-TargetResourceId <String> [<CommonParameters>]



Add-AzureRmAutoscaleSetting [-AutoscaleProfile

<System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.AutoscaleProfile]>] [-DefaultProfile

<IAzureContextContainer>] [-DisableSetting] [-Notification

<System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.AutoscaleNotification]>] -ResourceGroupName <String>

-SettingSpec <PSAutoscaleSetting> [<CommonParameters>]





DESCRIPTION

The Add-AzureRmAutoscaleSetting cmdlet creates an Autoscale setting.



This cmdlet implements the ShouldProcess pattern, i.e. it might request confirmation from the user before actually creating, modifying, or

removing the resource.





PARAMETERS

-AutoscaleProfile <System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.AutoscaleProfile]>

Specifies a list of profiles to add to the Autoscale setting, or $Null to add no profile.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DisableSetting [<SwitchParameter>]

Disables an existing Autoscale setting.



Required? false

Position? named

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Location <String>

Specifies the location of the Autoscale setting.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Specifies the name of the Autoscale setting to create.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Notification <System.Collections.Generic.List`1[Microsoft.Azure.Management.Monitor.Management.Models.AutoscaleNotification]>

Specifies a list of comma-separated notifications.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group for the resource associated with the Autoscale setting.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SettingSpec <PSAutoscaleSetting>

Specifies an AutoscaleSetting object. You can use the Get-AzureRmAutoscaleSetting cmdlet to get an AutoscaleSetting object or you can

construct one in a Windows PowerShell script.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-TargetResourceId <String>

Specifies the ID of the resource to autoscale.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Insights.OutputClasses.PSAddAutoscaleSettingOperationResponse







NOTES









Example 1: Create an Autoscale setting



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 -Rules $Rule1, $Rule2 -Name "adios"



PS C:\\> $Profile2 = New-AzureRmAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -Rules $Rule1, $Rule2 -Name

"SecondProfileName" -RecurrenceFrequency Minute -ScheduleDays "1", "2", "3" -ScheduleHours 5, 10, 15 -ScheduleMinutes 15, 30, 45 -ScheduleTimeZone

GMT



PS C:\\> Add-AzureRmAutoscaleSetting -Location "East US" -Name "MySetting" -ResourceGroupName "Default-Web-EastUS" -TargetResourceId

"/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/serverFarms/DefaultServerFarm"

-AutoscaleProfiles $Profile1, $Profile2



The first two commands use New-AzureRmAutoscaleRule to create two Autoscale rules, $Rule1 and $Rule2.



The third and fourth commands use New-AzureRmAutoscaleProfile to create Autoscale profiles, $Profile1 and $Profile2, using $Rule1 and $Rule2.



The final command creates an Autoscale setting using the profiles in $Profile1 and $Profile2.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... alesetting

Get-AzureRmAutoscaleSetting

New-AzureRmAutoscaleProfile

New-AzureRmAutoscaleRule

Remove-AzureRmAutoscaleSetting