Skip to content

Commit fbc1e3c

Browse files
committed
feat(azure-blob): simplify and fix authentication
1 parent 4ae14d1 commit fbc1e3c

File tree

6 files changed

+228
-86
lines changed

6 files changed

+228
-86
lines changed

Cargo.lock

Lines changed: 184 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@ json5 = "0.4.1"
114114
aws-config = "1.6.2"
115115
aws-sdk-s3 = "1.85.0"
116116
aws-sdk-sqs = "1.67.0"
117-
azure_core = "0.21.0"
118-
azure_storage = "0.21.0"
119-
azure_storage_blobs = "0.21.0"
120117
time = { version = "0.3", features = ["macros", "serde"] }
121118
numpy = "0.25.0"
122119
infer = "0.19.0"
123120
serde_with = { version = "3.13.0", features = ["base64"] }
124121
google-cloud-aiplatform-v1 = "0.4.0"
122+
123+
azure_core = "0.21.0"
124+
azure_storage = "0.21.0"
125+
azure_storage_blobs = "0.21.0"
126+
azure_identity = "0.21.0"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

examples/azure_blob_embedding/main.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,13 @@ def azure_blob_text_embedding_flow(
3131
container_name = os.environ["AZURE_BLOB_CONTAINER_NAME"]
3232
prefix = os.environ.get("AZURE_BLOB_PREFIX", None)
3333

34-
# Authentication options (in priority order)
35-
connection_string = os.environ.get("AZURE_BLOB_CONNECTION_STRING", None)
36-
account_key = os.environ.get("AZURE_BLOB_ACCOUNT_KEY", None)
37-
sas_token = os.environ.get("AZURE_BLOB_SAS_TOKEN", None)
38-
3934
data_scope["documents"] = flow_builder.add_source(
4035
cocoindex.sources.AzureBlob(
4136
account_name=account_name,
4237
container_name=container_name,
4338
prefix=prefix,
4439
included_patterns=["*.md", "*.mdx", "*.txt", "*.docx"],
4540
binary=False,
46-
connection_string=connection_string,
47-
account_key=account_key,
48-
sas_token=sas_token,
4941
)
5042
)
5143

python/cocoindex/sources.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,8 @@ class AmazonS3(op.SourceSpec):
4646

4747

4848
class AzureBlob(op.SourceSpec):
49-
"""Import data from an Azure Blob Storage container. Supports optional prefix and file filtering by glob patterns.
50-
51-
Authentication options (in priority order):
52-
1. connection_string - Full connection string with credentials
53-
2. sas_token - Shared Access Signature token
54-
3. account_key - Storage account access key
55-
4. None - Anonymous access (for public containers)
49+
"""
50+
Import data from an Azure Blob Storage container. Supports optional prefix and file filtering by glob patterns.
5651
"""
5752

5853
_op_category = op.OpCategory.SOURCE
@@ -63,6 +58,3 @@ class AzureBlob(op.SourceSpec):
6358
binary: bool = False
6459
included_patterns: list[str] | None = None
6560
excluded_patterns: list[str] | None = None
66-
account_key: str | None = None
67-
sas_token: str | None = None
68-
connection_string: str | None = None

0 commit comments

Comments
 (0)