Skip to content

Tableau

Introduction#

RStudio Connect can be used to host Tableau Analytics Extensions built in both R and Python. R extensions are built using the plumbertableau R package, and Python extensions are built using the fastapitableau Python package. Both of these packages integrate seamlessly with RStudio Connect. You can host any number of Tableau Analytics Extensions on RStudio Connect, and Connect will ensure that requests from Tableau are passed to the correct extension.

Setting up RStudio Connect#

Requirements#

  • Tableau extensions are supported and enabled by default starting in RStudio Connect version 2021.09.0.
  • RStudio Connect must be configured with the following settings:
    • TableauIntegration.Enabled must not be set to False.
    • Server.Address must be configured.
    • Due to how Tableau handles configuring analytics extensions, RStudio Connect must be configured on the root path of its domain. For example, you cannot configure RStudio Connect as an analytics extension if it is hosted at a domain like rstudio.mycompany.com/rstudio-connect without making additional changes to the proxy running in front of RStudio Connect.

See the RStudio Connect Admin Guide for more information about configuring RStudio Connect.

Extensions published to an incompatible RStudio Connect server will provide a warning message that describes which of the above criteria are not met and potential resolutions.

Access, Permissions, and Security#

Your RStudio Connect server must be configured as an Analytics Extension in Tableau. Tableau requires an API key to authenticate with RStudio Connect. This API key will be used for all requests from Tableau to RStudio Connect, and the Tableau instance will have access to any content on Connect that the API key's owner can access.

We recommend creating a "service account" (an account used only by Tableau, not by any individual) on RStudio Connect, and configuring Tableau with an API key for this account. If you name the service account "Tableau", simply add the "Tableau" user to the Access List for any extension it should be able to access. This way, you can more finely control what content Tableau can access without affecting any RStudio Connect users.

Configuring RStudio Connect as an Analytics Extension in Tableau#

Before you can use extensions hosted on an RStudio Connect server from Tableau, you'll need to register that server in Tableau's Extensions settings. The steps to configure analytics extensions in Tableau differ slightly depending on whether you're using Tableau Desktop or Tableau Server/Online.

  1. Using an administrative account, login to Tableau Server/Online
  2. Navigate to Settings, then Extensions
  3. Under the heading 'Analytics Extensions', select 'Enable analytics extension for site'
  4. Create a new connection and select the connection type of 'Analytics Extensions API'
  5. Select whether you want to use SSL1 and enter the server Host and Port for your RStudio Connect server2.
  6. Select 'Sign in with a username and password'. The username is 'rstudio-connect' and the password is any valid API key from RStudio Connect
  7. Create / Save changes
  1. Navigate to Help, Settings and Performance, Manage Analytics Extension Connection...
  2. Select 'Analytics Extensions API'
  3. Select whether you want to use SSL and enter the server Host and Port for your RStudio Connect server2.
  4. Select 'Sign in with a username and password'. The username is 'rstudio-connect' and the password is any valid API key from RStudio Connect
  5. Save changes

For more information about setting up analytics extensions in Tableau, please see the Tableau documentation.

Using Custom URLs for Tableau Analytics Extensions on RStudio Connect#

All content hosted on RStudio Connect receives a unique identifier, which is used as part of its default URL. You can optionally set a custom URL (called a vanity URL) for any piece of content on RStudio Connect in its control panel. By default, only administrators can assign vanity paths, but RStudio Connect can be configured to allow all publishers to assign them.

We recommend using custom URLs for Tableau Analytics Extensions to provide workbook creators with a more meaningful, memorable address (e.g. SCRIPT_REAL("/content/c8b1e158-4fab-4d09-9791-8674afba86eb/predict", ...) vs. SCRIPT_REAL("/loess/predict", ...)).

While custom URLs are best practice for Tableau Analytics extensions, they are not required. You can access extensions published to RStudio Connect by their content identifier or vanity URL. If an extension has a vanity URL, RStudio Connect will prefer that in all of the documentation it generates.

Additional details#

For further information about developing Tableau Analytics Extensions in R, please see the documentation for plumbertableau.

For further information about developing Tableau Analytics Extensions in Python, please see the documentation for fastapitableau.


  1. If you are using Tableau Online, you must enable SSL and use authentication for analytics extensions

  2. Due to the way Tableau handles Host and Port, your RStudio Connect server must be listening on the specified port on the root path of the provided host value.