Skip to content

Commit 0b4db2a

Browse files
committed
WIP 1909-1
1 parent b18570c commit 0b4db2a

File tree

1 file changed

+130
-2
lines changed

1 file changed

+130
-2
lines changed

articles/azure-monitor/autoscale/autoscale-multiprofile.md

Lines changed: 130 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,138 @@ When creating multiple profiles using templates and the CLI,
6363

6464
#### [ARM templates](#tab/templates)
6565

66-
<!--- Content here -->
66+
Follow the tules below when using tARM templates to create autoscale setting with multiple profiles:
67+
68+
* Create a default profile for each recurring profile.
69+
* The default profile must contain a `recurrence` section that is the same as the recurring profile, with the `hours` and `minuted` elements set for the end time of the recurring profile.
70+
* The `name` element for the default profile is an object with the follwoing format: `"name": "{\"name\":\"Auto created default scale condition\",\"for\":\"Recurring profile name\"}"` where the recurring profile name is the value of the `name` element for the recurring profile.
71+
72+
If you do not specify a default profile recurrence with a start time, the last recurrence rule will remain in effect.
73+
74+
These rules do not apply for a non-recurring scheduled profile.
75+
The example below shows the JSON for recurring profile for weekends that begins at 06:00 on a Saturday and Sunday, and ends at 19:00 for the same days.
76+
77+
``` JSON
78+
{
79+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
80+
"contentVersion": "1.0.0.0",
81+
"resources": [
82+
{
83+
"type": "Microsoft.Insights/autoscaleSettings",
84+
"apiVersion": "2015-04-01",
85+
"name": "VMSS1-Autoscale-607",
86+
"location": "eastus",
87+
"properties": {
88+
89+
"name": "VMSS1-Autoscale-607",
90+
"enabled": true,
91+
"targetResourceUri": "/subscriptions/abc123456-987-f6e5-d43c-9a8d8e7f6541/resourceGroups/rg-vmss1/providers/Microsoft.Compute/virtualMachineScaleSets/VMSS1",
92+
"profiles": [
93+
{
94+
"name": "Weekend profile",
95+
"capacity": {
96+
"minimum": "2",
97+
"maximum": "3",
98+
"default": "2"
99+
},
100+
"rules": [],
101+
"recurrence": {
102+
"frequency": "Week",
103+
"schedule": {
104+
"timeZone": "E. Europe Standard Time",
105+
"days": [
106+
"Saturday",
107+
"Sunday"
108+
],
109+
"hours": [
110+
6
111+
],
112+
"minutes": [
113+
0
114+
]
115+
}
116+
}
117+
},
118+
{
119+
"name": "{\"name\":\"Auto created default scale condition\",\"for\":\"Weekend profile\"}",
120+
"capacity": {
121+
"minimum": "2",
122+
"maximum": "10",
123+
"default": "3"
124+
},
125+
"recurrence": {
126+
"frequency": "Week",
127+
"schedule": {
128+
"timeZone": "E. Europe Standard Time",
129+
"days": [
130+
"Saturday",
131+
"Sunday"
132+
],
133+
"hours": [
134+
19
135+
],
136+
"minutes": [
137+
0
138+
]
139+
}
140+
},
141+
"rules": [
142+
{
143+
"scaleAction": {
144+
"direction": "Increase",
145+
"type": "ChangeCount",
146+
"value": "1",
147+
"cooldown": "PT3M"
148+
},
149+
"metricTrigger": {
150+
"metricName": "Percentage CPU",
151+
"metricNamespace": "microsoft.compute/virtualmachinescalesets",
152+
"metricResourceUri": "/subscriptions/abc123456-987-f6e5-d43c-9a8d8e7f6541/resourceGroups/rg-vmss1/providers/Microsoft.Compute/virtualMachineScaleSets/VMSS1",
153+
"operator": "GreaterThan",
154+
"statistic": "Average",
155+
"threshold": 50,
156+
"timeAggregation": "Average",
157+
"timeGrain": "PT1M",
158+
"timeWindow": "PT1M",
159+
"Dimensions": [],
160+
"dividePerInstance": false
161+
}
162+
},
163+
{
164+
"scaleAction": {
165+
"direction": "Decrease",
166+
"type": "ChangeCount",
167+
"value": "1",
168+
"cooldown": "PT3M"
169+
},
170+
"metricTrigger": {
171+
"metricName": "Percentage CPU",
172+
"metricNamespace": "microsoft.compute/virtualmachinescalesets",
173+
"metricResourceUri": "/subscriptions/abc123456-987-f6e5-d43c-9a8d8e7f6541/resourceGroups/rg-vmss1/providers/Microsoft.Compute/virtualMachineScaleSets/VMSS1",
174+
"operator": "LessThan",
175+
"statistic": "Average",
176+
"threshold": 39,
177+
"timeAggregation": "Average",
178+
"timeGrain": "PT1M",
179+
"timeWindow": "PT3M",
180+
"Dimensions": [],
181+
"dividePerInstance": false
182+
}
183+
}
184+
]
185+
}
186+
],
187+
"notifications": [],
188+
"targetResourceLocation": "eastus"
189+
}
190+
191+
}
192+
]
193+
}
194+
```
67195

68196
#### [CLI](#tab/cli)
69197

70198
<!--- Content here -->
71199

72-
---
200+
---

0 commit comments

Comments
 (0)