Skip to content

Commit c4480a7

Browse files
Merge pull request #308543 from cdpark/restore-stop-start-vm
Feature 449504: Q&M: Move Start/Stop VMs v2 content to the Learn archive
2 parents efb7db0 + 43b9562 commit c4480a7

16 files changed

Lines changed: 738 additions & 0 deletions
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

articles/azure-functions/start-stop-v2/deploy.md

Lines changed: 417 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Manage Start/Stop VMs v2
3+
titleSuffix: Azure Functions
4+
description: This article tells how to monitor status of your Azure VMs managed by the Start/Stop VMs v2 feature and perform other management tasks.
5+
ms.service: azure-functions
6+
ms.date: 06/08/2022
7+
ms.topic: conceptual
8+
---
9+
10+
# How to manage Start/Stop VMs v2
11+
12+
## Azure dashboard
13+
14+
Start/Stop VMs v2 includes a [dashboard](/azure/azure-monitor/best-practices-analysis#azure-dashboards) to help you understand the management scope and recent operations against your VMs. It is a quick and easy way to verify the status of each operation that’s performed on your Azure VMs. The visualization in each tile is based on a Log query and to see the query, select the **Open in logs blade** option in the right-hand corner of the tile. This opens the [Log Analytics](/azure/azure-monitor/logs/log-analytics-overview#start-log-analytics) tool in the Azure portal, and from here you can evaluate the query and modify to support your needs, such as custom [log alerts](/azure/azure-monitor/alerts/alerts-log), a custom [workbook](/azure/azure-monitor/visualize/workbooks-overview), etc.
15+
16+
The log data each tile in the dashboard displays is refreshed every hour, with a manual refresh option on demand by clicking the **Refresh** icon on a given visualization, or by refreshing the full dashboard.
17+
18+
To learn about working with a log-based dashboard, see the following [tutorial](/azure/azure-monitor/visualize/tutorial-logs-dashboards).
19+
20+
## Configure email notifications
21+
22+
To change email notifications after Start/Stop VMs v2 is deployed, you can modify the action group created during deployment.
23+
24+
1. In the Azure portal, navigate to **Monitor**, then **Alerts**. Select **Action groups**.
25+
26+
1. On the **Manage actions** page, select the action group called **StartStopV2_VM_Notification**.
27+
28+
:::image type="content" source="media/manage/alerts-action-groups.png" alt-text="Screenshot of the Action groups page.":::
29+
30+
1. On the **StartStopV2_VM_Notification** page, you can modify the Email/SMS/Push/Voice notification options. Add other actions or update your existing configuration to this action group and then click **OK** to save your changes.
31+
32+
:::image type="content" source="media/manage/email-notification-type-example.png" alt-text="Screenshot of the Email/SMS/Push/Voice page showing an example email address updated.":::
33+
34+
To learn more about action groups, see [action groups](/azure/azure-monitor/alerts/action-groups)
35+
36+
The following screenshot is an example email that is sent when the feature shuts down virtual machines.
37+
38+
:::image type="content" source="media/manage/email-notification-example.png" alt-text="Screenshot of an example email sent when the feature shuts down virtual machines.":::
39+
40+
## Next steps
41+
42+
To handle problems during VM management, see [Troubleshoot Start/Stop VMs v2](troubleshoot.md) issues.
35.7 KB
Loading
200 KB
Loading
19.1 KB
Loading
42.8 KB
Loading
68.4 KB
Loading
24.8 KB
Loading

0 commit comments

Comments
 (0)