Skip to content

Commit a2eb392

Browse files
Merge pull request #267471 from Blackmist/194465
updating
2 parents 3cc68f9 + 2fda1bb commit a2eb392

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.subservice: enterprise-readiness
88
ms.author: jhirono
99
author: jhirono
1010
ms.reviewer: larryfr
11-
ms.date: 01/16/2024
11+
ms.date: 02/27/2024
1212
ms.topic: how-to
1313
ms.custom: sdkv2, devx-track-python
1414
monikerRange: 'azureml-api-2 || azureml-api-1'
@@ -62,9 +62,14 @@ resource_group = '<your-resource-group-name>'
6262
workspace = '<your-workspace-name>'
6363

6464
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group)
65-
resp = ml_client.workspaces.begin_diagnose(workspace)
66-
print(resp)
65+
resp = ml_client.workspaces.begin_diagnose(workspace).result()
66+
# Inspect the attributes of the response you are interested in
67+
for result in resp.application_insights_results:
68+
print(f"Diagnostic result: {result.code}, {result.level}, {result.message}")
69+
6770
```
71+
72+
The response is a [DiagnoseResponseResultValue](/python/api/azure-ai-ml/azure.ai.ml.entities.diagnoseresponseresultvalue) object that contains information on any problems detected with the workspace.
6873
:::moniker-end
6974
:::moniker range="azureml-api-1"
7075
[!INCLUDE [sdk v1](includes/machine-learning-sdk-v1.md)]
@@ -82,7 +87,6 @@ diag_param = {
8287
resp = ws.diagnose_workspace(diag_param)
8388
print(resp)
8489
```
85-
:::moniker-end
8690

8791
The response is a JSON document that contains information on any problems detected with the workspace. The following JSON is an example response:
8892

@@ -95,7 +99,7 @@ The response is a JSON document that contains information on any problems detect
9599
"dns_resolution_results": [{
96100
"code": "CustomDnsInUse",
97101
"level": "Warning",
98-
"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://learn.microsoft.com/azure/machine-learning/how-to-custom-dns to make sure the custom DNS is set up correctly."
102+
"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/<myresourcegroup>/providers/Microsoft.Network/privateEndpoints/<workspace-private-endpoint>' is not using Azure default DNS. You need to configure your DNS server and check https://learn.microsoft.com/azure/machine-learning/how-to-custom-dns to make sure the custom DNS is set up correctly."
99103
}],
100104
"storage_account_results": [],
101105
"key_vault_results": [],
@@ -107,6 +111,7 @@ The response is a JSON document that contains information on any problems detect
107111
```
108112

109113
If no problems are detected, an empty JSON document is returned.
114+
:::moniker-end
110115

111116
:::moniker range="azureml-api-2"
112117
For more information, see the [Workspace](/python/api/azure-ai-ml/azure.ai.ml.entities.workspace) reference.

0 commit comments

Comments
 (0)