Hi, I am setting up self-hosted Prefect to orchest...
# prefect-dbt
f
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
adding my current config, I am trying
a
Hey @František! You can use the dbt CLI Postgres Target Configs block to securely store config for your Postgres instance
👍 1
f
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()