简体   繁体   English

如何从Azure数据湖(存储账户)中读取R中的一个数据文件

[英]How to read a data file in R from Azure data lake (storage account)

I am able to upload and download data file in Azure ML RStudio from Azure data lake (storage account) using AzureAuth and AzureStor packages with service principal Authentication.我能够使用带有服务主体身份验证的 AzureAuth 和 AzureStor 包从 Azure 数据湖(存储帐户)上传和下载 Azure ML RStudio 中的数据文件。

I want to read a data file in Azure ML RStudio from Azure data lake (storage account).我想从Azure数据湖(存储账户)中读取Azure ML RStudio中的一个数据文件。

Here is code snippet for read data file in Azure ML Rstudio:这是 Azure ML Rstudio 中读取数据文件的代码片段:

# Install the AzureAuth and AzureStor packages
install.packages("AzureAuth")
install.packages("AzureStor")

# Load the AzureAuth and AzureStor packages
library(AzureAuth)
library(AzureStor)

# Authenticate with your Azure subscription using a service principal
azure_auth(tenant_id = "<your-tenant-id>",
           client_id = "<your-client-id>",
           client_secret = "<your-client-secret>")

# Connect to your Azure data lake (storage account)
azure_storage_account_name <- "<your-storage-account-name>"
azure_storage_account_key <- "<your-storage-account-key>"
azure_storage_account_container <- "<your-storage-account-container>"
azure_storage_account_file_path <- "<your-storage-account-file-path>"

azure_storage_account_connection <- AzureStor::az_storage_account(
  account_name = azure_storage_account_name,
  account_key = azure_storage_account_key
)

# Read the data file from Azure data lake (storage account)
data <- AzureStor::az_blob_download(
  connection = azure_storage_account_connection,
  container = azure_storage_account_container,
  file_path = azure_storage_account_file_path
)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从存储帐户(Azure Data lake)读取 pdf 文件,无需使用 python 下载 - Read pdf file from storage account (Azure Data lake) without downloading it using python 如何使用 Airflow 将 CSV 文件从 Azure Data Lake/Blob 存储传输到 PostgreSQL 数据库 - How to transfer a CSV file from Azure Data Lake/Blob Storage to PostgreSQL database with Airflow 如何在不使用 Spark 的情况下从 Synapse 笔记本中的 Azure 数据湖读取 XML 文件 - How To Read XML File from Azure Data Lake In Synapse Notebook without Using Spark 通过 Azure 数据工厂,从本地数据湖到 azure 数据湖存储的数据加载速度非常慢 - Data Loading very slow from on-prem Data Lake to azure Data Lake Storage though Azure Data Factory Azure Data Lake Gen2 存储帐户 blob 与 adf 选择 - Azure Data Lake Gen2 Storage Account blob vs adf choice 如何使用 dbt 将镶木地板文件从 Azure Data Lake Gen2/Azure Blob 存储加载到专用池? - How to load parquet files from Azure Data Lake Gen2/Azure Blob Storage to Dedicated pool using dbt? azure 数据湖客户端与 azure blob 客户端有何不同 - how azure data lake client different from azure blob client 如何使用 for each 和 dataflow 将 excel 文件从 Azure 数据湖复制到 Azure SQL 数据库? - How to use for each and dataflow to copy excel file from Azure data lake to Azure SQL database? 将数据从本地 sql 服务器复制到 Azure Data Lake Storage Gen2 中的增量格式 - copy data from on premise sql server to delta format in Azure Data Lake Storage Gen2 无法使用 python azure-storage-file-datalake SDK 在 Azure Data Lake Gen2 中创建 Append Blob - Cannot create Append Blobs in Azure Data Lake Gen2 using python azure-storage-file-datalake SDK
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM