Skip to content

server_address doesn't get updated on workbook publish #337

Closed

Description

@justyns

I'm working on a script that would push one workbook to multiple Tableau sites. Each site has a different database to connect to, so the embedded connection needs to be updated appropriately.

I'm trying to accomplish this by updating the embedded datasource connection information in the packaged workbook. Feel free to let me know if there's a better way to do this as I'm new to Tableau in general.

Currently, I have this:

    conn_creds = TSC.ConnectionCredentials(name=rds_user,
                                           password=rds_pass)

    # Create a connection and add the above credentials to it
    connection = TSC.ConnectionItem()
    connection.server_address = rds_host
    connection.server_port = rds_port
    connection.connection_credentials = conn_creds

    # Publish the workbook to tableau
    publish_item = server.workbooks.publish(new_workbook,
                                            workbook_file,
                                            publish_mode,
                                            connections=[connection])

This seems to work if the workbook was exported with the server_address set to the same thing as my rds_host above. So if rds_host and the server address in the workbook are both dev.example.com, it will update the credentials and publish correctly.

However, if rds_host is production.example.com and the workbook has dev.example.com, Tableau returns a failed to establish a connection to your datasource error message even though the credentials are correct.

Before I tried the above solution, I was using the (now deprecated?) connection_credentials attribute like this:

    conn_creds = TSC.ConnectionCredentials(name=rds_user,
                                           password=rds_pass)

    # Publish the workbook to tableau
    publish_item = server.workbooks.publish(new_workbook,
                                            workbook_file,
                                            publish_mode,
                                            connection_credentials=conn_creds)

This had the same effect of updating the username/password correctly, but would not update the server_address.

https://tableau.github.io/server-client-python/docs/api-ref#workbooks under workbooks.publish actually does not mention the connections= attribute at all, only connection_credentials. There was a warning message logged saying it was deprecated that lead me to use connections.

https://tableau.github.io/server-client-python/docs/api-ref#connections under ConnectionCredentials class mentions server_address and server_port attributes, but they don't seem to exist in https://github.com/tableau/server-client-python/blob/v0.7/tableauserverclient/models/connection_credentials.py and aren't used in https://github.com/tableau/server-client-python/blob/v0.7/tableauserverclient/server/request_factory.py#L38

Please let me know if I need to clarify anything or if more information is needed. I haven't looked at the code too much for this library yet, but when I get some time I planned on testing the same process with the rest api directly to verify that it isn't an issue with the server api itself.

Activity

  1. removed
    document-apiFunctionality implemented in https://github.com/tableau/document-api-python
    on May 30, 2025
  2. github-actions commented on Aug 6, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.

  3. github-actions commented on Aug 21, 2026

    @github-actions

    Closing due to inactivity. If this is still relevant, please reopen or file a new issue.

  4. jacalata commented on Aug 25, 2026

    @jacalata
    Contributor

    Reopening — the stale bot auto-closed this earlier this month, and I owe the thread an updated take.

    On Publish Workbook, serverAddress in the <connections><connection> block is a match key — the server uses it to figure out which embedded connection in your uploaded file the credentials should attach to. It is not a directive to change the workbook's server address on publish. The workbook publishes with whatever server address is baked into the file.

    To change an embedded connection's server on publish, use two calls:

    1. POST /workbooks — Publish Workbook, with credentials in <connectionCredentials>.
    2. PUT /workbooks/{workbook-id}/connections/{connection-id} — Update Workbook Connection, with the new serverAddress.

    In TSC: Server.workbooks.publish(...) then Server.workbooks.update_connection(...).

    The real gap here is documentation — the Publish Workbook payload template shows serverAddress without explaining that it's a match key rather than an override, which has led everyone on this thread (myself included in 2020) to expect the opposite. I'll open a docs bug against the REST API reference.

    🤖 Generated with Claude Code

  5. github-actions commented on Oct 25, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.

  6. github-actions commented on Nov 9, 2026

    @github-actions

    Closing due to inactivity. If this is still relevant, please reopen or file a new issue.

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