Skip to content

Publish DataSource with multiple database connections - need multiple connection credentials #792

Closed

Description

@bis4fun

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.

Activity

  1. shinchris commented on Feb 22, 2021

    @shinchris
    Contributor

    The publish_workbook sample has an example of using multiple connections. Have you tried publishing with multiple connection items this way?

  2. bis4fun commented on Feb 22, 2021

    @bis4fun
    Author

    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.

  3. andymiller-og commented on Mar 5, 2021

    @andymiller-og

    Bump

    Anyone out there have a solution for publishing datasources that have multiple connections?

  4. bis4fun commented on May 28, 2021

    @bis4fun
    Author

    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.

  5. s-ahuja commented on Sep 13, 2021

    @s-ahuja

    I tried today and I wasn't able to publish a datasource file with multiple connections. Does anyone have any suggestions?

  6. jacalata commented on Jun 28, 2022

    @jacalata
    Contributor

    I think this will also be fixable with #1057

  7. lerda01 commented on Aug 5, 2023

    @lerda01

    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.

  8. jacalata commented on Aug 25, 2026

    @jacalata
    Contributor

    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.

  9. removed
    in-progressIssues that are in-progress of being fixed
    on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions