작업 영역 진단을 사용하는 방법

적용 대상:Python SDK azureml v1

Azure Machine Learning은 작업 영역의 문제를 식별하는 데 사용할 수 있는 진단 API를 제공합니다. 진단 보고서에 반환된 오류에는 문제 해결 방법에 대한 정보가 포함됩니다.

Azure Machine Learning 스튜디오 또는 Python SDK에서 작업 영역 진단을 사용할 수 있습니다.

필수 조건

이 문서의 단계를 수행하기 전에 다음과 같은 필수 구성 요소가 있는지 확인합니다.

  • Azure Machine Learning 작업 영역 리소스가 없으면 빠른 시작: 작업 영역 리소스 만들기 문서의 단계에서 리소스를 만듭니다.

  • Python SDK v2를 설치하려면 다음 명령을 사용합니다.

    pip install azure-ai-ml azure-identity
    

    기존 SDK 설치를 최신 버전으로 업데이트하려면 다음 명령을 사용합니다.

    pip install --upgrade azure-ai-ml azure-identity
    

    자세한 내용은 Azure Machine Learning용 Python SDK v2 설치를 참조하세요.

스튜디오에서 진단

Azure Machine Learning 스튜디오에서 작업 영역에 대한 진단을 실행하여 설정을 확인할 수 있습니다. 진단을 실행하려면 페이지 오른쪽 상단에 있는 '?' 아이콘을 선택합니다. 그런 다음 작업 영역 진단 실행을 선택합니다.

작업 영역 진단 단추 스크린샷.

진단을 실행한 후 감지된 문제 목록이 반환됩니다. 이 목록에는 가능한 솔루션에 대한 링크가 포함되어 있습니다.

Python에서 진단

다음 코드 조각은 Python에서 작업 영역 진단을 사용하는 방법을 보여 줍니다.

적용 대상: Python SDK azure-ai-ml v2(현재)

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}")

응답은 작업 영역에서 검색된 문제에 대한 정보가 포함된 DiagnoseResponseResultValue 개체입니다.

적용 대상:Python SDK azureml v1

from azureml.core import Workspace

ws = Workspace.from_config()

diag_param = {
      "value": {
      }
    }

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

응답은 작업 영역에서 탐지된 문제에 대한 정보를 포함하는 JSON 문서입니다. 다음 JSON은 예제 응답입니다.

{
    "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": []
    }
}

문제가 탐지되지 않으면 빈 JSON 문서가 반환됩니다.

자세한 내용은 작업 영역 참조를 확인합니다.

자세한 내용은 Workspace.diagnose_workspace() 참조를 참조하세요.

다음 단계