Deploy Reflex to Databricks
This guide walks you through deploying a Reflex web application on Databricks using the Apps platform.
Prerequisites
- Databricks workspace with Unity Catalog enabled
- GitHub repository containing your Reflex application
- Reflex Enterprise license (for single-port deployment)
Step 1: Connect Your Repository
- Link GitHub Repository
- Navigate to your Databricks workspace
- Go to your user directory
- Click Create → Git folder
- Paste the URL of your GitHub repository containing the Reflex application
Step 2: Configure Application Settings
Create Configuration File
Create a new file called app.yaml directly in Databricks (not in GitHub):
Obtain Required Tokens
- Reflex Access Token
- Visit Reflex Cloud Tokens
- Navigate to Account Settings → Tokens
- Create a new token and copy the value
- Replace
your-token-herein the configuration - Databricks Resources
- Update
DATABRICKS_WAREHOUSE_IDwith your SQL warehouse ID - Update
DATABRICKS_CATALOGwith your target catalog name - Update
DATABRICKS_SCHEMAwith your target schema name
Step 3: Enable Single-Port Deployment
Update your Reflex application for Databricks compatibility:
Update rxconfig.py
Update Application Entry Point
Modify your main application file where you define rx.App:
Also add
reflex-enterprise and asgiproxy to your requirements.txt file.Step 4: Create Databricks App
- Navigate to Apps
- Go to Compute → Apps
- Click Create App
- Configure Application
- Select Custom App
- Configure SQL warehouse for your application
Step 5: Set Permissions
If you are using the samples Catalog then you can skip the permissions section.
Catalog Permissions
- Navigate to Catalog → Select your target catalog
- Go to Permissions
- Add the app's service principal user
- Grant the following permissions:
- USE CATALOG
- USE SCHEMA
Schema Permissions
- Navigate to the specific schema
- Go to Permissions
- Grant the following permissions:
- USE SCHEMA
- EXECUTE
- SELECT
- READ VOLUME (if required)
Step 6: Deploy Application
- Initiate Deployment
- Click Deploy in the Apps interface
- When prompted for the code path, provide your Git folder path or select your repository folder
- Monitor Deployment
- The deployment process will begin automatically
- Monitor logs for any configuration issues
Updating Your Application
To deploy updates from your GitHub repository:
- Pull Latest Changes
- In the deployment interface, click Deployment Source
- Select main branch
- Click Pull to fetch the latest changes from GitHub
- Redeploy
- Click Deploy again to apply the updates
Configuration Reference
Troubleshooting
- Permission Errors: Verify that all catalog and schema permissions are correctly set
- Port Issues: Ensure you're using
$DATABRICKS_APP_PORTand single-port configuration - Token Issues: Verify your Reflex access token is valid and properly configured
- Deployment Failures: Check the deployment logs for specific error messages
Notes
- Single-port deployment requires Reflex Enterprise
- Configuration must be created directly in Databricks, not pushed from GitHub
- Updates require manual pulling from the deployment interface