Thanks to visit codestin.com
Credit goes to developers.llamaindex.ai

Skip to content

Azure Blob Storage Data Source

Load data from Azure Blob Storage.

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

azure_blob

2. Service Principal Authentication Mechanism

Section titled “2. Service Principal Authentication Mechanism”

azure_blob

azure_blob

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

Section titled “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)
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)