Run dbt projects from an Azure DevOps repository in Microsoft Fabric

If your team keeps its dbt project in Azure DevOps, you can run it in Microsoft Fabric without moving any code. Connect a dbt Job to your Azure DevOps repository, and Fabric pulls the project from your branch on every run.

  • Azure DevOps stores your dbt project and keeps your pull requests, reviews, and branch policies.
  • Fabric runs dbt commands, schedules runs, and shows the results.

Benefits

  • No copy or sync. Every run uses the latest code on your branch.
  • Sign in with Microsoft Entra ID. Connect with your organizational account or a service principal. A service principal isn't tied to a person, so repository access doesn't depend on that person's account. Scheduled runs still require valid credentials and permissions for the target connection.
  • Run projects from any folder. Point the dbt Job to the folder that holds dbt_project.yml. One repository can hold several dbt projects.

Prerequisites

  • A Fabric workspace where you have the Contributor role or higher.
  • A dbt project in an Azure DevOps Git repository.
  • Read access to the repository through your organizational account or a service principal.
  • An existing target for the dbt job, such as a warehouse, with the required permissions and access.

Create a dbt job

  1. In your workspace, select + New item > dbt job.

    Screenshot of the New item pane in Microsoft Fabric with the dbt job item highlighted.

  2. Enter a name, and then select Create.

  3. Select Connect to a Git project.

    Screenshot of the dbt Job start page with the Connect to a Git project option highlighted.

  4. Under New sources, select Azure DevOps - Source control.

    To reuse a connection, select it under OneLake catalog instead, and go to Select the branch, folder, and target.

Connect to Azure DevOps

  1. In Azure DevOps URL, enter the repository URL, such as https://dev.azure.com/contoso/analytics/_git/dbt-models.

  2. Enter a Connection name.

  3. Under Authentication kind, select one of these options:

    • Organizational account: Select Sign in.
    • Service principal: Enter these values:
      • Tenant ID: The Microsoft Entra tenant that your Azure DevOps organization connects to.
      • Service principal client ID: The application (client) ID.
      • Service principal Key: The client secret.

    Screenshot of the Connect to a Git project dialog with the Azure DevOps URL and Authentication kind fields highlighted.

    Screenshot of the service principal fields: Tenant ID, Service principal client ID, and Service principal Key.

  4. Select Next.

Select the branch, folder, and target

  1. In Branch, enter the branch to run, such as main. Fabric pulls the project from this branch on every run.

  2. In Folder path, enter the folder that contains dbt_project.yml, such as projects/jaffle_warehouse. Leave it empty if the project is at the repository root.

    Screenshot of the Connection setup step with the Branch and Folder path fields highlighted.

  3. Select Next, and then select where dbt runs, such as an existing warehouse on the OneLake catalog tab.

  4. Enter a Schema.

  5. Keep Seed data? selected to load your seed files right away. Clear it to skip this step.

  6. Select Connect.

    Screenshot of the Profile connection setup step with the Schema field and the Seed data option highlighted.

Run the dbt Job

The dbt Job shows the connected repository, branch, and folder path.

Screenshot of a dbt Job connected to an Azure DevOps repository, showing the repository, branch, and folder path.

  1. Select a command, such as build.
  2. Select Run.
  3. Review the results on the Output tab.

To run the dbt Job on a schedule, see Schedule dbt Jobs.

Update the project or the connection

  • Change models or tests: Push the change to the branch in Azure DevOps. The next run uses it.

  • Change the branch or folder: Select Advanced settings. On the General tab, update Branch or Folder path, and then select Apply.

    Screenshot of the Advanced settings General tab with the Branch and Folder path fields highlighted.

  • Update credentials or rotate a client secret: Select Settings > Manage connections and gateways, and then edit the connection.

  • Stop using the repository: Select Disconnect Azure DevOps.

Known limitations

You can't edit project files in Fabric. Make changes in Azure DevOps.