데이터 저장소 만들기

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

이 문서에서는 Azure Machine Learning 데이터 저장소를 사용하여 Azure 데이터 스토리지 서비스에 연결하는 방법을 알아봅니다.

필수 구성 요소

참고 항목

Azure Machine Learning 데이터 저장소는 기본 스토리지 계정 리소스를 만들지 않습니다. 대신 Azure Machine Learning 사용을 위해 기존 스토리지 계정을 연결합니다. Azure Machine Learning 데이터 저장소는 필요하지 않습니다. 기본 데이터에 액세스할 수 있는 경우 스토리지 URI를 직접 사용할 수 있습니다.

Azure Blob 데이터 저장소 만들기

from azure.ai.ml.entities import AzureBlobDatastore
from azure.ai.ml import MLClient

ml_client = MLClient.from_config()

store = AzureBlobDatastore(
    name="",
    description="",
    account_name="",
    container_name=""
)

ml_client.create_or_update(store)

Azure Data Lake Gen2 데이터 저장소 만들기

from azure.ai.ml.entities import AzureDataLakeGen2Datastore
from azure.ai.ml import MLClient

ml_client = MLClient.from_config()

store = AzureDataLakeGen2Datastore(
    name="",
    description="",
    account_name="",
    filesystem=""
)

ml_client.create_or_update(store)

Azure Files 데이터 저장소 만들기

from azure.ai.ml.entities import AzureFileDatastore
from azure.ai.ml.entities import AccountKeyConfiguration
from azure.ai.ml import MLClient

ml_client = MLClient.from_config()

store = AzureFileDatastore(
    name="file_example",
    description="Datastore pointing to an Azure File Share.",
    account_name="mytestfilestore",
    file_share_name="my-share",
    credentials=AccountKeyConfiguration(
        account_key= "XXXxxxXXXxXXXXxxXXXXXxXXXXXxXxxXxXXXxXXXxXXxxxXXxxXXXxXxXXXxxXxxXXXXxxxxxXXxxxxxxXXXxXXX"
    ),
)

ml_client.create_or_update(store)

Azure Data Lake Gen1 데이터 저장소 만들기

from azure.ai.ml.entities import AzureDataLakeGen1Datastore
from azure.ai.ml import MLClient

ml_client = MLClient.from_config()

store = AzureDataLakeGen1Datastore(
    name="",
    store_name="",
    description="",
)

ml_client.create_or_update(store)

OneLake(Microsoft Fabric) 데이터 저장소 만들기(미리 보기)

이 섹션에서는 OneLake 데이터 저장소를 만드는 다양한 옵션에 대해 설명합니다. OneLake 데이터 저장소는 Microsoft Fabric의 일부입니다. 현재 Azure Machine Learning은 폴더/파일 및 Amazon S3 바로 가기를 포함하는 Microsoft Fabric Lakehouse 아티팩트 연결을 지원합니다. Lakehouse 에 대한 자세한 내용은 Microsoft Fabric의 레이크하우스란?

OneLake 데이터 저장소를 만들려면

  • 엔드포인트
  • 패브릭 작업 영역 이름 또는 GUID
  • 아티팩트 이름 또는 GUID

Microsoft Fabric 인스턴스의 정보입니다. 이 세 스크린샷은 Microsoft Fabric 인스턴스에서 이러한 필수 정보 리소스를 검색하는 방법을 설명합니다.

OneLake 작업 영역 이름

Microsoft Fabric 인스턴스에서 이 스크린샷과 같이 작업 영역 정보를 찾을 수 있습니다. GUID 값 또는 "친숙한 이름"을 사용하여 Azure Machine Learning OneLake 데이터 저장소를 만들 수 있습니다.

Screenshot that shows Fabric Workspace details in Microsoft Fabric UI.

OneLake 엔드포인트

이 스크린샷은 Microsoft Fabric 인스턴스에서 엔드포인트 정보를 찾는 방법을 보여줍니다.

Screenshot that shows Fabric endpoint details in Microsoft Fabric UI.

OneLake 아티팩트 이름

이 스크린샷은 Microsoft Fabric 인스턴스에서 아티팩트 정보를 찾는 방법을 보여줍니다. 스크린샷은 GUID 값 또는 "친숙한 이름"을 사용하여 Azure Machine Learning OneLake 데이터 저장소를 만드는 방법도 보여 줍니다.

Screenshot showing how to get Fabric LH artifact details in Microsoft Fabric UI.

OneLake 데이터 저장소 만들기

from azure.ai.ml.entities import OneLakeDatastore, OneLakeArtifact
from azure.ai.ml import MLClient

ml_client = MLClient.from_config()

store = OneLakeDatastore(
    name="onelake_example_id",
    description="Datastore pointing to an Microsoft fabric artifact.",
    one_lake_workspace_name="AzureML_Sample_OneLakeWS",
    endpoint="msit-onelake.dfs.fabric.microsoft.com"
    artifact = OneLakeArtifact(
        name="AzML_Sample_LH",
        type="lake_house"
    )
)

ml_client.create_or_update(store)

다음 단계