You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/devtest-labs/devtest-lab-auto-shutdown.md
+22-17Lines changed: 22 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ This article explains how to set autoshutdown schedules and policies for labs an
20
20
- To set autoshutdown schedules for an individual lab VM if allowed by policy, at least **Contributor**-level permissions on the VM.
21
21
- 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.
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:
40
41
> [!NOTE]
41
42
> 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.
42
43
44
+
<aname="configure-lab-auto-shutdown-policy"></a>
43
45
## Configure lab autoshutdown policy
44
46
45
47
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:
54
56
1. On the **Auto shutdown policy** page, select one of the following options:
55
57
56
58
-**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
+
57
60
-**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
+
58
62
-**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.
59
63
60
64
1. Select **Save**.
@@ -87,36 +91,39 @@ After you update autoshutdown settings, you can see that activity logged in the
87
91
88
92
## Configure autoshutdown notifications
89
93
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.
91
95
92
96
The notification can also provide links that allow the following actions for each VM:
93
97
94
98
- 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.
97
101
98
102
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.
99
103
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:
101
107
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)
103
110
104
111
## Create a logic app that sends email notifications
105
112
106
113
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.
107
114
108
-
1. Create a logic app.
115
+
1. Create the logic app.
109
116
1. Configure the built-in template.
110
117
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.
112
119
113
120
### Create the logic app
114
121
115
122
Follow these steps to create a logic app in Azure.
116
123
117
124
1. In the Azure portal, search for and select *logic apps*.
118
125
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**.
120
127
1. On the **Create Logic App (Workflow Service Plan)** page, provide the following information:
121
128
122
129
-**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.
135
142
### Configure the built-in template
136
143
137
144
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.
139
145
1. On the **Workflows** page, select **Add** > **Add from Template**.
140
146
1. On the **Templates** page, search for *request* and then select **Request-Response: Receive and respond to messages over HTTP or HTTPS**.
141
147
@@ -145,20 +151,19 @@ Follow these steps to create a logic app in Azure.
145
151
146
152
:::image type="content" source="media/devtest-lab-auto-shutdown/select-use-this-template.png" alt-text="Screenshot showing selecting Use this template.":::
147
153
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**.
149
156
150
157
:::image type="content" source="media/devtest-lab-auto-shutdown/create-from-template.png" alt-text="Screenshot showing the Create from template screen.":::
151
158
152
159
1. Review the settings and then select **Create**. The **Designer** page for your workflow opens.
153
160
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.
155
162
156
163
:::image type="content" source="media/devtest-lab-auto-shutdown/designer.png" alt-text="Screenshot showing the workflow Designer page.":::
157
164
158
165
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**.
159
166
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.":::
@@ -222,6 +227,8 @@ Follow these steps to create a logic app in Azure.
222
227
}
223
228
```
224
229
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
+
225
232
### Integrate with your email client.
226
233
227
234
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.
240
247
241
248
:::image type="content" source="media/devtest-lab-auto-shutdown/email-options.png" alt-text="Screenshot showing shows an example notification email.":::
242
249
243
-
1. Select **Save** on the top toolbar.
250
+
1. On the **Designer** page, select **Save** on the top toolbar.
244
251
245
252
### Get the webhook URL
246
253
@@ -250,12 +257,10 @@ Follow these steps to create a logic app in Azure.
250
257
251
258
:::image type="content" source="media/devtest-lab-auto-shutdown/webhook-url.png" alt-text="Screenshot showing copying the webhook URL.":::
252
259
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**.
254
261
255
262
:::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.":::
0 commit comments