Add-AutoscaleSetting

Applies To: Azure PowerShell 1.0

Add-AutoscaleSetting

Creates an autoscale setting.

Syntax

Parameter Set: Parameters for AddAustoscaleSetting cmdlet in the create semantics
Add-AutoscaleSetting -Location <System.String> -Name <System.String> -ResourceGroup <System.String> -TargetResourceId <System.String> [-AutoscaleProfiles <System.Collections.Generic.List`1[[Microsoft.Azure.Management.Insights.Models.AutoscaleProfile, Microsoft.Azure.Insights, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]> ] [-DisableSetting] [ <CommonParameters>]

Parameter Set: Parameters for AddAustoscaleSetting cmdlet in the update semantics
Add-AutoscaleSetting -ResourceGroup <System.String> -SettingSpec <Microsoft.Azure.Management.Insights.Models.AutoscaleSettingResource> [-AutoscaleProfiles <System.Collections.Generic.List`1[[Microsoft.Azure.Management.Insights.Models.AutoscaleProfile, Microsoft.Azure.Insights, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]> ] [-DisableSetting] [ <CommonParameters>]

Detailed Description

The Add-AutoscaleSetting cmdlet creates an Autoscale setting.

Parameters

-AutoscaleProfiles<System.Collections.Generic.List`1[[Microsoft.Azure.Management.Insights.Models.AutoscaleProfile, Microsoft.Azure.Insights, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]>

Specifies a list of profiles to add to the Autoscale setting, or null to add no profiles.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-DisableSetting

Indicates that the existing Autoscale setting is disabled.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Location<System.String>

Specifies the location of the Autoscale setting.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Name<System.String>

Specifies the name of the Autoscale setting.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ResourceGroup<System.String>

Specifies the resource group associated with the Autoscale setting.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-SettingSpec<Microsoft.Azure.Management.Insights.Models.AutoscaleSettingResource>

Specifies an autoscale setting object. Obtain this type of object from the Get-AutoscaleSetting cmdlet or construct it using a PowerShell script.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-TargetResourceId<System.String>

Specifies the resource ID of the Autoscale resource.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Create an Autoscale setting

The first two commands create Autoscale rules, and then store them in the $Rule1 and $Rule2 variables.

The third and fourth commands create Autoscale profiles using the rules in $Rule1 and $Rule2, and then store them in the $Profile and $Profile2 variables.

The final command creates an Autoscale setting using the two profiles created in the previous commands.

PS C:\> $Rule1 = New-AutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/ResourceGroups/Contoso-Web-EastUS/providers/microsoft.web/sites/ContosoWebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:05:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "1" 

PS C:\> $Rule2 = New-AutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/ResourceGroups/Contoso-Web-EastUS/providers/microsoft.web/sites/ContosoWebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:10:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "2"

PS C:\> $Profile1 = New-AutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -StartTimeWindow 2015-03-05T14:00:00 -EndTimeWindow 2015-03-05T14:30:00 -TimeWindowTimeZone GMT -Rules $Rule1, $Rule2 -Name "Contoso01"

PS C:\> $Profile2 = New-AutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -Rules $Rule1, $Rule2 -Name "Contoso01" -RecurrenceFrequency Minute -ScheduleDays "1", "2", "3" -ScheduleHours 5, 10, 15 -ScheduleMinutes 15, 30, 45 -ScheduleTimeZone GMT

PS C:\> Add-AutoscaleSetting -Location "East US" -Name "MySetting" -ResourceGroup "Contoso-Web-EastUS" -TargetResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/ResourceGroups/Contoso-Web-EastUS/providers/microsoft.web/ServerFarms/ContosoServerFarm" -AutoscaleProfiles $Profile1, $Profile2

Get-AutoscaleHistory

Get-AutoscaleSetting

New-AutoscaleProfile

New-AutoscaleRule

Remove-AutoscaleSetting