diff --git a/docs/website/docs/general-usage/credentials/setup.md b/docs/website/docs/general-usage/credentials/setup.md index 4ab9149bc0..21a8257598 100644 --- a/docs/website/docs/general-usage/credentials/setup.md +++ b/docs/website/docs/general-usage/credentials/setup.md @@ -5,7 +5,7 @@ keywords: [credentials, secrets.toml, secrets, config, configuration, environmen variables, provider] --- -`dlt` automatically extracts configuration settings and secrets based on flexible [naming conventions](setup/#naming-convention). +`dlt` automatically extracts configuration settings and secrets based on flexible [naming conventions](#naming-convention). It then [injects](advanced/#injection-mechanism) these values where needed in functions decorated with `@dlt.source`, `@dlt.resource`, or `@dlt.destination`. @@ -39,15 +39,71 @@ Please make sure your pipeline name contains no whitespace or any other punctuat To keep the naming convention flexible, `dlt` looks for a lot of possible combinations of key names, starting from the most specific possible path. Then, if the value is not found, it removes the right-most section and tries again. -* The most specific possible path for **sources** looks like: +The most specific possible path for **sources** looks like: + + + + +```sh +[.sources..] +="some_value" +``` + + + +```sh +export PIPELINE_NAME__SOURCES__SOURCE_MODULE_NAME__SOURCE_FUNCTION_NAME__ARGUMENT_NAME="some_value" +``` + + + +```py +import os + +os.environ["PIPELINE_NAME__SOURCES__SOURCE_MODULE_NAME__SOURCE_FUNCTION_NAME__ARGUMENT_NAME"] = "some_value" +``` + + + +The most specific possible path for **destinations** looks like: + + + + ```sh -.sources... +[.destination..credentials] +="some_value" ``` + + -* The most specific possible path for **destinations** looks like: ```sh -.destination..credentials. +export PIPELINE_NAME__DESTINATION__DESTINATION_NAME__CREDENTIALS__CREDENTIAL_VALUE="some_value" +``` + + + +```py +import os + +os.environ["PIPELINE_NAME__DESTINATION__DESTINATION_NAME__CREDENTIALS__CREDENTIAL_VALUE"] = "some_value" ``` + + ### Example