Skip to content

Commit a386c99

Browse files
committed
edits
1 parent 6619951 commit a386c99

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

articles/devtest-labs/devtest-lab-auto-shutdown.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This article explains how to set autoshutdown schedules and policies for labs an
2020
- To set autoshutdown schedules for an individual lab VM if allowed by policy, at least **Contributor**-level permissions on the VM.
2121
- To create the Logic Apps app to send shutdown notifications, an Outlook 365 email client, and at least **Contributor**-level permissions in the Azure subscription that contains the DevTest Lab instance.
2222

23+
<a name="configure-lab-auto-shutdown-schedule"></a>
2324
## Configure lab autoshutdown schedule
2425

2526
By default, this schedule applies to all VMs in the lab. To remove this setting from a specific VM if allowed by policy, open the VM's management pane and change its **Auto-shutdown** setting.
@@ -40,6 +41,7 @@ To set your lab's autoshutdown schedule:
4041
> [!NOTE]
4142
> If you update the autoshutdown schedule for your lab or a VM within 30 minutes before the previously scheduled shutdown time, the new shutdown schedule takes effect the next day.
4243
44+
<a name="configure-lab-auto-shutdown-policy"></a>
4345
## Configure lab autoshutdown policy
4446

4547
As a lab owner, you can control cost and minimize waste in your labs by managing autoshutdown policy settings for your lab. For more information about lab policies, see [Define lab policies in Azure DevTest Labs](devtest-lab-set-lab-policy.md).
@@ -54,7 +56,9 @@ To set autoshutdown policy for your lab:
5456
1. On the **Auto shutdown policy** page, select one of the following options:
5557

5658
- **User sets a schedule and can opt out**: Lab users can override or opt out of the lab schedule. This option grants VM owners full control to set their own VMs' autoshutdown schedules.
59+
5760
- **User sets a schedule and cannot opt out**: Lab users can change the shutdown schedule for their own VMs, but they can't opt out of the autoshutdown policy. VM owners can update the shutdown time and set up shutdown notifications. This option ensures that every lab VM is under an autoshutdown schedule.
61+
5862
- **User has no control over the schedule set by lab administrator**: Lab users can't alter or opt out of the lab autoshutdown schedule. VM owners can still set up shutdown notifications for their VMs. This option gives the lab administrator complete control of the schedule for all lab VMs.
5963

6064
1. Select **Save**.
@@ -87,36 +91,39 @@ After you update autoshutdown settings, you can see that activity logged in the
8791

8892
## Configure autoshutdown notifications
8993

90-
When you enable autoshutdown notifications, lab users receive a notification 30 minutes before autoshutdown affects any of their VMs. The notification gives users a chance to save their work before the shutdown. If the autoshutdown settings specify an email address, the notification sends to that email address. If the settings specify a webhook, the notification sends to the webhook URL.
94+
When you enable autoshutdown notifications, lab users receive a notification 30 minutes before autoshutdown affects their VMs. The notification gives users a chance to save their work before the shutdown. If the autoshutdown settings specify an email address, the notification sends to that email address. If the settings specify a webhook, the notification sends to the webhook URL.
9195

9296
The notification can also provide links that allow the following actions for each VM:
9397

9498
- Skip the autoshutdown this time.
95-
- Snooze the autoshutdown for an hour.
96-
- Snooze the autoshutdown for 2 hours.
99+
- Delay the autoshutdown for an hour.
100+
- Delay the autoshutdown for 2 hours.
97101

98102
You can use webhooks to implement your notifications. You set up integrations that subscribe to certain events. When one of those events occurs, an HTTP POST payload sends to the webhook's URL.
99103

100-
Apps like [Azure Logic Apps](/azure/logic-apps/logic-apps-overview) have extensive support for webhooks. For more information about responding to webhooks, see [Azure Functions HTTP triggers and bindings overview](/azure/azure-functions/functions-bindings-http-webhook) and [Add an HTTP trigger for Azure Logic Apps](/azure/connectors/connectors-native-http#add-an-http-trigger).
104+
Apps like [Azure Logic Apps](/azure/logic-apps/logic-apps-overview) have extensive support for webhooks. The following section describes how to use Logic Apps to configure an autoshutdown email notification to VM owners.
105+
106+
For more information about responding to webhooks, see:
101107

102-
The following section shows you how to use Logic Apps to configure an autoshutdown email notification to VM owners.
108+
- [Azure Functions HTTP triggers and bindings overview](/azure/azure-functions/functions-bindings-http-webhook)
109+
- [Add an HTTP trigger for Azure Logic Apps](/azure/connectors/connectors-native-http#add-an-http-trigger)
103110

104111
## Create a logic app that sends email notifications
105112

106113
Logic Apps provides many connectors that make it easy to integrate a service with other clients like Office 365. The following high-level steps set up a logic app for email notification.
107114

108-
1. Create a logic app.
115+
1. Create the logic app.
109116
1. Configure the built-in template.
110117
1. Integrate with your email client.
111-
1. Get the webhook URL to use in autoshutdown notification settings.
118+
1. Get the webhook URL to use in lab autoshutdown notification settings.
112119

113120
### Create the logic app
114121

115122
Follow these steps to create a logic app in Azure.
116123

117124
1. In the Azure portal, search for and select *logic apps*.
118125
1. At the top of the **Logic apps** page, select **Add**.
119-
1. For this example, select **Workflow Service Plan** and then select **Select**.
126+
1. Select **Workflow Service Plan** and then select **Select**.
120127
1. On the **Create Logic App (Workflow Service Plan)** page, provide the following information:
121128

122129
- **Subscription**: Make sure to use the same Azure subscription as your lab.
@@ -135,7 +142,6 @@ Follow these steps to create a logic app in Azure.
135142
### Configure the built-in template
136143

137144
1. On the Azure portal home page for your logic app, select **Create a workflow in Designer** on the **Get started** tab.
138-
1. On the Logic App page, select **Logic app designer** under **Deployment Tools** in the left navigation.
139145
1. On the **Workflows** page, select **Add** > **Add from Template**.
140146
1. On the **Templates** page, search for *request* and then select **Request-Response: Receive and respond to messages over HTTP or HTTPS**.
141147

@@ -145,20 +151,19 @@ Follow these steps to create a logic app in Azure.
145151

146152
:::image type="content" source="media/devtest-lab-auto-shutdown/select-use-this-template.png" alt-text="Screenshot showing selecting Use this template.":::
147153

148-
1. On the **Create a new workflow from template** page, provide a name for the workflow, select **Stateless** under **State type**, and then select **Next**.
154+
1. On the **Create a new workflow from template** page, provide a name for the workflow.
155+
1. Select **Stateless** under **State type**, and then select **Next**.
149156

150157
:::image type="content" source="media/devtest-lab-auto-shutdown/create-from-template.png" alt-text="Screenshot showing the Create from template screen.":::
151158

152159
1. Review the settings and then select **Create**. The **Designer** page for your workflow opens.
153160

154-
1. On the **Designer** page, select **When an HTTP request is received**.
161+
1. On the **Designer** page, select the **When an HTTP request is received** step.
155162

156163
:::image type="content" source="media/devtest-lab-auto-shutdown/designer.png" alt-text="Screenshot showing the workflow Designer page.":::
157164

158165
1. On the **When an HTTP request is received** screen, paste the following JSON code into the **Request Body JSON Schema** section, and then select **Save**.
159166

160-
:::image type="content" source="media/devtest-lab-auto-shutdown/request-json.png" alt-text="Screenshot showing the Request Body JSON Schema in the designer.":::
161-
162167
```json
163168
{
164169
"$schema": "http://json-schema.org/draft-04/schema#",
@@ -222,6 +227,8 @@ Follow these steps to create a logic app in Azure.
222227
}
223228
```
224229

230+
:::image type="content" source="media/devtest-lab-auto-shutdown/request-json.png" alt-text="Screenshot showing the Request Body JSON Schema in the designer.":::
231+
225232
### Integrate with your email client.
226233

227234
1. On the **Designer** page, select the **+** below the **Response** step and select **Add an action**.
@@ -240,7 +247,7 @@ Follow these steps to create a logic app in Azure.
240247

241248
:::image type="content" source="media/devtest-lab-auto-shutdown/email-options.png" alt-text="Screenshot showing shows an example notification email.":::
242249

243-
1. Select **Save** on the top toolbar.
250+
1. On the **Designer** page, select **Save** on the top toolbar.
244251

245252
### Get the webhook URL
246253

@@ -250,12 +257,10 @@ Follow these steps to create a logic app in Azure.
250257

251258
:::image type="content" source="media/devtest-lab-auto-shutdown/webhook-url.png" alt-text="Screenshot showing copying the webhook URL.":::
252259

253-
1. On the **Auto-shutdown** configuration page for your lab, paste this webhook URL into the **Webhook URL** field for notification settings.
260+
1. On the **Auto-shutdown** configuration page for your lab, paste this webhook URL into the **Webhook URL** field in the notification settings, and select **Save**.
254261

255262
:::image type="content" source="media/devtest-lab-auto-shutdown/auto-shutdown-settings-webhook.png" alt-text="Screenshot showing pasting the webhook URL into the auto-shutdown settings.":::
256263

257-
1. Select **Save**.
258-
259264
## Related content
260265

261266
- [Auto startup lab virtual machines](devtest-lab-auto-startup-vm.yml)
-3.47 KB
Loading
-6.76 KB
Loading

0 commit comments

Comments
 (0)