Skip to content

Commit 2a4b7d3

Browse files
committed
fixed links
1 parent 1606f29 commit 2a4b7d3

File tree

1 file changed

+41
-34
lines changed

1 file changed

+41
-34
lines changed

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

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,57 +15,57 @@ ms.reviewer: akkumari
1515

1616
# Autoscale with different profiles
1717

18-
Scaling your resources for a particular day of the week, or a specific date and time can reduce costs while still providing the capacity you need when you need it.
18+
Scaling your resources for a particular day of the week, or a specific date and time can reduce your costs while still providing the capacity you need when you need it.
1919

20-
Use multiple profiles in autoscale to scale in different ways at different times. If for example, your business isn't active on the weekend, create a recurring profile to scale in your resources on Saturdays and Sundays. If black Friday is a busy day, create a profile to automatically scale out your resources on black Friday.
20+
You can use multiple profiles in autoscale to scale in different ways at different times. If for example, your business isn't active on the weekend, create a recurring profile to scale in your resources on Saturdays and Sundays. If black Friday is a busy day, create a profile to automatically scale out your resources on black Friday.
2121

2222
This article explains the different profiles in autoscale and how to use them.
2323

2424
You can have one or more profiles in your autoscale setting.
2525

2626
There are three types of profile:
2727

28+
* The default profile. The default profile is created automatically and isn't dependent on a schedule. The default profile can't be deleted. The default profile is used when there are no other profiles that match the current date and time.
2829
* Recurring profiles. A recurring profile is valid for a specific time range and repeats for selected days of the week.
2930
* Fixed date and time profiles. A profile that is valid for a time range on a specific date.
30-
* The default profile. The default profile is created automatically and isn't dependent on a schedule. The default profile can't be deleted. The default profile is used when there are no other profiles that match the current date and time.
31-
31+
32+
3233
Each time the autoscale service runs, the profiles are evaluated in the following order:
3334

3435
1. Fixed date profiles
3536
1. Recurring profiles
3637
1. Default profile
3738

38-
If a profile's date and time conditions match the current time, autoscale will apply that profile's limits and rules. Only the first applicable profile is used.
39+
If a profile's date and time settings match the current time, autoscale will apply that profile's rules and capacity limits. Only the first applicable profile is used.
3940

4041
The example below shows an autoscale setting with a default profile and recurring profile.
4142

4243
:::image type="content" source="./media/autoscale-multiple-profiles/autoscale-default-recurring-profiles.png" alt-text="A screenshot showing an autoscale setting with default and recurring profile or scale condition":::
4344

44-
On Monday after 6 AM, the recurring profile will be used. If the instance count is two, autoscale scales to the new minimum of three. Autoscale continues to use this profile and scales based on CPU% until Monday at 6 PM.
45-
46-
At all other times scaling will be done according to the default profile, based on the number of requests.
47-
After 6 PM on Monday, autoscale switches to the default profile. If for example, the number of instances at the time is 12, autoscale scales in to 10, which the maximum allowed for the default profile.
45+
In the above example, on Monday after 6 AM, the recurring profile will be used. If the instance count is less than 3, autoscale scales to the new minimum of three. Autoscale continues to use this profile and scales based on CPU% until Monday at 6 PM. At all other times scaling will be done according to the default profile, based on the number of requests. After 6 PM on Monday, autoscale switches to the default profile. If for example, the number of instances at the time is 12, autoscale scales in to 10, which the maximum allowed for the default profile.
4846

49-
## Multiple profiles using templates and CLI
47+
## Multiple profiles using templates, CLI, and PowerShell
5048

51-
When creating multiple profiles using templates and the CLI, follow the guidelines below.
49+
When creating multiple profiles using templates, the CLI, and PowerShell, follow the guidelines below.
5250

5351
## [ARM templates](#tab/templates)
5452

5553
Follow the rules below when using ARM templates to create autoscale settings with multiple profiles:
5654

55+
See the autoscale section of the [ARM template resource definition](https://learn.microsoft.com/azure/templates/microsoft.insights/autoscalesettings) for a full template reference.
56+
5757
* Create a default profile for each recurring profile. If you have two recurring profiles, create two matching default profiles.
5858
* The default profile must contain a `recurrence` section that is the same as the recurring profile, with the `hours` and `minutes` elements set for the end time of the recurring profile. If you don't specify a recurrence with a start time for the default profile, the last recurrence rule will remain in effect.
59-
These rules don't apply for a non-recurring scheduled profile.
6059
* The `name` element for the default profile is an object with the following 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. If the name isn't specified correctly, the default profile will appear as another recurring profile.
60+
*The rules above don't apply for non-recurring scheduled profiles.
6161

6262
## Add a recurring profile using AIM templates
6363

6464
The example below shows how to create two recurring profiles. One profile for weekends between 06:00 and 19:00, Saturday and Sunday, and a second for Mondays between 04:00 and 15:00. Note the two default profiles, one for each recurring profile.
6565

6666
Use the following command to deploy the template:
6767
` az deployment group create --name VMSS1-Autoscale-607 --resource-group rg-vmss1 --template-file VMSS1-autoscale.json`
68-
where `VMSS1-autoscale.json` is the the file containing the JSON object below.
68+
where *VMSS1-autoscale.json* is the the file containing the JSON object below.
6969

7070
``` JSON
7171
{
@@ -325,9 +325,12 @@ where `VMSS1-autoscale.json` is the the file containing the JSON object below.
325325

326326
The CLI can be used to create multiple profiles in your autoscale settings.
327327

328-
The following steps show how to create an autoscale profile using the CLI.
329-
1. Create the profile using `az monitor autoscale profile create`. Specify the `--start` and `--end` time and the `--recurrence`
330-
1. Create a scale-out rule using `az monitor autoscale rule create` using `--scale out`
328+
See the [Autoscale CLI reference](https://learn.microsoft.com/cli/azure/monitor/autoscale?view=azure-cli-latest) for the full set of autoscale CLI commands.
329+
330+
The following steps show how to create a recurring autoscale profile using the CLI.
331+
332+
1. Create the recurring profile using `az monitor autoscale profile create`. Specify the `--start` and `--end` time and the `--recurrence`
333+
1. Create a scale out rule using `az monitor autoscale rule create` using `--scale out`
331334
1. Create a scale in rule using `az monitor autoscale rule create` using `--scale in`
332335

333336
## Add a recurring profile using CLI
@@ -345,7 +348,7 @@ az monitor autoscale rule create -g rg-vmss1 --autoscale-name VMSS1-Autoscale-60
345348

346349
> [!NOTE]
347350
> The JSON for your autoscale default profile is modified by adding a recurring profile.
348-
> The `name` of the default profile is changed to an object in the format: `"name": "{\"name\":\"Auto created default scale condition\",\"for\":\"recurring profile\"}"` where *recurring profile* is the profile name from the `az monitor autoscale profile create` command.
351+
> The `name` element of the default profile is changed to an object in the format: `"name": "{\"name\":\"Auto created default scale condition\",\"for\":\"recurring profile\"}"` where *recurring profile* is the profile name of your recurring profile.
349352
> The default profile also has a recurrence clause added to it that starts at the end time specified for the new recurring profile.
350353
> A new default profile is created for each recurring profile.
351354
@@ -361,24 +364,26 @@ az monitor autoscale rule create -g rg-vmss1--autoscale-name VMSS1-Autoscale-607
361364
az monitor autoscale rule create -g rg-vmss1--autoscale-name VMSS1-Autoscale-607 --scale out 8 --condition "Percentage CPU > 52 avg 5m" --profile-name "{\"name\": \"Auto created default scale condition\", \"for\": \"Thursdays\"}"
362365
```
363366

364-
## [Powershell](#tab/powershell)
367+
## [PowerShell](#tab/powershell)
365368

366-
Powershell can be used to create multiple profiles in your autoscale settings.
369+
PowerShell can be used to create multiple profiles in your autoscale settings.
367370

368-
The following steps show how to create an autoscale profile using Powershell.
371+
See the [PowerShell Az.Monitor Reference ](https://learn.microsoft.com/powershell/module/az.monitor/#monitor) for the full set of autoscale PowerShell commands.
369372

370-
1. Create rules using `New-AzAutoscaleRule`
371-
1. Create profiles using `New-AzAutoscaleProfile` using the rules from the previous step
372-
1. Use `Add-AzureRmAutoscaleSetting` to apply the profiles to your autoscale setting.
373+
The following steps show how to create an autoscale profile using PowerShell.
373374

374-
## Add a recurring profile using Powershell
375+
1. Create rules using `New-AzAutoscaleRule`.
376+
1. Create profiles using `New-AzAutoscaleProfile` using the rules from the previous step.
377+
1. Use `Add-AzAutoscaleSetting` to apply the profiles to your autoscale setting.
378+
379+
## Add a recurring profile using PowerShell
375380

376381
The example below shows how to create default profile and a recurring autoscale profile, recurring on Wednesdays and Fridays between 07:00 and 19:00.
377-
The default profile uses the CpuIn and CpuOut Rules. The recurring profile uses the HTTPRuleIn and HTTPRuleOut rules
382+
The default profile uses the `CpuIn` and `CpuOut` Rules. The recurring profile uses the `HTTPRuleIn` and `HTTPRuleOut` rules
378383

379384
```azurepowershell
380-
$ResourceGroup="ed-rg-001"
381-
$TargetResourceId="/subscriptions/d0567c0b-5849-4a5d-a2eb-5267eae1bbc7/resourcegroups/ed-rg-001/providers/Microsoft.Web/serverFarms/ScaleableAppServicePlan"
385+
$ResourceGroup="rg-001"
386+
$TargetResourceId="/subscriptions/abc123456-987-f6e5-d43c-9a8d8e7f6541/resourcegroups/rg-001/providers/Microsoft.Web/serverFarms/ScaleableAppServicePlan"
382387
383388
$ScaleSettingName="MultipleProfiles-001"
384389
@@ -394,14 +399,14 @@ $HTTPRuleOut = New-AzAutoscaleRule -MetricName "HttpQueueLength" -MetricResource
394399
395400
$RecurringProfile=New-AzAutoscaleProfile -Name WednesdaysFridays -DefaultCapacity 2 -MaximumCapacity 12 -MinimumCapacity 2 -RecurrenceFrequency week -ScheduleDay "Wednesday","Friday" -ScheduleHour 7 -ScheduleMinute 00 -ScheduleTimeZone "Pacific Standard Time" -Rule $HTTPRuleOut, $HTTPRuleIn
396401
397-
Add-AzureRmAutoscaleSetting -Location "West Central US" -name $ScaleSettingName -ResourceGroup $ResourceGroup -TargetResourceId $TargetResourceId -AutoscaleProfile $DefaultProfile, $RecurringProfile
402+
Add-AzAutoscaleSetting -Location "West Central US" -name $ScaleSettingName -ResourceGroup $ResourceGroup -TargetResourceId $TargetResourceId -AutoscaleProfile $DefaultProfile, $RecurringProfile
398403
```
399404

400405
> [!NOTE]
401406
> Each recurring profile must have a corresponding default profile.
402-
> The `-Name` parameter of the default profile is is an object in the format: `'{"name":"Default scale condition","for":"recurring profile"}'` where *recurring profile* is the profile name from the `New-AzAutoscaleProfile` command for the recurring profile.
403-
> The default profile also has a recurrence parameters as the recurring profile but it starts at the time you want the recurring profile to end.
404-
> A distinct default profile is created for each recurring profile.
407+
> The `-Name` parameter of the default profile is an object in the format: `'{"name":"Default scale condition","for":"recurring profile"}'` where *recurring profile* is the profile name of the recurring profile.
408+
> The default profile also has a recurrence parameters which match the recurring profile but it starts at the time you want the recurring profile to end.
409+
> Create a distinct default profile for each recurring profile.
405410
406411
## Updating the default profile when you have recurring profiles
407412

@@ -421,7 +426,9 @@ $DefaultProfileThursdayProfile = New-AzAutoscaleProfile -DefaultCapacity "1" -Ma
421426
---
422427

423428
## Next steps
424-
* [Autoscale CLI reference](cli/azure/monitor/autoscale?view=azure-cli-latest).
425-
* [ARM template resource definition](/azure/templates/microsoft.insights/autoscalesettings)
426-
* [REST API reference. Autoscale Settings](rest/api/monitor/autoscale-settings).
429+
430+
* [Autoscale CLI reference](https://learn.microsoft.com/cli/azure/monitor/autoscale?view=azure-cli-latest)
431+
* [ARM template resource definition](https://learn.microsoft.com/azure/templates/microsoft.insights/autoscalesettings)
432+
* [PowerShell Az.Monitor Reference](https://learn.microsoft.com/powershell/module/az.monitor/#monitor)
433+
* [REST API reference. Autoscale Settings](https://learn.microsoft.com/rest/api/monitor/autoscale-settings).
427434
* [Advanced autoscale configuration using Resource Manager templates for virtual machine scale sets](autoscale-virtual-machine-scale-sets.md) for different resources in Azure.

0 commit comments

Comments
 (0)