Edit

Share via


Tutorial: Practice with a sample dbt project in Microsoft Fabric (preview)

The dbt Job in Fabric lets you run dbt transformations without complex setup. You can orchestrate model builds, tests, and deployments directly in Fabric by using built-in capabilities for scheduling and monitoring. This tutorial walks you through working with a sample project to learn dbt job capabilities.

In this tutorial, you:

  • Create a dbt job with a sample project
  • Run dbt transformations
  • Monitor and verify the results

If you don't have a Fabric subscription, create a free trial account.

Prerequisites

Before you begin this tutorial, you need:

  • Access to a Fabric workspace
  • Permissions to create items in the workspace
  • Basic familiarity with dbt concepts (models, tests, and transformations)

Create a dbt job with a sample project

Create a new dbt job item in your workspace by using sample project files.

  1. Go to your Fabric workspace.

  2. Select +New item, then search for and select dbt job from the item creation menu.

  3. Enter a name, select a location, and select Create.

    Screenshot of the create job dialog in the Fabric UI.

  4. You see three options for starting a dbt project. Select Practice with Sample Project to explore and work with a prebuilt example.

    Screenshot showing three options to start a dbt project.

  5. Select the Jaffle Shop sample project, which lets you work with data that includes orders, payments, and customer datasets.

    Screenshot showing the Jaffle Shop sample project option.

  6. Select Select a profile to select an adapter profile to run your dbt project against.

    Screenshot showing the profile selection for the Jaffle Shop project.

  7. Create a new warehouse to store your sample data by selecting the Warehouse option.

    Screenshot showing the Fabric warehouse selection.

  8. Enter a name for the warehouse and select Create and connect.

    Screenshot showing the warehouse naming dialog.

  9. By default, the schema is set to jaffle_shop, and the option to seed data is selected. This option loads sample data into the schema inside the warehouse you created. Select Connect.

    Screenshot showing the Jaffle Shop schema and seed data options.

  10. The project setup completes in a few minutes as the files are imported. After it finishes, verify that the sample data was seeded by selecting the Open Warehouse button at the top of the page, and checking the warehouse and schema. You can also confirm the sample data in the output panel at the bottom of the screen.

    Screenshot showing the successful import of the Jaffle Shop project and seeded data.

Run the dbt job

Execute the dbt transformations to build models, run tests, and create snapshots.

  1. The top panel provides options to Build, Compile, or Run your project. By default, the operation is set to Build, which runs all models, tests, and snapshots together for a complete workflow.

  2. Select Build, then select Run.

    Screenshot showing the Build command and Run command buttons.

  3. (Optional) Run or exclude specific models by using advanced selectors. Go to Advanced Settings in the top panel, select Run Settings, then select Run with Advanced Selectors.

    dbt run --select my_model 
    dbt build --select staging.* 
    dbt build --exclude deprecated_models 
    

    Selectors let you target parts of your pipeline for faster iteration during development or testing.

    Screenshot showing the advanced selectors option.

Monitor and verify the results

Review the execution results and verify that transformations complete successfully.

  1. After the dbt job starts, monitor its progress in the Output tab at the bottom of the screen. The run typically completes in a few minutes.

  2. Confirm a successful run by checking the Output tab. The status shows as succeeded when the run completes successfully.

    Screenshot showing a successful build command execution.

  3. Verify the output by checking the transformed data in the Fabric Warehouse. Select the Open Warehouse button at the top of the dbt job page, then look under the sample_dbt_project → jaffle_shop schema.

    Screenshot showing the transformed data in the Fabric warehouse.

  4. Open the Compiled SQL tab at the bottom of the dbt job page to review the rendered SQL code that dbt ran. This tab helps you debug issues or optimize queries.

    Screenshot showing the compiled SQL in the bottom panel.

  5. Open the Lineage view to visualize the dependency graph of your models. This view shows how data flows between sources and transformations, helping you understand relationships, assess downstream impact, and troubleshoot issues.

    Screenshot showing the lineage view in the bottom panel.

Clean up resources

When you finish the tutorial, delete the dbt job and warehouse to avoid extra costs.

  1. Open the Fabric workspace where you created the dbt job.

  2. Hover over the dbt job you created, select the More options ellipsis (...), then select Delete.

    Screenshot showing the more options menu to delete the dbt job from your workspace.

  3. To delete the warehouse, search for the warehouse in the workspace where you created your dbt job. Hover over the warehouse you created, select the More options ellipsis (...), then select Delete.

    Screenshot showing the more options menu to delete the warehouse from your workspace.