简体   繁体   中英

How do i access data that has been uploaded to datastore via azure file share?

Uploaded a bunch of csvs to azure file share data store. how can I access the data from the datastore in a script?

#upload csv to datastore
datastore = ws.get_default_datastore()
path='path'
target=(datastore,path)
ds=Dataset.File.upload_directory(data_loacation,target,overwrite=True,show_progress = True)

You need to Create an Azure Files Datastore. Below is the sample code to create Azure Files Datastore.

from azure.ai.ml.entities import AzureFileDatastore
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={
        "account_key": "XXXxxxXXXxXXXXxxXXXXXxXXXXXxXxXXXXxxxxxXXxxxxxxXXXxXXX"
    },
)

ml_client.create_or_update(store)

For more information follow this Official documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM