cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Setup dbt-core with Azure Entra ID

Shazaamzaa
New Contributor III

Hey team, I'm trying to standardize the development environment setup in our team. I've written up a shell script that I want our devs to run in WSL2 after setup. The shell script does the following:

1. setup Azure CLI - install and authenticate

2. Install Databricks CLI

3. Configures `databrickscfg` file with a `dev` Databricks profile that uses Azure CLI to authenticate

4. Installs dbt-core

5. Configures dbt-core profiles.yml <-- This is where my problems arise.

I've run this setup in a virtual Python environment on my WSL2 setup and everything works fine. I've setup dbt-core to authenticate to a SQL warehouse using OAuth and using the Client ID from a registered app in Azure. This setup works for me, but for whatever reason my colleague isn't able to get the dbt-core profile to authenticate. Every attempt to validate the connection using `dbt debug` command we get the error `Runtime error> No data received in callback`. We use a dbt project as part of a Databricks Asset Bundle and the colleague is able to successfully authenticate to Databricks, connect to their Personal Cluster etc. But dbt-core will not connect successfully. I followed the directions per the links below but no success. Both documents just say that run `dbt debug` and you will authenticate and it will work. The prompt to open a browser window works but then loads to a failure. This user definitely has access to the workspace and the SQL warehouse as they can connect via the GUI. Is there something wrong with the profile (see below)? Better even, is there a standard way to setup dbt-core with Azure Databricks and OAuth U2M that I'm missing?
Configure Azure Databricks sign-on from dbt Core with Microsoft Entra ID - Azure Databricks | Micros...
Secure OAuth Configuration for Azure Databricks and dbt: A Guide to Enhance Your Data Workflows
```

gold:
  outputs:
    dev:
      host: "<host_id>.azuredatabricks.net"
      http_path: "<http_path>"
      catalog: dev_catalog
      schema: default
      threads: 4
      type: databricks
      auth_type: oauth
      client_id: "{{ env_var('DATABRICKS_CLIENT_ID') }}" <-- tested as a local environment variable and hard coded
  target: dev

```
Any help is greatly appreciated.

1 REPLY 1

Shazaamzaa
New Contributor III

Hey @Retired_mod thanks for the response. I persisted a little more with the logs and the issue appears to be related to WSL2 not having a backend credential manager to handle management of tokens supplied by the OAuth process. To be honest, this is my interpretation of the below error message
`RuntimeError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.`
I've seen some other online posts about this issue (see here). I finally attempted the same setup script in a fresh WSL2 install of Ubuntu-24.04 (was previously using 22.02) and it seems to now work, even though the message about the no recommended backend still appears in the log, the OAuth process to authenticate via browser works fine. I guess it was a local issue all along, thanks again.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group