Hi, I am setting up self-hosted Prefect to orchestrate existing dbtCore setup with postgres. I am confused about how to provide the profiles target secrets correctly through a Block. In the screenshot it says that this block is used to store the secrets, but how do I provide them, as json in the extras?
✅ 1
František
06/06/2024, 1:52 PM
adding my current config, I am trying
a
alex
06/06/2024, 1:59 PM
Hey @František! You can use the dbt CLI Postgres Target Configs block to securely store config for your Postgres instance
👍 1
f
František
06/10/2024, 1:21 PM
Thanks! This was the solution, I had to install the
prefect-dbt[postgres]
and register the adapters:
prefect block register -m prefect_dbt
. After that, something like this works:
Copy code
dbt_cli_profile = DbtCliProfile.load(dbt_cli_profile_name)
result = DbtCoreOperation(
commands=commands,
project_dir='./',
profiles_dir='./', # separate from the root profiles.yml used for local dev
dbt_cli_profile=dbt_cli_profile,
overwrite_profiles=True
).run()
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.