Till now this blog was only posted by one person (me). And I decided to take a new opportunity for my career so starting March 8 2021 I am not an employee of Tableau (Salesforce).
What will happen to the blog, how it will be managed and updated is still to be figured out by the team I used to be part of.
Anyway ownership for the blog to be transitioned to another person and hopefully you can see new updated, tips, tricks and bits of hidden knowledge in the nearest future.
You requested it, we listened, it took some time to make it happen… and now you can use TabPy, Rserve or any other analytics extension with Tableau Online!
To be able to enable the feature you need to be a site admin. In a similar way how on-prem Tableau Server is configured (see Multiple Analytics Extensions Connections with Tableau Server 2020.2 for details) for Tableau Online go to Settings, Extensions, set checkbox Enable analytics extensions for site and click Create new connection link. In popup window specify connection type, host, port and credentials.
After configuring the connection click Save in the dialog window and then Save on the page. That’s it – now you can publish and use workbooks with Python/R/you-name-it scripts in them…
Actually there are couple more things to consider:
Your analytics extensions instance should use a certificate that Tableau Online can trust. It means no self-signed certs or certs issued by your organization. Those should be certs signed by one of well known CAs (Certificate Authority), e.g. DigiCert.
It has to be an endpoint (host and port) that is reachable for Tableau Online via the internet. If the analytics extension you are planning to use can be reached outside of your organization network Tableau Online should be able to see it too.
To install or update to the latest version as usual run
pip install --upgrade tabpy
The release includes fixes for authentication:
Fixed bug for scripts with tabpy.query(...) calls for when authentication is configured for TabPy.
Fixed bug for TabPy reporting 500 error instead of 401 when it runs without the attached console.
Improved authentication security (this is breaking change) – now TabPy returns authentication error when credentials are provided, but it is not configured for it.
With this improvement, it is possible now to have multiple connections for one server (one connection per site) – TabPy, Rserve, Ople.ai, AtlTabPy, MatLab version of TabPy, etc. This allows organizations to have different analytics extensions per department or user role.
Server administrators can now configure multiple Analytics Extension (formerly External Service) connections in Tableau Server. Administrators can set one per site through the Settings UI and turn connections on or off at the Site level. Now teams using different R, Python, and other external data science environments can share their work with consumers across the same Server. Settings are easier than ever to configure with UI controls or via the Server REST API.
It is important to understand that web UI or REST API are now the only way to enable, disable and configure analytics extensions – TSM doesn’t provide that functionality anymore.
To enable analytics extensions feature which is disabled by default you need to be a server administrator. The screenshot below shows how to enable the feature for the whole server:
Make sure you are configuring All Sites, go to Setting, Extensions tab, set Enable analytics extension checkbox and click Save.
With the feature enabled for a server now you can configure a connection for each specific site. To be able to do so you need to be a site administrator. The next screenshot demonstrates how a connection can be configured:
Select the site you want to configure (on the screenshot it is TabPy Site), go to Settings, Extensions tab, set Enable analytics extension for site checkbox and configure a connection with setting Connection Type, Host, and Port. Set Require SSL and authentication parameters as needed (read How to configure TabPy with authentication and use it in Tableau for authentication configurations steps) and click Save button.
With the configuration successfully saved all the workbooks published on the site will use the configured connection. For workbooks on other sites connection from that site (if configured at all) will be used.
Specifically for configuring an analytics extension connection for Tableau Server there is no need to provide a certificate for tsm security vizql-extsvc-ssl enable command and --cert-file parameter is not supported anymore.
The certificate validation works in exactly the same way as it does for Tableau Desktop which means root certificate, self-signed certificate or the whole certificate chain (for Rserve) has to be installed as trusted on Tableau Server nodes.
With this improvement, there is no need to share an analytics extension certificate and it can be validated against what is configured on client machines (nodes running Tableau Server).