Skip to content

Problem with onedrive connection embedd #1001

Closed as not planned
Closed as not planned

Description

@Cloudy17g35

Describe the bug

Hi!

I have a following problem:

I want to download workbook A from project A then publish the same workbook to project B as workbook B.

One catch here is that connections need to stay the same.

Type of connection which i'm using is onedrive.

So where's the problem?

After running code below everything seems to be good.
Workbook B has been created in Project B.
Problem occurs when i ll go to datasources and then to the connections on my server.
At first glance everything looks good, it's written in column Authentication that connections are embedded as on picture below:

connection_1

But when we ll click 'three dots' in actions then it shows that it's not embedded.

connection_2

I'm 99.99% sure than credentials are good 😁

Versions

Details of environment:

Tableau Server Version: 2021.4.2 (20214.21.1217.2252) 64-bit Linux
Python 3.9.7
tableauserverclient 0.17.0.

To Reproduce

Here's code:

# connecting to the server, imports etc...

# initializing names of the projects
test_a = 'test_a'
test_b = 'test_b'

# sign into server
with server.auth.sign_in(tableau_auth):
    
    request_options = TSC.RequestOptions(pagesize=1000)
    # listing projects
    all_projects = list(TSC.Pager(server.projects, request_options))
    
    # find project test_a
    test_a = [project for project in all_projects if project.name == test_a ][0]
    
    # find project test_b
    test_b = [project for project in all_projects if project.name == test_b][0]
    
    # get all workbooks
    workbooks, _ = server.workbooks.get()
    
    # get workbook from project test_a
    workbook_from_a = [workbook for workbook in workbooks if workbook.project_id == test_a.id][0]
    
    # downloading workbook from project test_a
    server.workbooks.download(workbook_from_a.id)
    
    # workbook is stored in my cwd so path to it will be workbook_name + extenstion which is twbx
    path_to_workbook = workbook_from_a.name + '.twbx'
    
    # make new instance of WorkbookItem
    workbook_from_b = TSC.WorkbookItem(test_b.id)
    
    # publishing
    server.workbooks.publish(workbook_from_b, 
                             path_to_workbook, 
                             mode='Overwrite', 
                         connection_credentials =TSC.ConnectionCredentials(my_username, 
                                                                           my_pass, 
                                                                           True),skip_connection_check=True)
    
    # information about publishing
    myloger.info(f'{workbook_from_b} has been published')

Activity

  1. jacalata commented on Mar 18, 2022

    @jacalata
    Contributor

    hi @Cloudy17g35 , have you tried doing the same process using the UI? It would be interesting to know if there is any difference when you download+publish on the webpage instead of through the API.

  2. added
    gapA gap in the library for existing server functionality
    and removed
    needs investigationIssue needs to be looked at by Tableau
    on Dec 10, 2022
  3. 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.

  4. 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.

  5. jacalata commented on Sep 29, 2026

    @jacalata
    Contributor

    Circling back on this — the OneDrive connector in your example is an OAuth-based cloud-file connector, not a username/password (basic auth) connection type. Passing TSC.ConnectionCredentials(my_username, my_pass, True) supplies basic-auth credentials, which OneDrive connections don't actually use.

    To embed a working OneDrive credential, the credential generally needs to be established via the actual OAuth flow (e.g., signing in through the UI) rather than supplied as a username/password pair through the REST API.

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