## duckdb.set_chain_secret()


Register a DuckDB credential-chain secret, which DuckDB resolves itself.


Usage

``` python
duckdb.set_chain_secret(
    conn,
    account=None,
    chain="default",
)
```


As `quak::az_set_chain_secret()`: `PROVIDER credential_chain`, so the `azure` extension finds a credential itself (Azure CLI, managed identity, environment, …). No chain entry uses an `az login` refresh token; for that, see [set_credential_secret()](duckdb.set_credential_secret.md#dazapiz.duckdb.set_credential_secret).


## Parameters


`conn: duckdb.DuckDBPyConnection`  
The DuckDB connection.

`account: str | None = None`  
Scope the secret to this storage account's hosts; it also gets `ACCOUNT_NAME`.

`chain: str | Sequence[str] | None = ``"default"`  
One chain entry or several (joined with `;`), such as `"cli"` or `["managed_identity", "env"]`; `None` leaves `CHAIN` out.


## Raises


`TypeError`  
`account` or an entry is not a string.

`ValueError`  
`chain` is an empty sequence, or an entry is empty.

`duckdb.Error`  
DuckDB refused the statement.


## Notes

Delta tables never match an account-scoped secret, so register an unscoped one for them.


## Examples

``` python
from dazapiz.duckdb import set_chain_secret

set_chain_secret(conn, chain="cli")
```
