> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Connecting an Azure DevOps dbt repository to Omni

> Connect your Azure DevOps dbt repository to Omni.

export const keyInstructions_0 = "Copy the public key from the Omni dbt settings tab and paste it into this field"

export const type_0 = "SSH"

Omni supports **SSH authentication** for connecting to your Azure DevOps repository. This method uses a deploy key to connect Omni to your repository.

## Requirements

To follow the steps in this guide, you'll need:

* **An existing [database connection](/connect-data/setup) in Omni**
* [**Connection Admin permissions**](/administration/users/permissions) for the connection you want to connect to dbt
* **Permissions in Azure DevOps** that allow you to add deploy keys

## Configure SSH authentication

<Steps titleSize="h3">
  <Step title="Retrieve the dbt repository's SSH URL" id="retrieve-ssh-url">
    1. In your browser, navigate to the Azure DevOps repository you want to connect to Omni.
    2. Click the **Clone** button near the top right corner of the page.
    3. Click the **{type_0}** option to display the repository's {type_0} URL.

    Keep this page open—you'll need it in the next step.
  </Step>

  <Step title="Create the dbt connection in Omni" id="create-connection">
    1. In Omni, navigate to **Settings > Connections**.
    2. Click the connection you want to use.
    3. Click the **dbt** tab.
    4. Fill in the following fields:
       * **Authentication Method** - Select **SSH (Deploy Key)** from the dropdown.
       * **Git SSH URL** - Enter the SSH URL you retrieved in step 1 of this guide
       - **Git Branch** - Enter the name of the default branch for the repository. This is usually `main` or `master`.
             <Warning>
               Avoid naming your branch `omni` or `omnianalytics`. Omni creates temporary branches prefixed with `omni/` and `omnianalytics/` during internal operations like connection testing. A branch named `omni` or `omnianalytics` in your repository will conflict with this and cause validation errors and connection test failures.
             </Warning>
       - **Folder** - If your repository contains multiple dbt projects, enter the path to the folder that contains the dbt project you want to connect.
       - **Enable Virtual Schemas** - Enables the use of virtual schemas, which require additional setup. See [Working with dbt virtual schemas](/integrations/dbt/virtual-schemas) for instructions.
       - **Enable dbt Semantic Layer** - Check this box to enable the [dbt Semantic Layer integration](/integrations/dbt/semantic-layer). When enabled, Omni will use the dbt Semantic Layer to pull in metrics and dimensions defined in your dbt project.
       - **Auto-generate primary keys and relationships from dbt constraints** - Check this box to allow Omni to generate primary keys and relationships from native dbt constraints.
       - **dbt Version** - When set to **Auto** (default), Omni will auto-detect the dbt version from the `require-dbt-version` pin in `dbt_project.yml`. If a usable pin isn't found, Omni defaults to the latest supported version of dbt. Otherwise, you can select a specific version from the list of versions that Omni supports.
    5. Click **Save**.

    After the dbt connection is created, a **Public Key** will display. Leave this page open - you'll need it in the next step.
  </Step>

  <Step title="Add the deploy key to your repository" id="add-deploy-key">
    <Note>
      If the repository is already connected to Omni through the [Git integration](/integrations/git), skip this step. Omni will use the existing deploy key.
    </Note>

    In this step, you'll add the **Public Key** created in step 2 of this guide to your dbt repository as a deploy key.

    1. Browse to the Azure DevOps web portal (ex: `https://dev.azure.com/<your-org-name>/`).
    2. Click the **User settings** icon next to your avatar in the top right corner of the page.
    3. Click **SSH public keys**.
    4. On the page that displays, click **+ New Key**.
    5. In the **Add New SSH Key** panel that displays, fill in the following:
       * **Name** - Enter a descriptive name, such as *Omni Snowflake Model*
       * **Public Key Data** - {keyInstructions_0}
    6. Click **Add**.
  </Step>
</Steps>

## Next steps

After you successfully connect your dbt repository, you need to:

1. [Configure your production dbt environment](/integrations/dbt/environments)
2. [Sync dbt with Omni](/integrations/dbt/syncing-dbt)
3. [Set up Virtual Schemas](/integrations/dbt/virtual-schemas). This isn't required to use the dbt integration, but enabling Virtual Schemas before you start building in Omni avoids migrating later.
