Skip to content

Commit 2227b2a

Browse files
Merge pull request #218344 from deeikele/deeikele/audit-ci
Audit and observe compute instance os version preview
2 parents 286ca01 + 6970b60 commit 2227b2a

File tree

2 files changed

+68
-2
lines changed

2 files changed

+68
-2
lines changed

articles/machine-learning/concept-vulnerability-management.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ It's a shared responsibility between you and Microsoft to ensure that your envir
7272

7373
### Compute instance
7474

75-
Compute instances get the latest VM images at the time of provisioning. Microsoft releases new VM images on a monthly basis. Once a compute instance is deployed, it does not get actively updated. To keep current with the latest software updates and security patches, you could:
75+
Compute instances get the latest VM images at the time of provisioning. Microsoft releases new VM images on a monthly basis. Once a compute instance is deployed, it does not get actively updated. You could [query an instance's operating system version](how-to-create-manage-compute-instance.md#audit-and-observe-compute-instance-version-preview). To keep current with the latest software updates and security patches, you could:
7676

7777
1. Recreate a compute instance to get the latest OS image (recommended)
7878

@@ -147,4 +147,4 @@ For code-based training experiences, you control which Azure Machine Learning en
147147
* [Azure Machine Learning Base Images Repository](https://github.com/Azure/AzureML-Containers)
148148
* [Data Science Virtual Machine release notes](./data-science-virtual-machine/release-notes.md)
149149
* [AzureML Python SDK Release Notes](./azure-machine-learning-release-notes.md)
150-
* [Machine learning enterprise security](/azure/cloud-adoption-framework/ready/azure-best-practices/ai-machine-learning-enterprise-security)
150+
* [Machine learning enterprise security](/azure/cloud-adoption-framework/ready/azure-best-practices/ai-machine-learning-enterprise-security)

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

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,72 @@ To create a compute instance, you'll need permissions for the following actions:
726726
* *Microsoft.MachineLearningServices/workspaces/computes/write*
727727
* *Microsoft.MachineLearningServices/workspaces/checkComputeNameAvailability/action*
728728
729+
### Audit and observe compute instance version (preview)
730+
731+
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).
732+
733+
To keep track of whether a compute instance's operating system version is current, you could query an instance's version using the Studio UI, CLI and SDK.
734+
735+
# [Python SDK](#tab/python)
736+
737+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
738+
739+
```python
740+
from azure.ai.ml.entities import ComputeInstance, AmlCompute
741+
742+
# Display operating system version
743+
instance = ml_client.compute.get("myci")
744+
print instance.os_image_metadata
745+
```
746+
747+
For more information on the classes, methods, and parameters used in this example, see the following reference documents:
748+
749+
* [`AmlCompute` class](/python/api/azure-ai-ml/azure.ai.ml.entities.amlcompute)
750+
* [`ComputeInstance` class](/python/api/azure-ai-ml/azure.ai.ml.entities.computeinstance)
751+
752+
# [Azure CLI](#tab/azure-cli)
753+
754+
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
755+
756+
```azurecli
757+
az ml compute show --name "myci"
758+
```
759+
760+
# [Studio](#tab/azure-studio)
761+
762+
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. When a more recent instance OS version is, use the creation wizard to create a new instance. Enable 'audit and observe compute instance os version' under the previews management panel to see these preview properties.
763+
764+
---
765+
766+
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:
767+
768+
```json
769+
{
770+
"mode": "All",
771+
"policyRule": {
772+
"if": {
773+
"allOf": [
774+
{
775+
"field": "type",
776+
"equals": "Microsoft.MachineLearningServices/workspaces/computes"
777+
},
778+
{
779+
"field": "Microsoft.MachineLearningServices/workspaces/computes/computeType",
780+
"equals": "ComputeInstance"
781+
},
782+
{
783+
"field": "Microsoft.MachineLearningServices/workspaces/computes/osImageMetadata.isLatestOsImageVersion",
784+
"equals": "false"
785+
}
786+
]
787+
},
788+
"then": {
789+
"effect": "Audit"
790+
}
791+
}
792+
}
793+
```
794+
729795
## Next steps
730796

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

0 commit comments

Comments
 (0)