Auth token warning using oauth M2M

Open
#702 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
azure, python

Research direction

Start by reproducing the dbt run on the Ubuntu 24.04 Azure DevOps agent with the shown OAuth service-principal profile, then inspect the databricks-sql-connector token_federation warning. Done means explaining why token exchange fails only in that environment and determining whether the connector behavior needs a change.

Written by the indexing model from the issue text.

Description

This was originally posted in dbt-databricks project and I was asked to cross post i here.

Related to: https://github.com/databricks/dbt-databricks/issues/1246

When running dbt in an Azure Devops Agent (for continues integration reasons) I get this warning:

09:13:52  Concurrency: 6 threads (target='test')
09:13:52  
09:13:53  databricks-sql-connector adapter: Token exchange failed, using external token: %s
WARNING:databricks.sql.auth.token_federation:Token exchange failed, using external token: 'access_token'

It still works, the project runs, but I would like to understand what might be happening here.
I am not able to reproduce this on my local machine using the same M2M profile.
Maybe you can point me in the right direction?

Profile using an azure service principal:

    test:
      host: the_host
      http_path: the_path
      catalog: the_catalog
      schema: test
      threads: 6
      type: databricks
      auth_type: oauth
      azure_client_id: "{{ env_var('DATABRICKS_CLIENT_ID') }}"
      azure_client_secret: "{{ env_var('DATABRICKS_CLIENT_SECRET') }}"

Python 3.11.13
Running with dbt=1.10.8
Registered adapter: databricks=1.10.9

The Devops Azure Agent runs an ubuntu-24.04 Image
Version: 20250929.60.1

Dominant language
Python
Stars
233
Forks
152
Avg merge
21h 5m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databricks/databricks-sql-python

All issues in databricks/databricks-sql-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.