Skip to content

Add workspace maintenance and cleanup blog - #97

Open
Amitkpdatabricks wants to merge 2 commits into
databricks-solutions:mainfrom
Amitkpdatabricks:feature/workspace-cleanup-sanitize
Open

Add workspace maintenance and cleanup blog#97
Amitkpdatabricks wants to merge 2 commits into
databricks-solutions:mainfrom
Amitkpdatabricks:feature/workspace-cleanup-sanitize

Conversation

@Amitkpdatabricks

Copy link
Copy Markdown

What

Adds the Databricks Workspace Cleanup blog: an automated workspace-maintenance
solution using Databricks Asset Bundles that cleans up unused jobs, dashboards,
vector search indexes, and clusters, with full audit logging and a Lakeview
dashboard.

Contents:

  • README.md (blog write-up)
  • databricks.yml (DAB bundle + cleanup workflow)
  • notebooks/00-05 (API-driven + system-table-driven cleanup, structured logging)
  • config/ (toggles + retention thresholds)
  • dashboards/cleanup_dashboard.sql

Two approaches

  1. API-driven cleanup: remove unused resources by metadata (last run, status, source-table existence)
  2. System-table-driven cleanup: use system.billing.usage, system.compute.clusters, system.lakeflow.job_run_timeline, system.query.history to find resources costing money but delivering no value

Every action (deleted / skipped / flagged) is logged to a Delta table for auditability.

Notes

  • Sanitized for publishing: workspace host is a placeholder, no secrets, emails, personal names, or real hostnames.

This pull request and its description were written by Isaac.

DAB-based workspace cleanup automation with two approaches:
1. API-driven cleanup (jobs, dashboards, vector search indexes)
2. System table-driven cleanup (billing, compute, query history)

Includes structured logging to Delta table, Lakeview dashboard
queries, per-environment config (dev/stage/prod), and dry-run mode.

Blog: https://community.databricks.com/t5/technical-blog/databricks-maintenance-and-cleanup-visualise-clean-and-log-with/ba-p/135657

Co-authored-by: Isaac
- databricks.yml: replace real workspace host with a placeholder
- 00_cleanup_logger: default catalog maintenance->finops; drop CREATE CATALOG
- 04_system_table_analysis: qualify warehouse_id as compute.warehouse_id in
  system.query.history to fix the aggregation

No secrets, emails, personal names, or real hostnames remain in the project.

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant