Skip to content

Commit 9ce959c

Browse files
Merge pull request #211247 from Blackmist/dennis-updates
v2 updates
2 parents 6b0ba96 + 90d8d8b commit 9ce959c

File tree

4 files changed

+111
-23
lines changed

4 files changed

+111
-23
lines changed

articles/machine-learning/how-to-manage-rest.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
title: Use REST to manage ML resources
33
titleSuffix: Azure Machine Learning
44
description: How to use REST APIs to create, run, and delete Azure Machine Learning resources, such as a workspace, or register models.
5-
author: blackmist
6-
ms.author: larryfr
5+
author: deeikele
6+
ms.author: deeikele
7+
ms.reviewer: larryfr
78
services: machine-learning
89
ms.service: machine-learning
910
ms.subservice: core
10-
ms.date: 07/28/2022
11+
ms.date: 09/14/2022
1112
ms.topic: how-to
1213
ms.custom: devx-track-python
1314
---
@@ -71,7 +72,7 @@ The response should provide an access token good for one hour:
7172
}
7273
```
7374

74-
Make note of the token, as you'll use it to authenticate all additional administrative requests. You'll do so by setting an Authorization header in all requests:
75+
Make note of the token, as you'll use it to authenticate all administrative requests. You'll do so by setting an Authorization header in all requests:
7576

7677
```bash
7778
curl -h "Authorization:Bearer <YOUR-ACCESS-TOKEN>" ...more args...
@@ -340,17 +341,17 @@ providers/Microsoft.Storage/storageAccounts/<YOUR-STORAGE-ACCOUNT-NAME>"
340341

341342
## Create a workspace using customer-managed encryption keys
342343

343-
By default, metadata for the workspace is stored in an Azure Cosmos DB instance that Microsoft maintains. This data is encrypted using Microsoft-managed keys. Instead of using the Microsoft-managed key, you can also provide your own key. Doing so creates an [additional set of resources](./concept-data-encryption.md#azure-cosmos-db) in your Azure subscription to store your data.
344+
By default, metadata for the workspace is stored in an Azure Cosmos DB instance that Microsoft maintains. This data is encrypted using Microsoft-managed keys. Instead of using the Microsoft-managed key, you can also provide your own key. Doing so creates an [another set of resources](./concept-data-encryption.md#azure-cosmos-db) in your Azure subscription to store your data.
344345

345-
To create a workspaces that uses your keys for encryption, you need to meet the following prerequisites:
346+
To create a workspace that uses your keys for encryption, you need to meet the following prerequisites:
346347

347348
* The Azure Machine Learning service principal must have contributor access to your Azure subscription.
348349
* You must have an existing Azure Key Vault that contains an encryption key.
349-
* The Azure Key Vault must exist in the same Azure region where you will create the Azure Machine Learning workspace.
350-
* The Azure Key Vault must have soft delete and purge protection enabled to protect against data loss in case of accidental deletion.
350+
* The Azure Key Vault must exist in the same Azure region where you'll create the Azure Machine Learning workspace.
351+
* The Azure Key Vault must have soft delete and purge protection enabled to protect against data loss if there was accidental deletion.
351352
* You must have an access policy in Azure Key Vault that grants get, wrap, and unwrap access to the Azure Cosmos DB application.
352353

353-
To create a workspaces that uses a user-assigned managed identity and customer-managed keys for encryption, use the below request body. When using an user-assigned managed identity for the workspace, also set the `userAssignedIdentity` property to the resource ID of the managed identity.
354+
To create a workspace that uses a user-assigned managed identity and customer-managed keys for encryption, use the below request body. When using a user-assigned managed identity for the workspace, also set the `userAssignedIdentity` property to the resource ID of the managed identity.
354355

355356
```bash
356357
curl -X PUT \

articles/machine-learning/how-to-workspace-diagnostic-api.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,26 @@ ms.subservice: enterprise-readiness
88
ms.author: jhirono
99
author: jhirono
1010
ms.reviewer: larryfr
11-
ms.date: 11/18/2021
11+
ms.date: 09/14/2022
1212
ms.topic: how-to
1313
ms.custom: sdkv1, event-tier1-build-2022
1414
---
1515

1616
# How to use workspace diagnostics
1717

18+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
19+
> [!div class="op_single_selector" title1="Select the version of the Azure Machine Learning Python SDK you are using:"]
20+
> * [v1](v1/how-to-workspace-diagnostic-api.md)
21+
> * [v2 (current version)](how-to-workspace-diagnostic-api.md)
22+
1823
Azure Machine Learning provides a diagnostic API that can be used to identify problems with your workspace. Errors returned in the diagnostics report include information on how to resolve the problem.
1924

2025
You can use the workspace diagnostics from the Azure Machine Learning studio or Python SDK.
2126

2227
## Prerequisites
2328

24-
* An Azure Machine learning workspace. If you don't have one, see [Create a workspace](quickstart-create-resources.md).
25-
* The [Azure Machine Learning SDK for Python](/python/api/overview/azure/ml).
29+
[!INCLUDE [sdk](../../includes/machine-learning-sdk-v2-prereqs.md)]
30+
2631
## Diagnostics from studio
2732

2833
From [Azure Machine Learning studio](https://ml.azure.com) or the Python SDK, you can run diagnostics on your workspace to check your setup. To run diagnostics, select the '__?__' icon from the upper right corner of the page. Then select __Run workspace diagnostics__.
@@ -35,19 +40,19 @@ After diagnostics run, a list of any detected problems is returned. This list in
3540

3641
The following snippet demonstrates how to use workspace diagnostics from Python
3742

38-
[!INCLUDE [sdk v1](../../includes/machine-learning-sdk-v1.md)]
43+
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
3944

4045
```python
41-
from azureml.core import Workspace
46+
from azure.ai.ml import MLClient
47+
from azure.ai.ml.entities import Workspace
48+
from azure.identity import DefaultAzureCredential
4249

43-
ws = Workspace.from_config()
44-
45-
diag_param = {
46-
"value": {
47-
}
48-
}
50+
subscription_id = '<your-subscription-id>'
51+
resource_group = '<your-resource-group-name>'
52+
workspace = '<your-workspace-name>'
4953

50-
resp = ws.diagnose_workspace(diag_param)
54+
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group)
55+
resp = ml_client.workspaces.begin_diagnose(workspace)
5156
print(resp)
5257
```
5358

@@ -75,9 +80,8 @@ The response is a JSON document that contains information on any problems detect
7580

7681
If no problems are detected, an empty JSON document is returned.
7782

78-
For more information, see the [Workspace.diagnose_workspace()](/python/api/azureml-core/azureml.core.workspace(class)#diagnose-workspace-diagnose-parameters-) reference.
83+
For more information, see the [Workspace](/python/api/azure-ai-ml/azure.ai.ml.entities.workspace) reference.
7984

8085
## Next steps
8186

82-
* [Workspace.diagnose_workspace()](/python/api/azureml-core/azureml.core.workspace(class)#diagnose-workspace-diagnose-parameters-)
8387
* [How to manage workspaces in portal or SDK](how-to-manage-workspace.md)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: Workspace diagnostics (v1)
3+
titleSuffix: Azure Machine Learning
4+
description: Learn how to use Azure Machine Learning workspace diagnostics with the Python SDK v1.
5+
services: machine-learning
6+
ms.service: machine-learning
7+
ms.subservice: enterprise-readiness
8+
ms.author: jhirono
9+
author: jhirono
10+
ms.reviewer: larryfr
11+
ms.date: 09/14/2022
12+
ms.topic: how-to
13+
ms.custom: sdkv1, event-tier1-build-2022
14+
---
15+
16+
# How to use workspace diagnostics (SDK v1)
17+
18+
[!INCLUDE [sdk v1](../../../includes/machine-learning-sdk-v1.md)]
19+
> [!div class="op_single_selector" title1="Select the version of the Azure Machine Learning Python SDK you are using:"]
20+
> * [v1](how-to-workspace-diagnostic-api.md)
21+
> * [v2 (current version)](../how-to-workspace-diagnostic-api.md)
22+
23+
Azure Machine Learning provides a diagnostic API that can be used to identify problems with your workspace. Errors returned in the diagnostics report include information on how to resolve the problem.
24+
25+
In this article, learn how to use the workspace diagnostics from the Azure Machine Learning Python SDK v1.
26+
27+
## Prerequisites
28+
29+
* An Azure Machine learning workspace. If you don't have one, see [Create a workspace](../quickstart-create-resources.md).
30+
* The [Azure Machine Learning SDK for Python](/python/api/overview/azure/ml).
31+
32+
## Diagnostics from Python
33+
34+
The following snippet demonstrates how to use workspace diagnostics from Python
35+
36+
[!INCLUDE [sdk v1](../../../includes/machine-learning-sdk-v1.md)]
37+
38+
```python
39+
from azureml.core import Workspace
40+
41+
ws = Workspace.from_config()
42+
43+
diag_param = {
44+
"value": {
45+
}
46+
}
47+
48+
resp = ws.diagnose_workspace(diag_param)
49+
print(resp)
50+
```
51+
52+
The response is a JSON document that contains information on any problems detected with the workspace. The following JSON is an example response:
53+
54+
```json
55+
{
56+
'value': {
57+
'user_defined_route_results': [],
58+
'network_security_rule_results': [],
59+
'resource_lock_results': [],
60+
'dns_resolution_results': [{
61+
'code': 'CustomDnsInUse',
62+
'level': 'Warning',
63+
'message': "It is detected VNet '/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Network/virtualNetworks/<virtual-network-name>' of private endpoint '/subscriptions/<subscription-id>/resourceGroups/larrygroup0916/providers/Microsoft.Network/privateEndpoints/<workspace-private-endpoint>' is not using Azure default dns. You need to configure your DNS server and check https://docs.microsoft.com/azure/machine-learning/how-to-custom-dns to make sure the custom dns is set up correctly."
64+
}],
65+
'storage_account_results': [],
66+
'key_vault_results': [],
67+
'container_registry_results': [],
68+
'application_insights_results': [],
69+
'other_results': []
70+
}
71+
}
72+
```
73+
74+
If no problems are detected, an empty JSON document is returned.
75+
76+
For more information, see the [Workspace.diagnose_workspace()](/python/api/azureml-core/azureml.core.workspace(class)#diagnose-workspace-diagnose-parameters-) reference.
77+
78+
## Next steps
79+
80+
* [Workspace.diagnose_workspace()](/python/api/azureml-core/azureml.core.workspace(class)#diagnose-workspace-diagnose-parameters-)
81+
* [How to manage workspaces in portal or SDK](../how-to-manage-workspace.md)

articles/machine-learning/v1/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
- name: Set up software environments CLI (v1)
8484
href: how-to-use-environments.md
8585
- name: Create & manage compute resources
86+
- name: Workspace Diagnostics
87+
href: how-to-workspace-diagnostic-api.md
8688
items:
8789
- name: Compute instance
8890
displayName: compute target

0 commit comments

Comments
 (0)