Skip to content

Commit 148c25a

Browse files
authored
Added info on Azure Policy for auto stop
1 parent 126e6fd commit 148c25a

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

articles/machine-learning/how-to-create-manage-compute-instance.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,59 @@ This setting can be configured during CI creation or for existing CIs via the fo
210210
}
211211
```
212212
213+
### Azure policy support
214+
Administrators can use a built-in [Azure Policy](./../governance/policy/overview.md) definition to enfore auto-stop on all compute instances in a give subsription/resource-group.
215+
216+
1. Navigate to Azure Policy in the Azure Portal
217+
2. Under "Definitions", look for the idle shutdown policy
218+
:::image type="content" source="media/how-to-create-attach-studio/idle-shutdown-policy.png" alt-text="Screenshot for the idle shutdown policy in Azure Portal.":::
219+
220+
3. Assign policy to the necessary scope
221+
222+
You can also create your own custom Azure policy. For example, if the below policy is assigned, all new compute instances will have auto-stop configured with a 30 minute inactivity period.
223+
```json
224+
{
225+
"mode": "All",
226+
"policyRule": {
227+
"if": {
228+
"allOf": [
229+
{
230+
"field": "type",
231+
"equals": "Microsoft.MachineLearningServices/workspaces/computes"
232+
},
233+
{
234+
"field": "Microsoft.MachineLearningServices/workspaces/computes/computeType",
235+
"equals": "ComputeInstance"
236+
},
237+
{
238+
"anyOf": [
239+
{
240+
"field": "Microsoft.MachineLearningServices/workspaces/computes/idleTimeBeforeShutdown",
241+
"exists": false
242+
},
243+
{
244+
"value": "[empty(field('Microsoft.MachineLearningServices/workspaces/computes/idleTimeBeforeShutdown'))]",
245+
"equals": true
246+
}
247+
]
248+
}
249+
]
250+
},
251+
"then": {
252+
"effect": "append",
253+
"details": [
254+
{
255+
"field": "Microsoft.MachineLearningServices/workspaces/computes/idleTimeBeforeShutdown",
256+
"value": "PT60M"
257+
}
258+
]
259+
}
260+
},
261+
"parameters": {}
262+
}
263+
```
264+
265+
213266
## Create on behalf of (preview)
214267

215268
As an administrator, you can create a compute instance on behalf of a data scientist and assign the instance to them with:

0 commit comments

Comments
 (0)