Skip to main content

Azure Blob Storage

Load data from Azure Blob Storage.

Configure via UI

We can load data by using two different types of authentication methods:

1. Account Key Authentication Mechanism

azure_blob

2. Service Principal Authentication Mechanism

azure_blob

3. SAS URL Authentication Mechanism

azure_blob

Configure via API / Client

1. Account Key Authentication Mechanism

from llama_cloud.types import CloudAzStorageBlobDataSource

ds = {
'name': '<your-name>',
'source_type': 'AZURE_STORAGE_BLOB',
'component': CloudAzStorageBlobDataSource(
container_name='<container_name>',
account_url='<account_url>',
blob='<blob>', # optional
prefix='<prefix>', # optional
account_name='<account_name>',
account_key='<account_key>',
)
}
data_source = client.data_sources.create_data_source(request=ds)

2. Service Principal Authentication Mechanism

from llama_cloud.types import CloudAzStorageBlobDataSource

ds = {
'name': '<your-name>',
'source_type': 'AZURE_STORAGE_BLOB',
'component': CloudAzStorageBlobDataSource(
container_name='<container_name>',
account_url='<account_url>',
blob='<blob>', # optional
prefix='<prefix>', # optional
client_id='<client_id>',
client_secret='<client_secret>',
tenant_id='<tenant_id>',
)
}
data_source = client.data_sources.create_data_source(request=ds)

3. SAS URL Authentication Mechanism

from llama_cloud.types import CloudAzStorageBlobDataSource

ds = {
'name': '<your-name>',
'source_type': 'AZURE_STORAGE_BLOB',
'component': CloudAzStorageBlobDataSource(
container_name='<container_name>',
account_url='<account_url>/?<SAS_TOKEN>',
blob='<blob>', # optional
prefix='<prefix>', # optional
)
}
data_source = client.data_sources.create_data_source(request=ds)