A Flask-based Databricks app that provides a web interface for uploading files to Unity Catalog volumes.
- 📁 File Upload Interface - Modern, intuitive drag-and-drop file upload
- 🔒 File Type Validation - Supports common file types (documents, images, data files)
- 📊 File Management - View all uploaded files with metadata (size, upload time)
- 💾 Unity Catalog Integration - Files are stored directly in Unity Catalog volumes
- ✅ Real-time Updates - Auto-refresh file list every 30 seconds
- 🎨 Beautiful UI - Modern, responsive design
Files are uploaded to: /Volumes/users/jason_taylor/agent_app_uploads
- Documents: txt, pdf, doc, docx
- Spreadsheets: xls, xlsx, csv
- Images: png, jpg, jpeg, gif
- Data: json, xml
- Archives: zip
Maximum file size: 16 MB
- Python 3.8 or higher
- Access to Databricks workspace
- Install dependencies:
pip install -r requirements.txt- Run the application:
python app.py- Open your browser and navigate to:
http://localhost:8080
- Ensure you have the Databricks CLI installed and configured:
databricks auth login --host https://e2-demo-west.cloud.databricks.com- Deploy the app bundle:
databricks bundle deploy- Access your app through the Databricks workspace UI under "Apps"
- Create a Unity Catalog volume (if not exists):
CREATE VOLUME IF NOT EXISTS users.jason_taylor.agent_app_uploads;- Upload all files to Databricks workspace
- Configure as a Databricks App in your workspace
soc-agent-app/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── databricks.yml # Databricks bundle configuration
├── templates/
│ └── index.html # Main UI template
├── static/
│ ├── css/
│ │ └── style.css # Styling
│ └── js/
│ └── script.js # Client-side logic
└── README.md # This file
Main page with upload interface
Upload a file to Unity Catalog volume
- Body: multipart/form-data with 'file' field
- Response: JSON with success status and file details
List all uploaded files
- Response: JSON array of file objects with name, size, and modified date
Health check endpoint
- Response: JSON with app status and volume accessibility
FLASK_SECRET_KEY: Secret key for Flask sessions (default: 'dev-secret-key-change-in-production')
- File types are validated against an allowlist
- Filenames are sanitized using
secure_filename() - Duplicate filenames are automatically renamed with timestamps
- Maximum file size is enforced (16 MB)
If you encounter permission errors accessing the Unity Catalog volume:
- Verify the volume exists:
SHOW VOLUMES IN users.jason_taylor;- Check volume permissions:
SHOW GRANTS ON VOLUME users.jason_taylor.agent_app_uploads;- Grant necessary permissions if needed:
GRANT WRITE FILES ON VOLUME users.jason_taylor.agent_app_uploads TO `<principal>`;- Ensure file size is under 16 MB
- Verify file type is in the allowed extensions list
- Check that the Unity Catalog volume path is accessible
MIT License