Create or update an autoscale setting in Azure Monitor REST API
Updated: September 26, 2016
See Common headers and parameters for headers and parameters that are used by all requests related to autoscale settings.
Method | Request URI |
|---|---|
PUT | https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/autoscaleSettings/{autoscale-setting-name}?api-version={api-version} |
Replace {autoscale-setting-name} with the name of the autoscale setting for which you want to create or update.
{
"name": "webfrontend-norapp-norapp",
"type": "Microsoft.Insights/autoscaleSettings",
"location": "East US",
"tags": { },
"properties": {
"profiles": [ {
"name": "Day",
"capacity": {
"minimum": "1",
"maximum": "5",
"default": "4"
},
"rules": [ {
"metricTrigger": {
"metricName": "Percentage CPU",
"metricNamespace": "",
"metricResourceUri": "/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/norapp/providers/microsoft.classicCompute/domainNames/norapp/availabilitySets/webfrontend",
"timeGrain": "PT5M",
"statistic": "Average",
"timeWindow": "PT45M",
"timeAggregation": "Average",
"operator": "GreaterThanOrEqual",
"threshold": 60
},
"scaleAction": {
"direction": "Increase",
"type": "ChangeCount",
"value": "2",
"cooldown": "PT20M"
}
} ],
"recurrence": {
"frequency": "Week",
"schedule": {
"timeZone": "Pacific Standard Time",
"days": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"hours": [ 8 ],
"minutes": [ 0 ]
}
}
} ],
"enabled": true,
"name": "webfrontend-norapp-norapp",
"targetResourceUri": "/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/norapp/providers/microsoft.classicCompute/domainNames/norapp/availabilitySets/webfrontend"
"notifications": [
{
"operation": "Scale",
"email": {
"sendToSubscriptionAdministrator": false,
"sendToSubscriptionCoAdministrators": false,
"customEmails": [
"user1@mycompany.com",
"user2@mycompany.com"
]
},
"webhooks": [
{
"serviceUri": "https://foo.webhook.example.com?token=abcd1234",
"properties": {
"optional_key1": "optional_value1",
"optional_key2": "optional_value2"
}
}
]
}
]
}
}
Element Name | Required | Type | Description |
|---|---|---|---|
name | Yes | String | The name of the autoscale setting. |
type | Yes | String | Specifies that this is of type Microsoft.Insights/AutoscaleSettings |
location | Yes | String | Specifies the supported Azure location of the autoscale setting. For more information, see List all of the available geo-locations. |
tags | No | Complex Type | The tags and their values that are used by the autoscale setting. |
profiles | Yes | Complex Type | Contains a collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. |
name | Yes | String | The name of the profile. |
Yes | Complex Type | The number of instances that can be used during this profile. | |
rules | Yes | Complex Type | Contains a collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. |
Yes | Complex Type | The trigger that results in a scaling action. | |
Yes | Complex Type | Specifies parameters for the scaling action. | |
No | Complex Type | A specific date for the profile. This element is not used if the Recurrence element is used. | |
No | Complex Type | The repeating times at which this profile begins. This element is not used if the FixedDate element is used. | |
enabled | Yes | Boolean | Specifies whether automatic scaling is enabled for the resource. |
targetResourceUri | Yes | String | The resource identifier of the resource that the autoscale setting should be added to. |
Element name | Required | Type | Description |
|---|---|---|---|
minimum | Yes | String | Specifies the minimum number of instances that are available for the scaling action. |
maximum | Yes | String | Specifies the maximum number of instances that are available for the scaling action. The maximum number of instances is limited by the cores that are available in the subscription. You can use the to see the number of cores that are available in your subscription. |
default | Yes | String | Specifies the number of instances that are available for scaling if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. |
Element name | Required | Type | Description |
|---|---|---|---|
metricName | Yes | String | The name of the metric that defines what the rule monitors. |
metricResourceUri | Yes | String | The resource identifier of the resource the rule monitors. |
timeGrain | Yes | Time | The granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute. ISO 8601 duration format. |
statistic | Yes | String | How the metrics from multiple instances are combined. Possible values are:
|
timeWindow | Yes | Time | The range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes. ISO 8601 duration format. |
timeAggregation | Yes | String | How the data that is collected should be combined over time. The default value is Average. Possible values are:
|
operator | Yes | String | The operator that is used to compare the metric data and the threshold. Possible values are:
|
threshold | Yes | Integer | The threshold of the metric that triggers the scale action. |
Element name | Required | Type | Description |
|---|---|---|---|
direction | Yes | String | Increase or decrease. |
type | Yes | String | The type of action that should occur, this must be set to ChangeCount or PercentChangeCount. |
value | Yes | String | The number that is involved in the scaling action. This value must be 1 or greater. The default value is 1. |
cooldown | Yes | Time | The amount of time to wait since the last scaling action before this action occurs. Must be between 1 week and 1 minute. ISO 8601 duration format. |
Element name | Required | Type | Description |
|---|---|---|---|
timeZone | Yes | Time | The time zone of the start and end times for the profile. |
start | Yes | Time | The start time for the profile. |
end | Yes | Time | The end time for the profile. |
Element name | Required | Type | Description |
|---|---|---|---|
frequency | Yes | String | How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. |
schedule | Yes | Complex Type | The scheduling constraints for when the profile begins. |
timeZone | Yes | String | The time zone ID for the hours of the profile. See examples of acceptable Time Zone IDs below. |
days | Yes | Collection | A collection of days that the profile takes effect on. Possible values are Sunday through Saturday. |
hours | Yes | Collection | A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported) |
minutes | Yes | Collection | A collection of minutes at which the profile takes effect at. |
Acceptable time zone ID examples from International Dateline going east:
Dateline Standard Time
UTC-11
Hawaiian Standard Time
Alaskan Standard Time
Pacific Standard Time (Mexico)
Pacific Standard Time
US Mountain Standard Time
Mountain Standard Time (Mexico)
Mountain Standard Time
Central America Standard Time
Central Standard Time
Central Standard Time (Mexico)
Canada Central Standard Time
SA Pacific Standard Time
Eastern Standard Time
US Eastern Standard Time
Venezuela Standard Time
Paraguay Standard Time
Atlantic Standard Time
Central Brazilian Standard Time
SA Western Standard Time
Pacific SA Standard Time
Newfoundland Standard Time
E. South America Standard Time
Argentina Standard Time
SA Eastern Standard Time
Greenland Standard Time
Montevideo Standard Time
Bahia Standard Time
UTC-02
Mid-Atlantic Standard Time
Azores Standard Time
Cape Verde Standard Time
Morocco Standard Time
UTC
GMT Standard Time
Greenwich Standard Time
W. Europe Standard Time
Central Europe Standard Time
Romance Standard Time
Central European Standard Time
W. Central Africa Standard Time
Namibia Standard Time
Jordan Standard Time
GTB Standard Time
Middle East Standard Time
Egypt Standard Time
Syria Standard Time
E. Europe Standard Time
South Africa Standard Time
FLE Standard Time
Turkey Standard Time
Israel Standard Time
Kaliningrad Standard Time
Libya Standard Time
Arabic Standard Time
Arab Standard Time
Belarus Standard Time
Russian Standard Time
E. Africa Standard Time
Iran Standard Time
Arabian Standard Time
Azerbaijan Standard Time
Russia Time Zone 3
Mauritius Standard Time
Georgian Standard Time
Caucasus Standard Time
Afghanistan Standard Time
West Asia Standard Time
Ekaterinburg Standard Time
Pakistan Standard Time
India Standard Time
Sri Lanka Standard Time
Nepal Standard Time
Central Asia Standard Time
Bangladesh Standard Time
N. Central Asia Standard Time
Myanmar Standard Time
SE Asia Standard Time
North Asia Standard Time
China Standard Time
North Asia East Standard Time
Singapore Standard Time
W. Australia Standard Time
Taipei Standard Time
Ulaanbaatar Standard Time
Tokyo Standard Time
Korea Standard Time
Yakutsk Standard Time
Cen. Australia Standard Time
AUS Central Standard Time
E. Australia Standard Time
AUS Eastern Standard Time
West Pacific Standard Time
Tasmania Standard Time
Magadan Standard Time
Vladivostok Standard Time
Russia Time Zone 10
Central Pacific Standard Time
Russia Time Zone 11
New Zealand Standard Time
UTC+12
Fiji Standard Time
Kamchatka Standard Time
Tonga Standard Time
Samoa Standard Time
Line Islands Standard Time
Field | Description |
|---|---|
operation | value must be "Scale" |
sendToSubscriptionAdministrator | value must be "true" or "false" |
sendToSubscriptionCoAdministrator | value must be "true" or "false" |
customEmails | value can be null [] or string array of emails |
webhooks | can be null or valid Uri |
serviceUri | a valid HTTPS Uri |
properties | value must be empty {} or can contain key-value pairs |
Status code: 200
{
"id": "/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/norapp/providers/microsoft.insights/autoscalesettings/webfrontend-norapp-norapp",
"name": "webfrontend-norapp-norapp",
"type": "Microsoft.Insights/autoscaleSettings",
"location": "East US",
"tags": { },
"properties": {
"profiles": [ {
"name": "Day",
"capacity": {
"minimum": "1",
"maximum": "5",
"default": "4"
},
"rules": [ {
"metricTrigger": {
"metricName": "Percentage CPU",
"metricNamespace": "",
"metricResourceUri": "/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/norapp/providers/microsoft.classicCompute/domainNames/norapp/availabilitySets/webfrontend",
"timeGrain": "PT5M",
"statistic": "Average",
"timeWindow": "PT45M",
"timeAggregation": "Average",
"operator": "GreaterThanOrEqual",
"threshold": 60
},
"scaleAction": {
"direction": "Increase",
"type": "ChangeCount",
"value": "2",
"cooldown": "PT20M"
}
} ],
"recurrence": {
"frequency": "Week",
"schedule": {
"timeZone": "Pacific Standard Time",
"days": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"hours": [ 8 ],
"minutes": [ 0 ]
}
}
} ],
"enabled": true,
"name": "webfrontend-norapp-norapp",
"targetResourceUri": "/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/norapp/providers/microsoft.classicCompute/domainNames/norapp/availabilitySets/webfrontend"
"notifications": [
{
"operation": "Scale",
"email": {
"sendToSubscriptionAdministrator": false,
"sendToSubscriptionCoAdministrators": false,
"customEmails": [
"user1@mycompany.com",
"user2@mycompany.com"
]
},
"webhooks": [
{
"serviceUri": "https://foo.webhook.example.com?token=abcd1234",
"properties": {
"optional_key1": "optional_value1",
"optional_key2": "optional_value2"
}
}
]
}
]
}
}