Skip to content

Commit 14bbdbc

Browse files
Merge pull request #308779 from MicrosoftDocs/main
Auto Publish – main to live - 2025-11-26 06:00 UTC
2 parents 8a062cc + 0ff8b15 commit 14bbdbc

25 files changed

Lines changed: 790 additions & 61 deletions

articles/app-service/manage-automatic-scaling.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ The `AutomaticScalingInstanceCount` metric reports the number of virtual machine
178178

179179
### How does ARR Affinity affect automatic scaling?
180180

181-
Azure App Service uses Application Request Routing cookies known as an ARR Affinity. ARR Affinity cookies restrict scaling because they send requests only to servers associated with the cookie, rather than any available instance. For apps that store state, it's better to scale up (increase resources on a single instance). For stateless apps, scaling out (adding more instances) offers more flexibility and scalability. ARR Affinity cookies are enabled by default on App Service. Depending on your application needs, you might choose to disable ARR affinity cookies when using automatic scaling.
181+
> [!NOTE]
182+
> When enabling Automatic Scaling on the App Service Plan, all pre-existing apps in the plan will automatically have ARR Affinity disabled.
183+
184+
Azure App Service uses Application Request Routing cookies known as an ARR Affinity. ARR Affinity cookies restrict scaling because they send requests only to servers associated with the cookie, rather than any available instance. For apps that store state, it's better to scale up (increase resources on a single instance). For stateless apps, scaling out (adding more instances) offers more flexibility and scalability. ARR Affinity cookies are enabled by default on App Service. However, when using automatic scaling, you should disable ARR affinity cookies to ensure proper scaling.
182185

183186
To disable ARR Affinity cookies: select your App Service app, and under **Settings**, select **Configuration**. Next select the **General settings** tab. Under **Session affinity**, select **Off** and then select the **Save** button.
184187

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- name: Start/Stop VMs
2+
items:
3+
- name: Overview
4+
href: overview.md
5+
- name: Deploy Start/Stop VMs
6+
href: deploy.md
7+
- name: Manage Start/Stop VMs
8+
href: manage.md
9+
- name: Preactions in Start/Stop VMs
10+
href: actions.md
11+
- name: Remove Start/Stop VMs
12+
href: remove.md
13+
- name: Troubleshoot Start/Stop VMs
14+
href: troubleshoot.md
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Add preactions to schedules in Start/Stop VMs v2 (Azure)
3+
titleSuffix: Azure Functions
4+
description: This article shows you how to add a preaction to your Start/Stop VMs v2 schedules.
5+
ms.service: azure-functions
6+
ms.date: 09/21/2022
7+
ms.topic: how-to
8+
---
9+
10+
# Adding pre-actions to schedules in Start/Stop VMs v2
11+
12+
Pre-actions are a set of actions in Start/Stop VMs v2 that execute before scheduled start or stop actions. Some scenarios for using pre-actions before a start or stop action include:
13+
14+
- Create a backup of an Azure SQL Database.
15+
- Send a message to Azure Application Insights.
16+
- Call an external API.
17+
18+
Because Start/Stop VMs v2 uses [Azure Logic Apps](../../logic-apps/logic-apps-overview.md) to manage its schedules, it's easy to add one or more pre-actions before the main action. To learn more about Logic Apps, see the [Logic Apps documentation](../../logic-apps/logic-apps-overview.md).
19+
20+
This article describes how to use the Logic Apps Designer in the Azure portal to add an HTTP request pre-action to an existing scheduled start action in Start/Stop VMs v2. In your implementation, the pre-action can be any action supported by Logic Apps.
21+
22+
> [!NOTE]
23+
> At this time, Start/Stop VMs v2 only supports pre-actions, which are run before the execution of the main action. Because Log Apps runs Start/Stop VMs v2 actions asynchronously, there's currently no way to trigger a post-action that occurs after the main action completes.
24+
25+
## Prerequisites
26+
27+
You must first complete the steps in [Deploy Start/Stop VMs v2 to an Azure subscription][deployment article], or else complete a default deployment from the [Start Stop V2 Deployments GitHub repository](https://github.com/microsoft/startstopv2-deployments). Logic app and action names are based on the ones in a default deployment of Start/Stop VMs v2.
28+
29+
## Create an HTTP request pre-action
30+
31+
The steps in this section require the `ststv2_vms_Scheduled_start` logic app that was created and deployed when you completed the [deployment article]. However, the same basic process is used for all scheduled actions.
32+
33+
1. In the [Azure portal](https://portal.azure.com), search for and navigate to the resource group you created when you deployed Start/Stop VMs v2.
34+
35+
1. In the resource group, choose the logic app named `ststv2_vms_Scheduled_start`, which represents the default scheduled start action.
36+
37+
1. In **Overview** page of the logic app, select **Edit**.
38+
39+
1. In the Logic Apps Designer page, select **Function-Try** and then select **Add an action**.
40+
41+
:::image type="content" source="./media/pre-actions/add-action-button.png" alt-text="Screenshot of the Logic Apps designer showing Add an Action button location.":::
42+
43+
5. Choose **HTTP**, select the HTTP **Method**, and add the **URL**. This HTTP request will be the pre-action for the scheduled start action, after you change the action order in **Function-Try**. You can also configure the HTTP action at a later time.
44+
45+
6. Drag the **Scheduled** action below the new **HTTP** action in the **Function-Try** step. The pre-action must come before the scheduled action in the step. Your app should now look like the following example:
46+
47+
:::image type="content" source="./media/pre-actions/configured.png" alt-text="Screenshot of the Logic Apps designer showing the actions in the correct order.":::
48+
49+
At this point, you've defined a pre-action that's run before the start action scheduled by `ststv2_vms_Scheduled_start`.
50+
51+
## Next steps
52+
53+
If you have issues working with Start/Stop VMs v2, see the [Troubleshoot Guide](troubleshoot.md). For more assistance, you can also create an issue in the [Start Stop V2 Deployments GitHub repository](https://github.com/microsoft/startstopv2-deployments/issues).
54+
55+
56+
[deployment article]: deploy.md

0 commit comments

Comments
 (0)