Skip to content

Commit 9c8a20e

Browse files
authored
Merge pull request #98489 from shouryaj/patch-2
Added info on Azure Policy for auto stop
2 parents b79ebe3 + fcea982 commit 9c8a20e

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

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

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,61 @@ 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 given subscription/resource-group.
215+
216+
1. Navigate to Azure Policy in the Azure portal.
217+
2. Under "Definitions", look for the idle shutdown policy.
218+
219+
:::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.":::
220+
221+
3. Assign policy to the necessary scope.
222+
223+
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 60 minute inactivity period.
224+
225+
```json
226+
{
227+
"mode": "All",
228+
"policyRule": {
229+
"if": {
230+
"allOf": [
231+
{
232+
"field": "type",
233+
"equals": "Microsoft.MachineLearningServices/workspaces/computes"
234+
},
235+
{
236+
"field": "Microsoft.MachineLearningServices/workspaces/computes/computeType",
237+
"equals": "ComputeInstance"
238+
},
239+
{
240+
"anyOf": [
241+
{
242+
"field": "Microsoft.MachineLearningServices/workspaces/computes/idleTimeBeforeShutdown",
243+
"exists": false
244+
},
245+
{
246+
"value": "[empty(field('Microsoft.MachineLearningServices/workspaces/computes/idleTimeBeforeShutdown'))]",
247+
"equals": true
248+
}
249+
]
250+
}
251+
]
252+
},
253+
"then": {
254+
"effect": "append",
255+
"details": [
256+
{
257+
"field": "Microsoft.MachineLearningServices/workspaces/computes/idleTimeBeforeShutdown",
258+
"value": "PT60M"
259+
}
260+
]
261+
}
262+
},
263+
"parameters": {}
264+
}
265+
```
266+
267+
213268
## Create on behalf of (preview)
214269

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

0 commit comments

Comments
 (0)