mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 12:33:59 +00:00
feat: add Azure storage account access key support to SDKs (#5177)
Add `azure_storage_account_access_key_secret` to the sync and async
Python storage integration APIs, with a matching Rust constructor. The
SDK sends a Secret reference in SQL and decodes the reference returned
by CREATE and DESCRIBE.
```python
info = db.create_storage_integration(
"blobs", "az://customer-data/raw/",
storage_provider="AZURE",
azure_storage_account="customeraccount",
azure_storage_account_access_key_secret="azure_key",
)
```
Azure requires a storage account and one authentication mode. The
account access key uses a single Secret. Service principal
authentication uses the existing three Secret references.
This commit is contained in:
@@ -1522,7 +1522,7 @@ integration = db.create_storage_integration(
|
||||
print(integration.configuration_instructions)
|
||||
```
|
||||
|
||||
Use `SecretReference` to qualify another database or namespace. Sync and async connections use the same options. Secret values are never part of integration metadata. Azure supports service principal client credentials; managed identity, account key and SAS authentication are not integration modes.
|
||||
Use `SecretReference` to qualify another database or namespace. Sync and async connections use the same options. Secret values are never part of integration metadata. Azure supports service principal credentials and storage account access keys.
|
||||
|
||||
The equivalent SQL is:
|
||||
|
||||
@@ -1539,6 +1539,23 @@ SHOW STORAGE INTEGRATIONS;
|
||||
DROP STORAGE INTEGRATION customer_blobs;
|
||||
```
|
||||
|
||||
For Shared Key authorization, store the storage account access key in one
|
||||
Secret and pass its reference as the only credential option:
|
||||
|
||||
```python
|
||||
integration = db.create_storage_integration(
|
||||
"customer_blobs_key",
|
||||
"az://customer-data/raw/",
|
||||
storage_provider="AZURE",
|
||||
azure_storage_account="customeraccount",
|
||||
azure_storage_account_access_key_secret="azure_key",
|
||||
)
|
||||
```
|
||||
|
||||
The equivalent SQL credential option is
|
||||
`STORAGE_AZURE_STORAGE_ACCOUNT_ACCESS_KEY_SECRET = public.azure_key`. Shared
|
||||
Key authorization must be enabled on the Azure storage account.
|
||||
|
||||
Registration returns setup instructions and leaves `access_verified` false. It stores an account-qualified prefix such as `az://customer-data@customeraccount.blob.core.windows.net/raw/`.
|
||||
|
||||
### GCP storage integrations
|
||||
|
||||
Reference in New Issue
Block a user