How To: Programmatically update Tableau dashboard credentials

44 Views Asked by At

Does anyone know if Tableau has the ability to programmatically update the credentials that a dashboard uses to access a data source like Snowflake? In my use case, the password used for the snowflake data source is changed every N days, which means that a user has to also update the credentials in Tableau. Ideally, we would want to configure tableau to read the credentials automatically via an API call some credential service, etc. but I don't think that's supported via the Tableau API.

1

There are 1 best solutions below

0
On

It is possible to update the credentials via the Tableau Rest API. So when the credentials are updated in Snowflake you could run a script that also updates any data sources that are connected. This is from the rest api docs at Tableau rest api

Update Data Source Connection Updates the server address, port, username, or password for the specified data source connection.

 PUT /api/api-version/sites/site-id/datasources/datasource-id/connections/connection-id

JSON request body:

 {
   "connection": {
     "serverAddress": "newAddress",
     "serverPort": "newPort",
     "userName": "Jane Doe",
     "password": "xxxxxx",
     "embedPassword": "false",
     "queryTaggingEnabled": "false"
   }

}

You can also use tableauserverclient with python. An example of that is here. Hope this works for you!