Skip to main content

Context:

We have two (2) Tableau Servers in where hundredths of reports dwell for users to make use of: workbooks with either .twb and .twbx extensions, all of them contain a SparkSQL connection type within which we embedded a Databricks token value to stablish the connection over to our Databricks server. Recently Databricks PAT (personal access token) policy changed and now tokens have a life time of 1 year, this situation means an impact for us and our users due to the token manual update is now needed to guarantee reports refreshes work correctly.

 

Challenge:

We're exploring a way in which by making use of TSC (Python's Tableau Server Client module) we can:

 

1. Download reports (.twbx type) from servers and store them locally

2. Unzip them and then modify the embedded .twb (.xml) connection settings

3. Zip the updated .twb alongside with its data source

4. Publish them back to the server within its source project

5. Verify the updated connection (from SparkSQL to Databricks OAuth) is set in a way the refresh tasks can go on with no issue

 

So far we've been able to develop a source code that addresses 1. to 4. items above, but when it comes to 5. after we publish the report back to the server the connection detail shows the following setting:

 

Is there a way to programmatically switch Spark SQL connection (with token value embedded) over to Databricks (OAuth) type enabling by which it wouldn't be possible a refresh to run with no problem.

 

Question:

Is there a way when we modify the embedded .twb (.xml) within a .twbx file to include some 'key:value' that allows the "Embedded credentials in the connection" in the image above to be enabled when the workbook is published back?

 

Following I share the DATABRICKS_DETAILS for the connection we're trying to update.

 

DATABRICKS_DETAILS = {

  'class':'databricks',

  'authentication':'oauth',

  'authentication-type':'OAuth',

  'oauth-config-id':'default',

  'username': --here comes our user name,

  'server': --here comes our server address,

  'dbname': --here comes our data base name,

  'v-http-path': --here comes http-path of our refresh resource in Databricks server,

}

5 个回答
  1. 2025年10月21日 19:56

    @David Rango​ 

    Hi, what instruction you are using for the step 4?. Pre publishing, have you verified the oauth credential has been set (my account settings - credentials) for the account you are using to publish the workbook/datasource?

     

    If this post resolves the question, would you be so kind to "Select as Best"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.

     

    Regards,

     

    Diego Martinez

    Tableau Visionary and Forums Ambassador

0/9000