Gegevensarchieven maken

VAN TOEPASSING OP:Azure CLI ml extension v2 (current)Python SDK azure-ai-ml v2 (current)

In dit artikel leert u hoe u verbinding maakt met Azure Data Storage-services met Azure Machine Learning-gegevensarchieven.

Vereisten

Notitie

Azure Machine Learning-gegevensarchieven maken geen onderliggende opslagaccountbronnen. In plaats daarvan koppelen ze een bestaand opslagaccount voor Azure Machine Learning-gebruik. Hiervoor zijn geen Azure Machine Learning-gegevensarchieven vereist. Als u toegang hebt tot de onderliggende gegevens, kunt u opslag-URI's rechtstreeks gebruiken.

Een Azure Blob-gegevensarchief maken

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)

Een Azure Data Lake Gen2-gegevensarchief maken

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)

Een Azure Files-gegevensarchief maken

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)

Een Azure Data Lake Gen1-gegevensarchief maken

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)

Een OneLake-gegevensarchief (Microsoft Fabric) maken (preview)

In deze sectie worden verschillende opties beschreven voor het maken van een OneLake-gegevensarchief. Het OneLake-gegevensarchief maakt deel uit van Microsoft Fabric. Op dit moment ondersteunt Azure Machine Learning verbinding met Microsoft Fabric Lakehouse-artefacten die mappen/bestanden en Amazon S3-snelkoppelingen bevatten. Ga naar Wat is een lakehouse in Microsoft Fabric voor meer informatie over Lakehouse.

Voor het maken van oneLake-gegevensopslag is vereist

  • Eindpunt
  • Naam of GUID van infrastructuurwerkruimte
  • Artefactnaam of GUID

informatie van uw Microsoft Fabric-exemplaar. In deze drie schermopnamen wordt beschreven hoe u deze vereiste informatieresources kunt ophalen uit uw Microsoft Fabric-exemplaar:

Naam van OneLake-werkruimte

In uw Microsoft Fabric-exemplaar vindt u de werkruimtegegevens, zoals wordt weergegeven in deze schermopname. U kunt een GUID-waarde of een beschrijvende naam gebruiken om een Azure Machine Learning OneLake-gegevensarchief te maken.

Screenshot that shows Fabric Workspace details in Microsoft Fabric UI.

OneLake-eindpunt

In deze schermopname ziet u hoe u eindpuntgegevens kunt vinden in uw Microsoft Fabric-exemplaar:

Screenshot that shows Fabric endpoint details in Microsoft Fabric UI.

Naam van OneLake-artefact

In deze schermopname ziet u hoe u de artefactgegevens in uw Microsoft Fabric-exemplaar kunt vinden. In de schermopname ziet u ook hoe u een GUID-waarde of een beschrijvende naam kunt gebruiken om een Azure Machine Learning OneLake-gegevensarchief te maken:

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

Een OneLake-gegevensarchief maken

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)

Volgende stappen