Skip to content

Commit faab6a3

Browse files
authored
Include CLI/SDK and policy instructions
1 parent 2765dde commit faab6a3

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

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

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -744,41 +744,42 @@ To create a compute instance, you'll need permissions for the following actions:
744744
* *Microsoft.MachineLearningServices/workspaces/computes/write*
745745
* *Microsoft.MachineLearningServices/workspaces/checkComputeNameAvailability/action*
746746

747-
### Audit and observe compute instance version (preview)
747+
### Audit and observe compute instance version
748748

749749
Once a compute instance is deployed, it does not get automatically updated. Microsoft [releases](azure-machine-learning-ci-image-release-notes.md) new VM images on a monthly basis. To understand options for keeping recent with the latest version, see [vulnerability management](concept-vulnerability-management.md#compute-instance).
750750

751-
To keep track of whether an instance's operating system version is current, you could query its version using the Studio UI. In your workspace in Azure Machine Learning studio, select Compute, then select compute instance on the top. Select a compute instance's compute name to see its properties including the current operating system. Enable 'audit and observe compute instance os version' under the previews management panel to see these preview properties.
751+
To keep track of whether an instance's operating system version is current, you could query its version using the CLI, SDK or Studio UI.
752752

753-
Administrators can use [Azure Policy](./../governance/policy/overview.md) definitions to audit instances that are running on outdated operating system versions across workspaces and subscriptions. The following is a sample policy:
753+
# [Studio UI](#tab/azure-studio)
754754

755-
```json
756-
{
757-
"mode": "All",
758-
"policyRule": {
759-
"if": {
760-
"allOf": [
761-
{
762-
"field": "type",
763-
"equals": "Microsoft.MachineLearningServices/workspaces/computes"
764-
},
765-
{
766-
"field": "Microsoft.MachineLearningServices/workspaces/computes/computeType",
767-
"equals": "ComputeInstance"
768-
},
769-
{
770-
"field": "Microsoft.MachineLearningServices/workspaces/computes/osImageMetadata.isLatestOsImageVersion",
771-
"equals": "false"
772-
}
773-
]
774-
},
775-
"then": {
776-
"effect": "Audit"
777-
}
778-
}
779-
}
755+
In your workspace in Azure Machine Learning studio, select Compute, then select compute instance on the top. Select a compute instance's compute name to see its properties including the current operating system.
756+
757+
# [Python SDK](#tab/python)
758+
759+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
760+
761+
```python
762+
from azure.ai.ml.entities import ComputeInstance, AmlCompute
763+
# Display operating system version
764+
instance = ml_client.compute.get("myci")
765+
print instance.os_image_metadata
766+
```
767+
768+
For more information on the classes, methods, and parameters used in this example, see the following reference documents:
769+
770+
* [`AmlCompute` class](/python/api/azure-ai-ml/azure.ai.ml.entities.amlcompute)
771+
* [`ComputeInstance` class](/python/api/azure-ai-ml/azure.ai.ml.entities.computeinstance)
772+
773+
# [Azure CLI](#tab/azure-cli)
774+
775+
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
776+
777+
```azurecli
778+
az ml compute show --name "myci"
780779
```
781780

781+
IT administrators can use [Azure Policy](./../governance/policy/overview.md) to monitor the inventory instances across workspaces in Azure compliance center. Assign the built-in policy [Audit Azure Machine Learning Compute Instances with an outdated operating system](https://ms.portal.azure.com/#view/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2Ff110a506-2dcb-422e-bcea-d533fc8c35e2) on an Azure subscription or Azure management group scope.
782+
782783
## Next steps
783784

784785
* [Access the compute instance terminal](how-to-access-terminal.md)

0 commit comments

Comments
 (0)