Skip to content

Commit 40c1e41

Browse files
authored
Merge pull request #256586 from MJyot/v1-migration
V1 migration
2 parents 7ef424e + 6ef9969 commit 40c1e41

File tree

4 files changed

+96
-9
lines changed

4 files changed

+96
-9
lines changed

articles/application-gateway/application-gateway-autoscaling-zone-redundant.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: application-gateway
55
author: greg-lindsay
66
ms.service: application-gateway
77
ms.topic: conceptual
8-
ms.date: 03/01/2022
8+
ms.date: 11/02/2023
99
ms.author: greglin
1010
ms.custom: fasttrack-edit, references_regions
1111
---
@@ -14,22 +14,23 @@ ms.custom: fasttrack-edit, references_regions
1414

1515
Application Gateway and WAF can be configured to scale in two modes:
1616

17-
- **Autoscaling** - With autoscaling enabled, the Application Gateway and WAF v2 SKUs scale out or in based on application traffic requirements. This mode offers better elasticity to your application and eliminates the need to guess the application gateway size or instance count. This mode also allows you to save cost by not requiring the gateway to run at peak-provisioned capacity for expected maximum traffic load. You must specify a minimum and optionally maximum instance count. Minimum capacity ensures that Application Gateway and WAF v2 don't fall below the minimum instance count specified, even without traffic. Each instance is roughly equivalent to 10 more reserved Capacity Units. Zero signifies no reserved capacity and is purely autoscaling in nature. You can also optionally specify a maximum instance count, which ensures that the Application Gateway doesn't scale beyond the specified number of instances. You'll only be billed for the amount of traffic served by the Gateway. The instance counts can range from 0 to 125. The default value for maximum instance count is 10 if not specified.
18-
- **Manual** - You can also choose Manual mode where the gateway won't autoscale. In this mode, if there's more traffic than what Application Gateway or WAF can handle, it could result in traffic loss. With manual mode, specifying instance count is mandatory. Instance count can vary from 1 to 125 instances.
17+
- **Autoscaling** - With autoscaling enabled, the Application Gateway and WAF v2 SKUs scale out or in based on application traffic requirements. This mode offers better elasticity to your application and eliminates the need to guess the application gateway size or instance count. This mode also allows you to save cost by not requiring the gateway to run at peak-provisioned capacity for expected maximum traffic load. You must specify a minimum and optionally maximum instance count. Minimum capacity ensures that Application Gateway and WAF v2 don't fall below the minimum instance count specified, even without traffic. Each instance is roughly equivalent to 10 more reserved Capacity Units. Zero signifies no reserved capacity and is purely autoscaling in nature. You can also optionally specify a maximum instance count, which ensures that the Application Gateway doesn't scale beyond the specified number of instances. You are only billed for the amount of traffic served by the Gateway. The instance counts can range from 0 to 125. The default value for maximum instance count is 10 if not specified.
18+
- **Manual** - You can also choose Manual mode where the gateway doesn't autoscale. In this mode, if there's more traffic than what Application Gateway or WAF can handle, it could result in traffic loss. With manual mode, specifying instance count is mandatory. Instance count can vary from 1 to 125 instances.
1919

2020
## Autoscaling and High Availability
2121

22-
Azure Application Gateways are always deployed in a highly available fashion. The service is made out of multiple instances that are created as configured (if autoscaling is disabled) or required by the application load (if autoscaling is enabled). Note that from the user's perspective you don't necessarily have visibility into the individual instances, but just into the Application Gateway service as a whole. If a certain instance has a problem and stops being functional, Azure Application Gateway will transparently create a new instance.
22+
Azure Application Gateways are always deployed in a highly available fashion. The service is made up of multiple instances that are created as configured if autoscaling is disabled, or required by the application load if autoscaling is enabled. From the user's perspective, you don't necessarily have visibility into the individual instances, but just into the Application Gateway service as a whole. If a certain instance has a problem and stops being functional, Azure Application Gateway transparently creates a new instance.
2323

24-
Even if you configure autoscaling with zero minimum instances the service will still be highly available, which is always included with the fixed price.
24+
Even if you configure autoscaling with zero minimum instances the service is still highly available, which is always included with the fixed price.
2525

26-
However, creating a new instance can take some time (around six or seven minutes). If you don't want to have this downtime, you can configure a minimum instance count of two, ideally with Availability Zone support. This way you'll have at least two instances in your Azure Application Gateway under normal circumstances. So if one of them had a problem the other will try to handle the traffic while a new instance is being created. An Azure Application Gateway instance can support around 10 Capacity Units, so depending on how much traffic you typically have you might want to configure your minimum instance autoscaling setting to a value higher than two.
26+
However, creating a new instance can take around six or seven minutes. If you don't want to have this downtime, you can configure a minimum instance count of two, ideally with Availability Zone support. This way you have at least two instances in your Azure Application Gateway under normal circumstances. So if one of them had a problem the other tries to handle the traffic while a new instance is being created. An Azure Application Gateway instance can support around 10 Capacity Units. Depending on how much traffic you typically have, you might want to configure your minimum instance autoscaling setting to a value higher than two.
2727

28-
For scale-in events, Application Gateway will drain existing connections for 5 minutes on the instance that is subject for removal. After 5 minutes, existing connections will be closed and the instance removed. Any new connections during or after the 5 minute scale-in time will be established to other existing instances on the same gateway.
28+
For scale-in events, Application Gateway drains existing connections for 5 minutes on the instance that is subject for removal. After 5 minutes, existing connections are closed and the instance removed. Any new connections during or after the 5 minute scale-in time is established to other existing instances on the same gateway.
2929

3030

3131
## Next steps
3232

33+
- Learn how to [Schedule autoscaling for Application Gateway](application-gateway-externally-managed-scheduled-autoscaling.md)
3334
- Learn more about [Application Gateway v2](overview-v2.md)
3435
- [Create an autoscaling, zone redundant application gateway with a reserved virtual IP address using Azure PowerShell](tutorial-autoscale-ps.md)
3536

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
3+
title: Externally managed scheduled autoscaling for Application Gateway v2
4+
description: This article introduces the Azure Application Standard_v2 and WAF_v2 SKU scheduled autoscaling feature.
5+
services: application-gateway
6+
author: greg-lindsay
7+
ms.service: application-gateway
8+
ms.topic: how-to
9+
ms.date: 10/30/2023
10+
ms.author: greglin
11+
12+
---
13+
# Schedule autoscaling for Application Gateway v2
14+
15+
## Overview
16+
17+
For those experiencing predictable daily traffic patterns and who have a reliable estimate of the required capacity for Application Gateway, the option to preschedule the minimum capacity to better align with traffic demands might be of interest.
18+
19+
While autoscaling is commonly utilized, it’s important to note that Application Gateway doesn't currently support prescheduled capacity adjustments natively.
20+
21+
The goal is to use Azure Automation to create a schedule for running runbooks that adjust the minimum autoscaling capacity of Application Gateway to meet traffic demands.
22+
23+
## Set up scheduled autoscaling
24+
25+
To implement scheduled autoscaling:
26+
1. Create an Azure Automation account resource in the same tenant as the Application Gateway.
27+
2. Note the system assigned managed identity of the Azure Automation account.
28+
3. Create PowerShell runbooks for increasing and decreasing min autoscaling capacity for the Application Gateway resource.
29+
4. Create the schedules during which the runbooks need to be implemented.
30+
5. Associate the runbooks with their respective schedules.
31+
6. Associate the system assigned managed identity noted in step 2 with the Application Gateway resource.
32+
33+
## Configure automation
34+
35+
Suppose the requirement is to increase the min count to 4 during business hours and to decrease the min count to 2 during non business hours.
36+
37+
Two runbooks are created:
38+
- IncreaseMin - Sets the min count of the autoscaling configuration to 4
39+
- DecreaseMin - Sets the min count of the autoscaling configuration to 2
40+
41+
Use the following PowerShell runbook to adjust capacity:
42+
43+
```Azure PowerShell
44+
# Get the context of the managed identity
45+
$context = (Connect-AzAccount -Identity).Context
46+
# Import the Az module
47+
Import-Module Az
48+
# Adjust the min count of your Application Gateway
49+
$gw = Get-AzApplicationGateway -Name “<AppGwName>” -ResourceGroupName “<ResourceGroupName>”
50+
$gw = Set-AzApplicationGatewayAutoscaleConfiguration -ApplicationGateway $gw -MinCapacity <NumberOfRequiredInstances>
51+
$gw = Set-AzApplicationGateway -ApplicationGateway $gw
52+
```
53+
54+
Next, create the following two schedules:
55+
56+
- WeekdayMorning – Run the IncreaseMin runbook from Mon-Fri at 5:00AM PST
57+
- WeekdayEvening – Run the DecreaseMin runbook from Mon-Fri at 9:00PM PST
58+
59+
## FAQs
60+
61+
- What is the SLA for timely job executions?
62+
63+
Azure Automation has a SLA of 99.9% for a timely start of jobs.
64+
65+
- What happens if jobs are interrupted during execution?
66+
67+
- If the job already sends the request to AppGW before getting interrupted, then the request goes through.
68+
- If the job gets interrupted before sending the request to Application Gateway, then it will be one of the scenarios described in next section.
69+
70+
- What happens if job tasks don’t occur?
71+
72+
| Absent job | Impact |
73+
| --- | --- |
74+
|IncreaseMin | Falls back on native autoscaling. Next run of DecreaseMin should be no-op as the count doesn’t need to be adjusted. |
75+
|DecreaseMin | Additional cost to the customer for the (unintended) capacity that is provisioned for those hours. Next run of IncreaseMin should be no-op because the count doesn’t need to be adjusted. |
76+
77+
> [!NOTE]
78+
> Send email to [email protected] if you have questions or need help to set up managed and scheduled autoscale for your deployments.
79+
80+
## Next steps
81+
82+
* Learn more about [Scaling Application Gateway v2 and WAF v2](application-gateway-autoscaling-zone-redundant.md)
83+
* Learn more about [Monitoring Azure Automation runbooks with metric alerts](../automation/automation-alert-metric.md)
84+
* Learn more about [Azure Automation](../automation/overview.md)

articles/application-gateway/toc.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@
257257
items:
258258
- name: Azure portal
259259
href: rewrite-url-portal.md
260-
- name: Configure App Service
261-
href: configure-web-app.md
262260
- name: Configure custom probes
263261
items:
264262
- name: Portal
@@ -267,6 +265,10 @@
267265
href: application-gateway-create-probe-classic-ps.md
268266
- name: Resource Manager PowerShell
269267
href: application-gateway-create-probe-ps.md
268+
- name: Configure App Service
269+
href: configure-web-app.md
270+
- name: Schedule autoscaling
271+
href: application-gateway-externally-managed-scheduled-autoscaling.md
270272
- name: Troubleshoot
271273
items:
272274
- name: ILB with an App Service Environment
0 Bytes
Loading

0 commit comments

Comments
 (0)