Livestream: Ducklake & The Future of Open Table Formats - June 17Register Now

Skip to main content

Azure Blob Storage

Configure Azure Blob Storage Credentials

You can safely store your Azure Blob Storage credentials in MotherDuck for convenience by creating a SECRET object using the CREATE SECRET command.

note

See Azure docs to find the correct connection string format.

Create a SECRET object


-- to configure a secret manually:
CREATE SECRET IN MOTHERDUCK (
TYPE AZURE,
CONNECTION_STRING '[your_connection_string]'
);
-- to store a secret configured through `az configure`:
CREATE SECRET az_secret IN MOTHERDUCK (
TYPE AZURE,
PROVIDER credential_chain,
ACCOUNT_NAME 'some-account'
);
-- test the azure credentials
SELECT count(*) FROM 'azure://[container]/[file]'
SELECT * FROM 'azure://[container]/*.csv';

Delete a SECRET object

You can use the same method above, using the DROP SECRET command.

DROP SECRET <secret_name>;

Azure credentials as temporary secrets

MotherDuck supports DuckDB syntax for providing Azure credentials.

CREATE SECRET (
TYPE AZURE,
CONNECTION_STRING '[your_connection_string]'
);

or if you use the az configure command to store your credentials in the az CLI.

CREATE SECRET az_secret (
TYPE AZURE,
PROVIDER credential_chain,
ACCOUNT_NAME 'some-account'
);
note

Local/In-memory secrets are not persisted across sessions.