Skip to content

feat: add sample for converting connection auth to Snowflake keypair - #1844

Open
jacalata wants to merge 1 commit into
tableau:developmentfrom
jacalata:jac/samples-keypair-conversion
Open

feat: add sample for converting connection auth to Snowflake keypair#1844
jacalata wants to merge 1 commit into
tableau:developmentfrom
jacalata:jac/samples-keypair-conversion

Conversation

@jacalata

Copy link
Copy Markdown
Contributor

Summary

Adds samples/update_connection_to_keypair.py, a runnable end-to-end sample showing how to convert an existing Tableau Cloud datasource or workbook connection from username/password auth to Snowflake keypair auth.

  • Takes the item LUID and target Snowflake account username as arguments.
  • Optionally targets a specific connection LUID; otherwise finds and uses the first Snowflake connection on the item.
  • Uses the existing ConnectionItem fields (auth_type, username, embed_password) already serialized correctly by Connection.update_req — no library changes required.
  • Re-fetches the connection after update and prints the new auth_type for confirmation.
  • Prominently calls out the prerequisite that the private key must first be saved on the site under Site Settings -> Saved Credentials for Data Sources.

Supported since REST API v3.27.

Closes #1602 (paired with the docs PR against gh-pages).

Test plan

  • python samples/update_connection_to_keypair.py --help shows expected args
  • Manual: run against a Tableau Cloud site with a pre-saved Snowflake private key credential and verify the connection's auth_type flips to auth-keypair and extract refresh succeeds
  • Manual: run without pre-saved credentials and confirm the printed reminder is visible

Refs #1602

🤖 Generated with Claude Code

Adds samples/update_connection_to_keypair.py demonstrating how to
convert an existing Tableau Cloud datasource or workbook connection
from username/password to Snowflake keypair authentication using the
REST API v3.27 flow. Documents the prerequisite that the private key
must first be saved under Site Settings -> Saved Credentials for Data
Sources on the site.

Refs tableau#1602

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Key pair authentication while publishing to Cloud from onprem using Tableau SDK

1 participant