Add connections
Give your anfra BI Cloud organization its own connections to your warehouse
Published models query your warehouse through the organization's own connections. Your local .anfra/data_sources.yml is never published, so the organization needs a connection of the same name for each one your models use. Until it has one, queries on those models fail.
Admins only
Only an organization Admin can add connections. If you aren't one, ask an Admin to add them. The anfra BI Cloud UI and the CLI call connections data sources.
There are two ways to add the first connections: while you publish, or in the anfra BI Cloud settings.
Add them while you publish
The easiest way is to let anfra publish do it. When the organization lacks a connection your project uses, the publish asks whether to create it. If you agree, it sends that connection from your .anfra/data_sources.yml, credentials included, under the same name.
If you aren't an Admin, the publish continues and names the connections to ask an Admin to add.
A DuckDB file on your machine can't be reached from anfra BI Cloud. For a DuckDB connection, the publish offers to upload the file to MotherDuck and adds it to the organization as a MotherDuck connection with the same name. Your models work without changes. See DuckDB files.
In a script, pass --create-data-sources to add missing connections without asking. See Publish from a script.
Add them in settings
To add a connection by hand, for example with credentials meant for the organization rather than your own:
- Open the organization menu at the top of the sidebar, then Settings.
- Under Organization, click Data sources, then Add data source.
- Enter the Name. Use the name your models'
data_source_namerefers to. It can't be changed later. - Pick the type, such as PostgreSQL or BigQuery, and fill in its fields.
- Click Add data source. anfra BI Cloud tests the connection before it saves it.
If the test fails, you can still click Save anyway, for example when your warehouse doesn't let anfra BI Cloud in yet.
Next steps
- Connections: every type, editing, testing, deleting and how credentials are kept.
- Publish to anfra BI: send your project to the organization.