
## Set up dbt Cloud

URL: https://docs.atlan.com/apps/connectors/etl-tools/dbt/how-tos/set-up-dbt-cloud

> Configure authentication tokens in dbt Cloud to enable Atlan to fetch and enrich your assets with dbt metadata.

Configure authentication tokens in dbt Cloud to enable Atlan to fetch and enrich your assets with dbt metadata.

:::warning

To enable Atlan to fetch metadata for dbt models defined in your project, you must add the `dbt docs generate` command to the list of commands in the job run steps. This produces a `catalog.json` file containing all the relevant metadata. Alternatively, you can select the [_Generate docs on run_ checkbox](https://docs.getdbt.com/docs/collaborate/build-and-view-your-docs) to automatically generate updated project docs each time a job runs. Refer to [dbt documentation](https://docs.getdbt.com/references/commands/cmd-docs#dbt-docs-generate) to learn more.

:::

## Prerequisites

Before you begin, make sure you have:
* A dbt Cloud account with access to the projects you want to integrate into Atlan
* Admin permissions in dbt Cloud (for service account tokens) or **Job Viewer** access to all projects you want to integrate (for personal access tokens)
* The `dbt docs generate` command added to your dbt job run steps, or the _Generate docs on run_ checkbox enabled

## Configure authentication

Choose your authentication method and create the necessary tokens for dbt Cloud access.

### Service account token

Service account tokens are recommended for production environments and provide granular access control. Only dbt Cloud administrators can generate service account tokens.

1. Follow the [steps in dbt documentation](https://docs.getdbt.com/docs/dbt-cloud/dbt-cloud-api/service-tokens) to generate a service account token.
2. Configure the following permissions based on your dbt Cloud plan:
	* **Team plans**: Add **Read-only** access to all projects you want to integrate into Atlan. This permission is required to authorize requests to both the [dbt Cloud Administrative API](https://docs.getdbt.com/docs/dbt-cloud-apis/admin-cloud-api) and [dbt Cloud Discovery API](https://docs.getdbt.com/docs/dbt-cloud-apis/discovery-api).

	* **Enterprise plans**: Add **Job Viewer** access to all projects you want to integrate into Atlan. This provides read-only access to your dbt account, project, environment, job, and run metadata. Learn more about [dbt Cloud Enterprise permissions](https://docs.getdbt.com/docs/cloud/manage-access/enterprise-permissions).
3. Copy the generated token. You'll need it when [crawling dbt](https://docs.atlan.com/llms/connectors/dbt/crawl-dbt/llms.txt).

### Personal access token

You can also use an account-scoped personal access token for authentication. This option is suitable if you don't have admin access to create service account tokens.

1. Follow the [steps in dbt documentation](https://docs.getdbt.com/docs/dbt-cloud-apis/user-tokens#account-scoped-personal-access-tokens) to generate a personal access token.
2. Make sure the user creating the token has **Job Viewer** access to all projects you want to integrate into Atlan. This provides read-only access to your dbt account, project, environment, job, and run metadata.
3. Copy the generated token. You'll need it when [crawling dbt](https://docs.atlan.com/llms/connectors/dbt/crawl-dbt/llms.txt).

## Next steps

* [Crawl dbt](https://docs.atlan.com/llms/connectors/dbt/crawl-dbt/llms.txt): Configure and run the crawler to extract metadata from your dbt Cloud or dbt Core projects

---
