データストアの作成

適用対象:Azure CLI ml extension v2 (現行)Python SDK azure-ai-ml v2 (現行)

この記事では、Azure Machine Learning データストアを使用して Azure データ ストレージ サービスに接続する方法について説明します。

前提条件

注意

Azure Machine Learning データストアでは、基になるストレージ アカウント リソースは作成されません。 代わりに、Azure Machine Learning で使用するために既存のストレージ アカウントがリンクされます。 このために Azure Machine Learning データストアは必要ありません。 基になるデータにアクセスできる場合は、ストレージ URI を直接使用できます。

Azure BLOB データストアを作成する

次の YAML ファイルを作成します (必ず、該当する値を更新してください)。

# my_blob_datastore.yml
$schema: https://azuremlschemas.azureedge.net/latest/azureBlob.schema.json
name: my_blob_ds # add your datastore name here
type: azure_blob
description: here is a description # add a datastore description here
account_name: my_account_name # add the storage account name here
container_name: my_container_name # add the storage container name here

CLI で Azure Machine Learning データストアを作成します。

az ml datastore create --file my_blob_datastore.yml

Azure Data Lake Gen2 データストアを作成する

次の YAML ファイルを作成します (値の更新)。

# my_adls_datastore.yml
$schema: https://azuremlschemas.azureedge.net/latest/azureDataLakeGen2.schema.json
name: adls_gen2_credless_example
type: azure_data_lake_gen2
description: Credential-less datastore pointing to an Azure Data Lake Storage Gen2.
account_name: mytestdatalakegen2
filesystem: my-gen2-container

CLI で Azure Machine Learning データストアを作成します。

az ml datastore create --file my_adls_datastore.yml

Azure Files データストアを作成する

次の YAML ファイルを作成します (値の更新)。

# my_files_datastore.yml
$schema: https://azuremlschemas.azureedge.net/latest/azureFile.schema.json
name: file_example
type: azure_file
description: Datastore pointing to an Azure File Share.
account_name: mytestfilestore
file_share_name: my-share
credentials:
  account_key: XxXxXxXXXXXXXxXxXxxXxxXXXXXXXXxXxxXXxXXXXXXXxxxXxXXxXXXXXxXXxXXXxXxXxxxXXxXXxXXXXXxXxxXX

CLI で Azure Machine Learning データストアを作成します。

az ml datastore create --file my_files_datastore.yml

Azure Data Lake Gen1 データストアを作成する

次の YAML ファイルを作成します (値の更新)。

# my_adls_datastore.yml
$schema: https://azuremlschemas.azureedge.net/latest/azureDataLakeGen1.schema.json
name: alds_gen1_credless_example
type: azure_data_lake_gen1
description: Credential-less datastore pointing to an Azure Data Lake Storage Gen1.
store_name: mytestdatalakegen1

CLI で Azure Machine Learning データストアを作成します。

az ml datastore create --file my_adls_datastore.yml

次のステップ