You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Publish DataSource with multiple database connections - need multiple connection credentials #792
It appears the datasources.publish method does not have functionality to use multiple connection_credentials objects. We have several sources that connect to different databases, and while the source will publish and you can connect a workbook with no issues, you cannot refresh the source without manually entering the credentials.
I looked at this logic, but it is for a workbook with multiple data source connections. After working with the logic I determined that it wouldn't work due to the errors I recieved. The datasources.publish method does not work the same as publish_workbook method did not work the same.
Found a workaround for this using the update_connection method. The only issue here is that you need the connection id in order to make it work. You can obtain the id from the rest API, but couldn't locate it elsewhere. It would be great if it could be part of the payload from the datasources method.
Just to validate until this bug is addressed the only option is to update the datasource after is has been published? I have found no way to pass multiple connection credentials when using the Publish method via TSC or the Rest API.
This is now supported: datasources.publish(datasource_item, file, mode, connections=[...]) accepts a Sequence[ConnectionItem], and each connection is serialized under a <connections> element (see DatasourceRequest._generate_xml in tableauserverclient/server/request_factory.py). This lands the fix Jac linked to via #1057. Closing as completed and removing the in-progress label - please reopen if a specific multi-DB publish scenario still fails.
Activity
shinchris commentedon Feb 22, 2021
The publish_workbook sample has an example of using multiple connections. Have you tried publishing with multiple connection items this way?
bis4fun commentedon Feb 22, 2021
I looked at this logic, but it is for a workbook with multiple data source connections. After working with the logic I determined that it wouldn't work due to the errors I recieved. The datasources.publish method does not work the same as publish_workbook method did not work the same.
andymiller-og commentedon Mar 5, 2021
Bump
Anyone out there have a solution for publishing datasources that have multiple connections?
bis4fun commentedon May 28, 2021
Found a workaround for this using the update_connection method. The only issue here is that you need the connection id in order to make it work. You can obtain the id from the rest API, but couldn't locate it elsewhere. It would be great if it could be part of the payload from the datasources method.
s-ahuja commentedon Sep 13, 2021
I tried today and I wasn't able to publish a datasource file with multiple connections. Does anyone have any suggestions?
jacalata commentedon Jun 28, 2022
I think this will also be fixable with #1057
lerda01 commentedon Aug 5, 2023
Just to validate until this bug is addressed the only option is to update the datasource after is has been published? I have found no way to pass multiple connection credentials when using the Publish method via TSC or the Rest API.
jacalata commentedon Aug 25, 2026
This is now supported:
datasources.publish(datasource_item, file, mode, connections=[...])accepts aSequence[ConnectionItem], and each connection is serialized under a<connections>element (seeDatasourceRequest._generate_xmlintableauserverclient/server/request_factory.py). This lands the fix Jac linked to via #1057. Closing as completed and removing thein-progresslabel - please reopen if a specific multi-DB publish scenario still fails.