我正在将数据移动到 Azure Data Lake Store 并使用 Azure Data Lake Analytics 对其进行处理。数据采用 XML 格式,我正在通过XML Extractor读取它。现在我想从 Azure ML 访问这些数据,目前似乎不直接支持 Azure Data Lake 存储。
将 Azure Data Lake Store 与 Azure ML 结合使用的可能方式有哪些?
我正在将数据移动到 Azure Data Lake Store 并使用 Azure Data Lake Analytics 对其进行处理。数据采用 XML 格式,我正在通过XML Extractor读取它。现在我想从 Azure ML 访问这些数据,目前似乎不直接支持 Azure Data Lake 存储。
将 Azure Data Lake Store 与 Azure ML 结合使用的可能方式有哪些?
正如您所指出的,目前,Azure Data Lake Store 不是受支持的源。也就是说,Azure Data Lake Analytics 也可用于将数据写入 Azure Blob Store,因此您可以将其用作在 U-SQL 中处理数据的一种方法,然后将其暂存以供 Azure 机器学习从 Blob 处理它店铺。当 Azure ML 支持 Data Lake 存储时,您可以切换它。
account_name=os.getenv("ADLSGEN2_ACCOUNTNAME_62", "<storage account name>") # ADLS Gen2 account name
tenant_id=os.getenv("ADLSGEN2_TENANT_62", "") # tenant id of service principal
client_id=os.getenv("ADLSGEN2_CLIENTID_62", "") # client id of service principal
client_secret=os.getenv("ADLSGEN2_CLIENT_SECRET_62", "") # the secret of service principal
try:
adlsgen2_datastore = Datastore.get(workspace, adlsgen2_datastore_name)
print("Found ADLS Gen2 datastore with name: %s" % adlsgen2_datastore_name)
datastore_paths = [(adlsgen2_datastore, 'path to data.csv')]
dataset = Dataset.Tabular.from_delimited_files(path=datastore_paths)
df = dataset.to_pandas_dataframe()
display(dataset.to_pandas_dataframe())
datastore = adlsgen2_datastore
dataset = Dataset.Tabular.register_pandas_dataframe(df, datastore, "<DataSetStep>", show_progress=True)
except:
adlsgen2_datastore = Datastore.register_azure_data_lake_gen2(
workspace=workspace,
datastore_name=adlsgen2_datastore_name,
filesystem='fs', # Name of ADLS Gen2 filesystem
account_name=account_name, # ADLS Gen2 account name
tenant_id=tenant_id, # tenant id of service principal
client_id=client_id, # client id of service principal
client_secret=client_secret) # the secret of service principal