๐Ÿš€ Set Up Microsoft Fabric Warehouse with dbt Cloud

๐Ÿš€ Set Up Microsoft Fabric Warehouse with dbt Cloud

dbt Cloud makes it simple to orchestrate and manage your analytics workflows. In this guide, weโ€™ll walk through configuring Microsoft Fabric Warehouse as a connection in dbt Cloud using a Service Principal for secure authentication.

I will also include all prerequisites, step-by-step instructions, and screenshots to make the setup seamless.

โœ… Prerequisites

Before starting, make sure you have:

๐Ÿ”‘ Step 1: Register an Application & Add Service Principal

  1. Log in to the Azure Portal.
  2. In the navigation menu, select Microsoft Entra ID (formerly Azure Active Directory).
  3. Go to App registrations โ†’ + New registration.

4. Enter a Name for your application.

  • Under Supported account types, select: Accounts in this organizational directory only
  • Click Register.

๐Ÿ‘‰ Make a note of:

  1. In theย Supported account typesย section, selectย Accounts in this organisational directory onlyย and clickย Register.
  2. Make a note of theย Application (client) IDย andย Directory (tenant) ID These values will be needed in dbt Cloud.

๐Ÿ” Step 2: Create a Client Secret

  1. Open the application you registered in Step 1.
  2. From the left menu, select Certificates & secrets โ†’ + New client secret.
  3. Provide a Description and select an Expiry period.
  4. Click Add.

๐Ÿ‘‰ Copy and save the client secret value. You will not be able to view it again later.

๐Ÿข Step 3: Enable Service Principal in Microsoft Fabric

  1. Log in to your Microsoft Fabric account.
  2. Click the Settings (โš™๏ธ) icon in the top right.
  3. Under Governance and Insights โ†’ Admin portal.
  4. Navigate to Tenant settings.
    • Under Developer settings, set: Service principals can use Fabric APIs โ†’ ON

Under OneLake settings, set: Users can access data stored in OneLake with apps external to Fabric โ†’ ON

๐Ÿ“‚ Step 4: Create a Workspace & Add Service Principal

  1. From the Fabric navigation menu, go to Workspaces โ†’ + New workspace.
  2. Enter a Name and click Apply.
  3. Select your new workspace โ†’ Manage Access.
  4. Click + Add people or groups.
  5. Add the Service Principal created in Step 1.
  6. Assign the role Contributor.

๐Ÿ— Step 5: Create a Lakehouse or Warehouse

  1. In Fabric, click Create โ†’ Lakehouse or Warehouse (depending on your use case).
  2. Provide a unique name and click Create
  3. Retrieve the SQL endpoint for Lakehouse/Warehouse we use in dbt setup

โš™๏ธ Step 6: Configure dbt Cloud Environment

Now letโ€™s connect Fabric to dbt Cloud.

In dbt Cloud, go to Settings โ†’ Connections โ†’ Connection settings

  • Type: fabric
  • Settings:
    • Server: SQL endpoint from step 5
    • port : 1433
    • Database: <fabric>
  1. In dbt Cloud, go to Orchestration โ†’ Environments โ†’ + New Environment.
    • Environment name: fabric-dbt
    • Environment type: Deployment
    • Deployment type: STG or PROD as needed
    • dbt version: Latest

2. Scroll down to Connection settings:

  • Connection: Fabric
  • Authentication: Service Principal
  • Tenant ID โ†’ (from Step 1)
  • Client ID โ†’ (from Step 1)
  • Client Secret โ†’ (from Step 2)
  • Schema โ†’ dbo (or your schema of choice)
  1. Click Test Connection.
    • If successful, youโ€™ll see: โœ… COMPLETE โ€“ Your test completed successfully, youโ€™re good to go!
  2. Click Save.

Your dbt Cloud environment is now fully connected to Microsoft Fabric Warehouse using a Service Principal.


๐ŸŽ‰ Wrap Up

Youโ€™ve successfully:

  • Registered a Service Principal in Azure
  • Enabled Fabric API & OneLake access
  • Created a Workspace and Warehouse
  • Configured dbt Cloud to connect securely using Service Principal

Now you can start building and orchestrating your dbt models on Microsoft Fabric Warehouse!

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *