# 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
)
1条答案
按热度按时间tmb3ates1#
以下是Azure ML Rstudio中读取数据文件的代码片段: