Before you start
- A dbt plan with the Discovery API: Starter, Enterprise or Enterprise+.
- A dbt account admin, to create the token.
- A production environment with at least one successful job run. Jedify reads the models those runs built. With no run, the source still connects, but there is nothing to read.
1. Create a read-only token
A dbt account admin creates it under Account settings > Service tokens:
Metadata Only reads models, runs, sources and tests through the Discovery API, and can change nothing. It can’t call dbt’s Admin API, which Jedify doesn’t use.
dbt’s documentation disagrees on whether Starter plans offer Metadata Only tokens. Connecting with one worked on a Starter trial account.
2. Collect the four values
For example, the environment at
https://ab123.us1.dbt.com/deploy/1234/projects/70001/environments/80002 has project_id 70001 and environment_id 80002, and that account’s discovery_api_url is https://ab123.metadata.us1.dbt.com/graphql.
Check them
Whoever stores the secret checks the four values first, on a workstation withcurl, jq and gcloud:
3. Store them in Secret Manager
In the same shell, store the four values as one JSON secret in your installation’s project. The token goes straight into Secret Manager, never into a file:4. Let the cluster reach dbt
Jedify calls the host of yourdiscovery_api_url on port 443, from the cluster.
- In a network OpenTofu created, its Cloud NAT lets the call out. There is nothing to do.
- In your own network, your network team allows the host out, next to your warehouses’ hosts. The preflight checks it from the install host: add
--egress ab123.metadata.us1.dbt.comto the command in Requirements.
If dbt restricts IP addresses
dbt Enterprise+ accounts can refuse every call from an address that isn’t on their list, service tokens included. dbt then answersHTTP 403 with Forbidden: Access denied, and the source fails to connect.
A dbt account admin adds the addresses Jedify’s calls leave from. In your own network, your network team has them: your NAT’s or firewall’s. In a network OpenTofu created, they are its Cloud NAT’s:
5. Declare the source
Add it to your Jedify resource and apply:jedify-be namespace works too: credentials: { name: dbt-cloud, key: credentials.json }.
6. Check it
dbt-cloud Connected pipeline. pipeline is how Jedify classes dbt Cloud: a source that is not a warehouse.
When it fails
The connect’s log, when it says
Failed to connect:
argument of type 'NoneType' means dbt returned no data for the environment: the token is wrong, it isn’t scoped to the environment’s project, or the environment ID is wrong. Any other line carries dbt’s own answer, or the network error.
Rotate the token
- A dbt account admin creates a new token, as in step 1.
- Run the check with the new token, then step 3 with
gcloud secrets versions add dbt-cloud-credentialsin place ofgcloud secrets create dbt-cloud-credentials. - External Secrets reads the secret again within the hour, and the operator connects the source with the new token. An hour later, with the source still
Connected, delete the old token in dbt.