TableauUsageToDatabricks

Overview

TableauUsageToDatabricks is a .NET application designed to extract Tableau usage data and upload it to Databricks in a structured format. It parses Tableau XML and JSON files, transforms them into models, and writes the results as Parquet files for analytics and reporting in Databricks.

Prerequisites

How to create tokens and find IDs

Configuration: appsettings.json

Before running the application, you must create and configure an appsettings.json file. This file contains all necessary settings for Tableau and Databricks integration.

Where to place: Place appsettings.json in the same directory as TableauUsageToDatabricks.exe (the published executable). Users can edit this file at any time to update configuration without modifying the application.

Example appsettings.json

{
  "Tableau": {
    "BaseUrl": "https://your-tableau-server.com",
    "TokenName": "your-token-name",
    "TokenSecret": "your-token-secret"
  },
  "Databricks": {
    "Host": "https://your-databricks-instance.cloud.databricks.com",
    "PersonalAccessToken": "your-databricks-token",
    "WarehouseId": "your-warehouse-id",
    "VolumePath": "/mnt/your-volume",
    "DatabaseName": "your-database-name"
  },
  "Parquet": {
    "DataSourcesFileName": "datasources.parquet",
    "WorkbooksFileName": "workbooks.parquet",
    "ViewsFileName": "views.parquet",
    "WorkbookUsageFileName": "workbook_usage.parquet",
    "ViewUsageFileName": "view_usage.parquet",
    "WorkbookConnectionsFileName": "workbook_connections.parquet",
    "WorkbookDatasourcesFileName": "workbook_datasources.parquet",
    "DataSourceConnectionsFileName": "datasource_connections.parquet"
  }
}

Required fields

Usage

  1. Edit appsettings.json with your Tableau and Databricks configuration.
  2. The application connects to Tableau Server, collects usage statistics, and saves them as Parquet files in Temp folders before uploading to Databricks.
  3. Run the application from PowerShell or CMD:
    .\TableauUsageToDatabricks.exe

Features

How to Build and Publish (Self-Contained, Win-x64)

  1. Restore dependencies:
    dotnet restore
  2. Publish a self-contained release build for Windows 64-bit:
    dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true -o publish
    Output will be in the publish folder.
  3. Create a ZIP file of the release:
    Compress-Archive -Path publish\* -DestinationPath TableauUsageToDatabricks-win-x64.zip

Publishing to NuGet

  1. Build the NuGet package:
    dotnet pack -c Release
  2. Publish to NuGet.org:
    dotnet nuget push .\bin\Release\TableauUsageToDatabricks.1.0.0.nupkg --api-key <your-nuget-api-key> --source https://api.nuget.org/v3/index.json
Thank you for considering contributing to TableauUsageToDatabricks!
TableauUsageToDatabricks Repository