mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-13 14:16:54 +00:00
feat: accept Azure inputs in storage integration clients (#4759)
Register Azure Blob integrations through Flight SQL using an explicit
storage account and three Secret references for tenant ID, client ID and
client secret. Extends the database-owned integration APIs with
provider-specific inputs while keeping the same create, describe, list
and drop operations.
```python
info = db.create_storage_integration(
"customer_blobs", "az://customer-data/raw/",
storage_provider="AZURE", azure_storage_account="customeraccount",
azure_tenant_id_secret="tenant", azure_client_id_secret="client",
azure_client_secret_secret="credential",
)
print(info.configuration_instructions)
info = db.describe_storage_integration("customer_blobs")
names = list(db.list_storage_integrations())
db.drop_storage_integration("customer_blobs")
```
Sync and async connections accept the same options. Use
`SecretReference` for cross-database or namespace qualification. Values
remain in Secrets; returned metadata includes only references and setup
guidance.
```sql
CREATE STORAGE INTEGRATION customer_blobs
STORAGE_PROVIDER = 'AZURE'
STORAGE_PREFIX = 'az://customer-data/raw/'
STORAGE_AZURE_STORAGE_ACCOUNT = 'customeraccount'
STORAGE_AZURE_TENANT_ID_SECRET = public.tenant
STORAGE_AZURE_CLIENT_ID_SECRET = public.client
STORAGE_AZURE_CLIENT_SECRET_SECRET = public.credential;
DESCRIBE STORAGE INTEGRATION customer_blobs;
SHOW STORAGE INTEGRATIONS;
DROP STORAGE INTEGRATION customer_blobs;
```
```mermaid
flowchart LR
Python[Sync or async Python] --> SQL[Flight SQL]
SQL --> Metadata[Configuration and Secret references]
```
Azure supports service principal client credentials only. Adds SQL
rendering, provider validation and Python Flight SQL regressions across
Utf8, LargeUtf8 and Utf8View results. Local builds and tests are
excluded as requested; validation runs in CI.
This commit is contained in:
@@ -986,3 +986,40 @@ are never included in integration metadata.
|
||||
change. Use the structured identity and policy fields for programmatic access.
|
||||
Registration does not verify AWS access. `AsyncConnection` provides the same methods;
|
||||
await create, describe, and drop, and use `async for` for listing.
|
||||
|
||||
|
||||
### Azure storage integrations
|
||||
|
||||
Create three Secrets containing the Azure tenant ID, client ID and client secret in an ordinary database. Reference their names when registering Azure Blob access:
|
||||
|
||||
```python
|
||||
integration = db.create_storage_integration(
|
||||
"customer_blobs",
|
||||
"az://customer-data/raw/",
|
||||
storage_provider="AZURE",
|
||||
azure_storage_account="customeraccount",
|
||||
azure_tenant_id_secret="azure_tenant",
|
||||
azure_client_id_secret="azure_client",
|
||||
azure_client_secret_secret="azure_credential",
|
||||
)
|
||||
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.
|
||||
|
||||
The equivalent SQL is:
|
||||
|
||||
```sql
|
||||
CREATE STORAGE INTEGRATION customer_blobs
|
||||
STORAGE_PROVIDER = 'AZURE'
|
||||
STORAGE_PREFIX = 'az://customer-data/raw/'
|
||||
STORAGE_AZURE_STORAGE_ACCOUNT = 'customeraccount'
|
||||
STORAGE_AZURE_TENANT_ID_SECRET = public.azure_tenant
|
||||
STORAGE_AZURE_CLIENT_ID_SECRET = public.azure_client
|
||||
STORAGE_AZURE_CLIENT_SECRET_SECRET = public.azure_credential;
|
||||
DESCRIBE STORAGE INTEGRATION customer_blobs;
|
||||
SHOW STORAGE INTEGRATIONS;
|
||||
DROP STORAGE INTEGRATION customer_blobs;
|
||||
```
|
||||
|
||||
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/`.
|
||||
|
||||
Reference in New Issue
Block a user