Så här använder du arbetsytediagnostik

GÄLLER FÖR:Python SDK azureml v1

Azure Machine Learning tillhandahåller ett diagnostik-API som du kan använda för att identifiera problem med din arbetsyta. Felen som returneras i diagnostikrapporten innehåller information om hur du löser problemet.

Du kan använda arbetsytans diagnostik från Azure Machine Learning Studio eller Python SDK.

Förutsättningar

Innan du följer stegen i den här artikeln kontrollerar du att du har följande förutsättningar:

Diagnostik från studio

Från Azure Machine Learning Studio kan du köra diagnostik mot arbetsytan för att kontrollera din konfiguration. Om du vill köra diagnostik väljer du ikonen ?i det övre högra hörnet på sidan. Välj sedan Diagnostik för arbetsyta.

Skärmbild av knappen för arbetsytans diagnostik.

När diagnostiken har körts returneras en lista över eventuella identifierade problem. Den här listan innehåller länkar till möjliga lösningar.

Diagnostik från Python

Följande kodfragment visar hur du använder arbetsytediagnostik från Python.

GÄLLER FÖR: Python SDK azure-ai-ml v2 (aktuell)

from azure.ai.ml import MLClient
from azure.ai.ml.entities import Workspace
from azure.identity import DefaultAzureCredential

subscription_id = '<your-subscription-id>'
resource_group = '<your-resource-group-name>'
workspace = '<your-workspace-name>'

ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group)
resp = ml_client.workspaces.begin_diagnose(workspace).result()
# Inspect the attributes of the response you are interested in
for result in resp.application_insights_results:
    print(f"Diagnostic result: {result.code}, {result.level}, {result.message}")

Svaret är ett DiagnoseResponseResultValue-objekt som innehåller information om eventuella problem som identifierats med arbetsytan.

GÄLLER FÖR:Python SDK azureml v1

from azureml.core import Workspace

ws = Workspace.from_config()

diag_param = {
      "value": {
      }
    }

resp = ws.diagnose_workspace(diag_param)
print(resp)

Svaret är ett JSON-dokument som innehåller information om eventuella problem som identifierats med arbetsytan. Följande JSON är ett exempelsvar:

{
    "value": {
        "user_defined_route_results": [],
        "network_security_rule_results": [],
        "resource_lock_results": [],
        "dns_resolution_results": [{
            "code": "CustomDnsInUse",
            "level": "Warning",
            "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."
        }],
        "storage_account_results": [],
        "key_vault_results": [],
        "container_registry_results": [],
        "application_insights_results": [],
        "other_results": []
    }
}

Om inga problem identifieras returneras ett tomt JSON-dokument.

Mer information finns i arbetsytereferensen.

Mer information finns i referensen Workspace.diagnose_workspace().

Gå vidare