All features

LakeDash / How it works

How each feature works.

The mechanism, the configuration and the limits behind every card on the features page. Field names, files and commands come from the LakeDash repository; each section links to the decision record that explains why it works that way.

Build

Built in

One app, many dashboards

One FastAPI process per environment, running as a Databricks App, serves every dashboard folder it finds.

How it works

At start-up the app reads every dashboard.yml and SQL file under src/dashboards/ from disk and validates them. Each valid folder becomes /d/<slug>, listed in a left navigation grouped by section (with optional sub-menus) and on a home page of tiles. People only see the dashboards they may open. A folder that fails validation is left out of the navigation and reported by the health endpoint; the other dashboards keep working. There is no database: query results live in an in-memory cache.

Viewerbrowser, signed in with workspace SSO
LakeDash appone per environment · checks groups · serves /d/<slug>
viewer token
SQL warehousedataset queries, with UC grants, filters and masks
viewer token
Genie spaceAsk Genie questions
app identity
App-identity workfreshness metadata, auth: app datasets, warming
One request path for every dashboard. Calls run with the viewer’s own token, except the app-identity work in the last row.
/                         home: dashboards you may open, by section
/d/<slug>                 shell (navigation, title bar) + the dashboard's index.html
/api/d/<slug>/data/<id>   runs one dataset, returns JSON rows (cached)
/api/d/<slug>/sources     when each dataset's source tables last changed
/api/d/<slug>/genie/...   Ask Genie
/api/health               live, broken and hidden dashboards

Set it up

Scaffold a folder, then fill in the manifest, SQL and page. Nothing outside the folder changes.

python scripts/new_dashboard.py my-dashboard "My dashboard" --owner Finance --section Finance

src/dashboards/my-dashboard/
  dashboard.yml    title, owner, section, groups, params, datasets
  index.html       the page: HTML, CSS and JavaScript in one file
  sql/<id>.sql     one read-only query per dataset
  README.md        what it replaces and how its numbers were checked

Limits

  • One app is a shared blast radius. A bad change to the shell, src/portal/ or the pipeline affects every dashboard, and all dashboards share the app’s compute.
  • The pipeline checks fail the whole deploy, so one broken dashboard blocks every dashboard’s release.
  • Pages are code. There is no drag-and-drop editor.

Build

In progress

Build with any coding agent

One workflow and one API contract, shared by every agent, so the data team reviews the same kind of folder whoever wrote it.

How it works

AGENTS.md holds the repository rules and points every agent at two documents: docs/DASHBOARD_WORKFLOW.md (the steps) and docs/AUTHORING.md (the hosting contract and the dash and kit APIs). Claude Code’s CLAUDE.md and its new-dashboard skill link to the same files; Codex reads AGENTS.md directly; other tools can be asked to read it. Agent-specific entry points stay thin so the instructions don’t drift apart.

Business authors can explore approved data and clarify metric definitions through Databricks Genie One MCP while they build, then hand over a branch or the folder. Serving a dashboard doesn’t need the agent or model that wrote it.

One rule matters most: keep the SQL, not the question. Every hosted number comes from a SQL file in the folder, and a page never asks Genie for its numbers. If a prototype used Genie, keep the SQL from Genie’s “Show code”. docs/BUSINESS_AUTHORS.md walks business authors through the repository route step by step, from branch to pull request.

Set it up

Open the repository in your coding tool and brief it. This prompt comes from the project README:

Read AGENTS.md and follow docs/DASHBOARD_WORKFLOW.md to build a LakeDash dashboard.
Use docs/AUTHORING.md for the APIs and City Trips as the example.
The dashboard should answer [question] for [audience], using [approved data].
The owning team is [team], the section is [section], and allowed viewers are [groups].
Use connected Databricks Genie One MCP tools, if available, to clarify sources and metric definitions.
Return the dashboard folder, validation results and anything still unverified.

Then prove it before calling it done:

python scripts/check.py --static
python -m pytest -q

Limits

  • A common contract, not proof that every agent produces equivalent dashboards. Review the code and the numbers.
  • Previews built in other tools must be adapted to dash and kit; there is no React/JSX build or agent-provided API in the hosted page.
  • No upload-and-publish UI. Handed-over folders go through the normal review and release process.
  • Genie One MCP is for authoring. It is separate from the in-app Ask Genie bar.

Build

Built in

A shared page kit and theme

Two browser libraries, dash for data and kit for building blocks, keep each page to a few hundred lines.

How it works

dash.data('id') fetches a dataset the first time it is asked for and returns {status, data, message, refreshing, cut, fetchedAt}. dash.onData(fn) redraws the page whenever anything changes. dash.setParams() reloads only the datasets whose SQL uses the changed parameter; every other filter runs in the browser and costs nothing.

kit provides formatting in the portal’s locale, a filter bar, KPI tiles, a sortable table with CSV download, Excel export, ranked bars, lines over time and a point map on OpenStreetMap with numbered pins and routes (Leaflet). d3 v7 is available for custom charts. Every colour is a CSS variable in one block at the top of src/static/shell.css, with a dark-mode block under it.

Set it up

<div class="kit-page">
  <h1>Revenue by month</h1>
  <div class="kit-card" id="chart"></div>
</div>
<script>
dash.onData(() => {
  const d = dash.data('revenue');
  if (!kit.ready('#chart', d)) return;
  kit.line('#chart', { rows: d.data, x: 'month',
    series: [{ key: 'revenue', label: 'Revenue' }], fmt: kit.fmt.compact });
});
</script>

Rebrand in src/environments.yml:

brand:
  name: LakeDash
  logo: /static/brand/logo.svg
locale: en-US          # how kit.fmt writes numbers and dates

Limits

  • Every value reaches the page as a string or null; pages convert with kit.num.
  • Rows are capped at 500,000 by default. Aim for under 100,000 and aggregate in SQL.
  • Extra libraries must be bundled in src/static/vendor and listed under libs: by whoever runs the portal.

Build

Built in

Host Claude dashboards as they are

The artifact’s page runs unchanged inside the portal shell. The data team replaces its data with reviewed SQL.

How it works

A dashboard with page: artifact sends its index.html byte for byte inside an inert <template>, so nothing runs early. static/artifact.js mounts it, points bare file names at the dashboard’s assets/ folder and runs each script in page order inside its own function scope. dash.js adds the artifact runtime (draw, loader, calc), and the theme supplies the design tokens artifacts expect. Because there is no iframe, the page keeps the portal’s theme, dark mode, freshness label, Refresh, Ask Genie and security policy.

Imports land as status: draft, visible only to drafts_groups and the dashboard’s own groups. A dataset without SQL yet is todo: true: never queried, warmed or looked up. A local run with PORTAL_PREVIEW_SNAPSHOTS=1 serves its gitignored snapshot rows instead.

Claude artifacta business user shares the link
import_artifact.pypage unchanged · status: draft · todo datasets · gitignored snapshots
Data team writes SQLone reviewed query per dataset, todo removed
compare_snapshot.pyresults reconciled against the artifact’s own data
Review, then liveapprove.py records the page and shared SQL · draft status dropped · snapshots deleted
From a shared link to a hosted dashboard. The page’s code is never rewritten; its data is.

Set it up

In Claude Code, the import-claude-dashboard skill runs these:

python scripts/import_artifact.py --bundle <dir> --slug <slug> --blobs <dir>
python scripts/compare_snapshot.py --slug <slug> --dataset <id> \
  --profile <profile> --warehouse <id>
page: artifact
status: draft
datasets:
  sales:
    sql: sql/sales.sql           # stub listing the tables and columns the page reads
    todo: true                   # not connected yet; the live check fails until it is
    snapshot: snapshots/sales.json   # gitignored; used to reconcile and preview

Limits

  • Not supported from the artifact runtime: its Sources panel, connectors and live calls from the page, comments and per-viewer stored state.
  • A loader gets rows, not a source’s raw text or JSON, so text-parsing loaders need rewriting.
  • Scripts run wrapped in a function, so a top-level return or document.currentScript behaves differently.
  • Drafts are hidden, not secret: anyone with repository access can read them.

Build

Built in

Power BI migration helpers

Decide what to move, map what a report does, rebuild it and prove the numbers match.

How it works

scripts/powerbi_usage.py reads report views from the Power BI admin activity log (kept for about 28 days) and writes three files to a gitignored usage/ folder: views and users per report, per person, and every view. That decides what to migrate, merge or retire, and gives you the comms list.

scripts/pbip_summary.py reads a Power BI Project (PBIP) without changing it and lists sources, DAX measures, relationships, row-level security roles, pages, visuals and slicers. It flags DAX that needs care: time intelligence, filter context and measures that don’t add up. The migrate-power-bi skill turns that into a dashboard folder; other tools can follow the same file.

Set it up

az login
python scripts/powerbi_usage.py --days 28
python scripts/pbip_summary.py <path to .pbip or folder>   # --json for JSON

Name the report being replaced in dashboard.yml, then record two or three reconciled periods in the dashboard’s README.md: period, filters, Power BI value, dashboard value, and the reason for any difference.

replaces: "Power BI: Taxi Trips (Operations workspace)"

Limits

  • Not an automatic converter. Each measure is rewritten as SQL at the grain the page needs and reconciled.
  • Row-level security roles become Unity Catalog row filters or group settings, not page logic.
  • Metric views and curated Genie Agents in the migration pattern are reviewed and provisioned separately.
  • Paginated reports, emailed subscriptions and data alerts have no equivalent yet.

Build

Built in

Phone and keyboard ready

The shell adapts to small screens, and the authoring contract requires each page to do the same.

How it works

The left navigation collapses with the ☰ button, remembered per browser, and becomes a slide-over on narrow screens. At a 390 × 844 viewport the City Trips sample wraps its KPI tiles into two columns and stacks charts below the filters. The page rules in AUTHORING.md say every dashboard must work at phone width and with the keyboard. The Travel Operations sample shows keyboard navigation, light and dark themes and a TV view.

Set it up

Use the kit’s layout classes (kit-page, kit-grid, kit-card) and components, prefix your own classes, handle loading, error and empty states, and test the page at phone width before review.

Limits

  • This is a responsive browser layout, not a native mobile app.
  • Databricks documents access to Apps through its Genie mobile app; testing LakeDash inside it is separate.

Build

Built in

Seven sample dashboards

Each reads only the built-in samples catalog, so LakeDash runs in most Unity Catalog workspaces on day one.

How it works

SampleReadsShows
City Tripssamples.nyctaxiThe January 2016 blizzard against a normal day, rush-hour speed, where trips go, airport runs
Bakery Franchisessamples.bakehouseFranchise sales, products and reviews on a map
Travel Operationssamples.wanderbricksOverview, saved destinations, property drill-down, guest experience, TV view
Travel Marketplacesamples.wanderbricksBookings and seasonality across 42 destinations, down to each property
Guest Experiencesamples.wanderbricksReviews and support chats: ratings, topics, agents
Omnichannel Retailsamples.tpcds_sf1Store, catalog and web sales, holiday peak, returns
World Weathersamples.accuweatherObserved weather and a 15-day forecast for 50 cities

City Trips is the flagship and the worked example the authoring guide uses throughout: every headline on it is worked out from the data on screen.

Set it up

pip install -r src/requirements.txt fastapi uvicorn pytest httpx
./scripts/run_local.sh <cli-profile> <warehouse-id>
# Windows: ./scripts/run_local.ps1 -Profile <cli-profile> -Warehouse <warehouse-id>

To hide the samples later, delete their folders or set environments: [dev] in their dashboard.yml.

Limits

  • Example data only. The 2025 Wanderbricks data is partial, and booked value is not recognised revenue.
  • A workspace admin can hide the samples catalog, in which case the samples won’t load.

Govern

Built in

Queries run as the viewer

Data security lives in one place, Unity Catalog, so a page bug can’t show rows a person isn’t allowed to see.

How it works

LakeDash uses Databricks Apps on-behalf-of user authorization. resources/portal.app.yml requests the sql and genie user scopes, and each dataset query runs with the viewer’s own token (x-forwarded-access-token) through the Statement Execution API. Filter values are always bound as named parameters, never formatted into SQL. Grants, row filters and column masks apply, and query history shows the real person.

A dataset can set auth: app. It then runs as the app’s service principal, one result is shared by everyone who can open the dashboard, and it is refreshed in the background. That serves people who have no data access of their own, such as field staff on one operational dashboard.

Set it up

datasets:
  suppliers:
    sql: sql/suppliers.sql
    auth: app        # service principal; one shared result; no SQL parameters
    groups: [field-ops]   # required: the dashboard must list groups: too
# Prints the grants the service principal needs. --apply is for a person to run.
python scripts/grant_app_access.py --env prod --profile <profile> --warehouse <id>

Limits

  • A workspace admin must switch on user authorization for apps.
  • Every viewer needs USE CATALOG, USE SCHEMA and SELECT on what a default dataset reads. Missing grants show as “Couldn’t load this data”.
  • auth: app datasets take no parameters, bypass viewer row-level security and rule out Ask Genie on that dashboard. The checks refuse one unless both the dashboard and the dataset name their groups:.
  • Each environment’s service principal needs its own grants, and a view that is dropped and recreated loses them.

Govern

Built in

Access in four layers

From widest to narrowest. The server checks groups on every page and API call.

How it works

LevelSet inEffect
The portalCAN USE on the app, via viewers_group in databricks.ymlWho can open the portal at all
A dashboardgroups: in dashboard.ymlOnly those groups see it in the navigation and can open it
Part of a dashboardgroups: on one datasetThe server refuses that dataset to everyone else
The dataUnity Catalog grants, row filters, column masksAlways applies, because queries run as the viewer

Drafts add one more rule: a status: draft dashboard opens only for drafts_groups and its own groups. An empty list means nobody, never everyone.

Portal CAN USE via viewers_group

Dashboard groups: in dashboard.yml

Dataset groups: on one dataset · dash.allowed('id')

Unity Cataloggrants, row filters and column masks, applied to every viewer query whatever the layers above allow
Each layer narrows the one around it. Unity Catalog sits under all of them.

Set it up

datasets:
  prices:
    sql: sql/prices.sql
    groups: [pricing-viewers]

// in index.html: hide the section for everyone else
if (!dash.allowed('prices')) { /* don't draw the Prices tab */ }

Limits

  • Portal groups control what a dashboard shows. For data that must be protected everywhere, also restrict it in Unity Catalog.
  • Group names are workspace display names (account groups or groups synced from your identity provider).
  • Each person’s groups are cached for one minute, so a removed membership stops counting within about a minute, plus Databricks propagation time.

Govern

Built in

Safe SQL by construction

The rules are small, written down and checked by machine on every pull request.

How it works

scripts/check.py --static and pytest run on every pull request. They require one SELECT or WITH per file with no DDL or DML, every table written as catalog.schema.table in an allowed catalog, every :name declared under params, every dash.data('id') declared under datasets, no scripts from other sites, section, environment and library names that exist in src/environments.yml, and a recorded review of each page and shared query (see reviewed before it runs). The pull request checks run without workspace credentials. Each deploy also runs every dataset with LIMIT 0 against that environment’s catalogs before anything changes. At run time a query is stopped after 10 minutes and results are capped at 500,000 rows.

Set it up

-- sql/daily.sql: one row per pickup day
SELECT DATE(tpep_pickup_datetime) AS day, COUNT(*) AS trips
FROM samples.nyctaxi.trips
WHERE tpep_pickup_datetime >= :date_from
  AND tpep_pickup_datetime < date_add(:date_to, 1)
GROUP BY 1
# dashboard.yml
params:
  date_from: {type: DATE, default: "2016-01-01"}
  date_to:   {type: DATE, default: "2016-02-29"}

# run every query with LIMIT 0 against dev catalog names
python scripts/check.py --env dev --profile <profile> --warehouse <id>

Limits

  • The checks prove shape and safety, not correct numbers. Reviewers still check cost, grain and reconciliation.
  • Parameters are bound with their type, so a value can’t change the query, but any value of that type is accepted.

Govern

Built in

Pages can’t call out

A restrictive Content-Security-Policy tells the browser to block requests to sites the portal hasn’t listed, so “don’t send data elsewhere” is enforced by the browser as well as by the rule.

How it works

Every response carries a Content-Security-Policy starting with default-src 'self'. The browser loads scripts and data only from the portal, plus the image hosts listed in src/environments.yml (OpenStreetMap tiles by default). The current design self-hosts Inter with the app, so Google Fonts are not required. The static checks also reject <script src="https://…">. kit.h always inserts values as text, never as HTML, and Ask Genie answers are shown as text only.

Set it up

# src/environments.yml
libs:
  leaflet:
    css: [/static/vendor/leaflet/leaflet.css]
    js: [/static/vendor/leaflet/leaflet.js]
image_hosts:
  - https://tile.openstreetmap.org

Limits

  • Every library must be bundled under src/static/vendor and added by whoever runs the portal.
  • The policy limits where pages may load code from and send data to. It is one layer of defence, not a promise: the portal still allows inline scripts and styles, so it does not make script injection impossible.
  • If a network blocks the tile host, map tiles don’t appear; the points still plot.

Serve data

Built inOpt-in

Caching that fits the data

Safe by default, faster where the data allows, and no database to run.

How it works

Results are cached in the app’s memory, keyed on dashboard, dataset, bound parameter values and the viewer (or the app). Each result is reused until its cache_ttl runs out (default one hour). The cache is per viewer by default, because queries run as the viewer.

cache: shared keeps one result for everyone. Before serving it, LakeDash asks the warehouse to analyse the complete bound query as the reader with LIMIT 0, so a reader without source access gets a 403, never rows. Decisions are remembered per viewer, warehouse, SQL text and parameter names and types, not filter values, so choosing a new filter value reuses the check. Allowed decisions last 30 minutes; denials, including “table not found”, last five. warm: pre-loads listed parameter sets as the app at start-up and at the warm times (07:00 and 13:00 on weekdays by default, prod only); warm_at: startup loads once per process for data that never changes. auth: app datasets re-run in the background every cache_ttl minus five minutes.

  1. Is an access decision remembered for this viewer and query?
    Yes: use itNo: analyse the full query as the reader with LIMIT 0
  2. What did the check say?
    Allowed: remember 30 minDenied or not found: 403, remember 5 minOther error: 502, not remembered
  3. Is a shared result cached for these filter values?
    Yes: serve itNo: run the query and keep it for cache_ttl
What happens when someone opens a cache: shared dataset. No shared rows are served until the reader check passes.

Set it up

datasets:
  daily:
    sql: sql/daily.sql
    cache: shared        # only when every permitted viewer sees identical rows
    cache_ttl: 24h       # 15m, 1h, 6h, 24h; default 1h
    warm_at: startup
    warm:
      - {date_from: "2016-01-01", date_to: "2016-02-29"}
# src/environments.yml
warm:
  timezone: UTC          # any IANA zone, e.g. Pacific/Auckland
  times: ["07:00", "13:00"]
  environments: [prod]

Limits

  • The cache lives in memory: a deploy, restart or evening stop empties it, and it isn’t shared between app instances.
  • Per-viewer caching runs the same query once per person per TTL.
  • The reader check proves access, not that rows are identical. Use per-viewer caching wherever row filters or masks can differ.
  • A revoked grant can take up to 30 minutes to apply to shared results, and a new grant up to five minutes after a denial. Use per-viewer caching where access must change sooner.
  • Every cache: shared query needs a recorded data-team review of its SQL (see reviewed before it runs).

Serve data

Built in

Freshness label

Answers the real question before someone presses Refresh: will it show anything new?

How it works

The title bar shows Data as of 10:42 am · 12 min ago, using the oldest fetch time among the loaded datasets so a page never looks fresher than its stalest part. The panel shows, per dataset, when it was fetched, when the cached copy expires, how it is shared, an optional source: note and its source tables.

GET /api/d/<slug>/sources reads Unity Catalog table metadata through the Tables API as the app’s service principal, which needs only BROWSE, so it costs no warehouse time. Views are followed to the tables underneath through a map built at deploy time (scripts/build_sources_map.py). If every source is older than the data on screen, the label adds “source unchanged”; if one is newer, “newer data available”. A changed table says how long after your data it was written, for example “changed 5 min ago (10:42 am), 3 h after your data”, with changed tables listed first. Each table gets a kind (managed, live, external, none, static or unknown) and the label only claims what it knows. data_through adds the latest date actually returned by the query.

Dataset SQLthe tables it names, catalog already swapped
Views followedthrough the deploy-time sources_map.json
Table change timesUC Tables API, as the app, BROWSE only
Comparewith the oldest fetch time on the page
Label adds
source unchangednewer data availabletracked sources unchanged (live tables present)nothing, when any table is unknown
No warehouse query is involved: the check reads metadata only, and says nothing rather than guess.

Set it up

datasets:
  daily:
    sql: sql/daily.sql
    source: "Rebuilt by the nightly trips job at 02:00 UTC"   # at most 200 characters
    data_through: latest_day     # a DATE column in the result

# src/environments.yml: catalogs whose data never changes
static_catalogs: [samples]

Limits

  • “Changed” means the table was written. A rebuild with identical data still counts.
  • Federated and external tables have no reliable change time, so they are reported as live or untracked rather than guessed.
  • SQL that depends on today’s date can return different rows without any table write.
  • Each environment needs the BROWSE grant; without it the panel says the source change time is unavailable.

Serve data

Built in

Selective refresh and query profiling

Refresh stops repeating warehouse work that can’t change the answer.

How it works

Refresh data reads fresh Unity Catalog metadata once for each distinct source of the loaded datasets and compares it with when each query began. Unchanged managed Delta tables and fixed samples revalidate the existing result through the usual access and TTL checks, with a body-free 304 on a matching cache hit. Anything LakeDash can’t verify reruns: views, external and federated tables, missing metadata, time-dependent SQL and datasets marked refresh: always. Refresh all forces every loaded dataset to rerun.

Every warehouse execution writes a dataset_query log event with the dashboard, dataset, Databricks statement ID, elapsed milliseconds and outcome. It omits SQL text, parameter values, rows and viewer identity.

  1. Marked refresh: always, time-dependent SQL, or a view, external or federated input?
    Yes: rerunNo: next check
  2. Is fresh metadata available for every direct source?
    No: rerunYes: next check
  3. Was any source written after this query began?
    Yes: rerunNo: revalidate, 304 if the result is unchanged
What Refresh data decides for each loaded dataset. A missing or expired result always runs. Refresh all skips the checks and reruns everything loaded.

Set it up

datasets:
  scores:
    sql: sql/scores.sql
    refresh: always     # depends on something besides table writes, e.g. a custom function

// from a page
dash.refreshChanged();  // selective
dash.refreshAll();      // force every loaded dataset

To profile, search the app logs for dataset_query, find the statement ID in Query History and open its Query Profile.

Limits

  • Metadata is a point-in-time check; it can’t prove a view’s definition or hidden inputs are unchanged, so views always rerun.
  • No incremental edits to cached rows: a changed input reruns the whole dataset query.
  • Refreshing a shared dataset replaces the result for everyone.
  • Refresh all does nothing while any query on the page is still running, and says so, so it never skips or duplicates a query.

Serve data

Opt-in

Ask Genie

Plain-English questions answered by a curated Genie space, with the viewer’s access and the page’s filters.

How it works

A genie: block names a Genie space per environment. The portal’s backend calls the Genie Conversation API with the viewer’s token (the app’s genie user scope), never as the service principal, and refuses the bar on dashboards with auth: app data. Because the API has no context field, the server builds a short, capped plain-text preamble: the dashboard title, its about text, its SQL parameters and the current view from dash.genieContext(). It goes with the first question and again when the view changes. The page polls for the answer, then shows the text, up to 200 result rows and the SQL. Usage events record the dashboard and person, never the question.

Viewer asksa question in the bar
Portal adds contexttitle, about, SQL parameters and the filters on screen
viewer token
Genie Conversation APIthe curated space for this environment
Page pollsfrom 1.5 s, backing off to 5 s, up to 5 min
Answertext, up to 200 rows and the SQL
Genie never runs as the app, so Unity Catalog row filters apply to its answers too.

Set it up

genie:
  space_id: {prod: "0123456789abcdef0123456789abcdef"}   # no id = no bar there
  about: One or two sentences telling Genie what this dashboard shows.
  sample_questions: ["Which pickup ZIP codes had the highest average fare?"]

// in index.html, for filters that only run in the browser
dash.genieContext(() => ({ Period: 'January 2016', Borough: state.borough || 'All' }));

Limits

  • Only where a space exists. LakeDash never creates or changes Genie spaces.
  • Viewers need CAN RUN on the space and SELECT on its tables, and consent once to the genie scope.
  • Answers come from the space’s own instructions and SQL, not the dashboard’s files, so they can drift. Check a few against the page first.
  • Questions aren’t cached; each one runs SQL on the space’s warehouse.

Run and deliver

Built in

Dev, test and prod from one branch flow

What was tested is what reaches prod, and the same SQL runs everywhere.

How it works

develop, release and main deploy to dev, test and prod through the example GitHub Actions (.github/workflows/deploy.yml) or Azure DevOps (azure-pipelines.yml) pipelines. SQL is written with prod catalog names; the app works out its environment from the workspace host (or PORTAL_ENV) and swaps catalog names using src/environments.yml. A deployed app whose host matches no environment, or is blank, refuses to start rather than fall back to prod catalogs. One feature branch is opened as a pull request into each branch in turn, never merging develop back into it.

Every pull request runs the static checks and tests with no workspace credentials. A push installs a pinned, checksum-verified Databricks CLI, runs bundle validate, runs every dataset with LIMIT 0, builds the source map, runs databricks bundle deploy and starts the app. If the app already exists but the deploying principal’s bundle state doesn’t know it (created by hand, or deployed by a person), the deploy binds it and deploys again, so it updates the app instead of failing. Deploys to one environment queue one at a time.

Feature branchcut from main
  1. PR 1develop
    devlakedash-dev · e.g. main_dev
    left running (GitHub Actions)
  2. PR 2release
    testlakedash-test · e.g. main_test
    stopped after deploy
  3. PR 3main
    prodlakedash · e.g. main_prod
    evening stop job you create
The same feature branch goes into each branch in turn, so prod gets exactly what test ran. SQL names the prod catalog; the app swaps it per environment.

Set it up

# src/environments.yml: prod SQL reads main_prod; dev and test are swapped
catalogs:
  samples: {}
  main_prod: {dev: main_dev, test: main_test}

# dashboard.yml: keep unfinished work out of prod
environments: [dev, test]

Keep workspace hosts and warehouse ids out of git with two gitignored files, databricks.local.yml and src/environments.local.yml. The GitHub Actions deploy writes both from the GitHub environment just before bundle validate, with the host kept as a secret so it is masked in public logs:

targets:
  dev:
    workspace: {host: https://<your-workspace-host>}
    variables: {warehouse_id: "<warehouse-id>", viewers_group: users}

Limits

  • It needs discipline: one merge of develop into a feature branch carries unreleased work into test and prod.
  • Three pull requests per change means more reviews and pipeline runs.
  • The Azure DevOps example doesn’t write the local override files; it uses committed values or its own variables.
  • A local run with a blank host and no PORTAL_ENV still resolves to prod.

Run and deliver

Built in

Reviewed before it runs

Business authors and coding agents can write dashboards, so the riskiest changes need a recorded review before the app will load them.

How it works

  • Reviewed pages. Each dashboard’s index.html, and every file in an artifact page’s assets/, must match its SHA-256 in src/reviewed_pages.yml. The page’s JavaScript runs inside the portal, next to every other dashboard.
  • Reviewed shared SQL. Each cache: shared query, and so every warmed one, must match its SHA-256 in src/shared_cache.yml. One result goes to every viewer, so a person checks there are no row filters, masks or current_user() behind it.
  • Named audience for app data. An auth: app dataset is refused unless both the dashboard and the dataset list groups:.
  • Credential-free pull request checks. Pipelines keep workspace credentials in deploy stages only, and install a pinned Databricks CLI after checking its SHA-256.

The checks, the tests and the app all refuse an unreviewed dashboard. A local run still shows unreviewed work, with a warning, so authors can preview; a deployed app never does.

Author or agentwrites the dashboard folder
Pull request checksno credentials · refuse an unreviewed page or shared SQL
Data team reviewreads the code, runs approve.py --write
Deploy on mergepinned, checksum-verified CLI · LIMIT 0 · bundle deploy
App loadsonly pages and shared SQL whose digests match
A digest ties each merge to the exact page and SQL a person read. Changing either needs a new review.

Set it up

python scripts/approve.py <slug>            # print the digests
python scripts/approve.py <slug> --write    # record them, in the same pull request

Make the data team required reviewers for src/reviewed_pages.yml, src/shared_cache.yml and src/static/ (CODEOWNERS on GitHub, required reviewers by path on Azure DevOps), so an author can’t approve their own page.

Limits

  • A digest records that a version was approved, not that the review was good. Approved JavaScript still runs in the portal’s origin.
  • The approval files need reviewer rules outside the repository; without them an author could approve their own page.
  • The CLI is pinned, but Python dependencies aren’t locked, and there is no SBOM or vulnerability scan.
  • Changing a sample dashboard now also means updating the approval files.

Run and deliver

Built inYou set it up

Apps that stop when idle

A Databricks App bills while it runs, so test stops after each deploy and prod can stop in the evening. The GitHub Actions example leaves dev running.

How it works

Dev (GitHub Actions): after a develop deploy the pipeline starts lakedash-dev and leaves it running, so the latest deploy can be opened straight away. Its compute bills until someone stops it.

Test (and dev on Azure DevOps): the deploy pipeline starts the app with the new code, then stops it. The stop step always runs (if: always() or condition: always()), retries five times 20 seconds apart, and fails the run if the app still won’t stop. A manual run can choose to keep it running.

Prod: a scheduled Databricks job stops the app in the evening, for example at 18:00 on weekdays, as a principal with CAN_MANAGE on the app. That job is not in the repository; you create it in the prod workspace. Nothing has to start prod again: the first person to open the portal does. See the business-hours cost example for a timed start and stop pattern.

Set it up

databricks -p <profile> apps start lakedash-dev
databricks -p <profile> apps stop lakedash-dev

# inside a scheduled job in the prod workspace
databricks apps stop lakedash        # or the SDK: w.apps.stop("lakedash")

Limits

  • The first person after a stop waits for the app to start and for their queries.
  • Stopping empties the in-memory cache, and warming only runs once the app is up.
  • The evening job lives outside the repository, so it is easy to forget when the app is renamed.
  • With GitHub Actions, dev bills around the clock unless someone stops it.

Run and deliver

Built inOpt-in

Health, deployment review and usage

Separate evidence for whether the app is up, whether the release is clean, and whether people use it.

How it works

/api/health returns the environment, the number of live dashboards, any that failed validation (broken) and any switched off for this environment (hidden). scripts/review_app.py checks health and the security scan for the active deployment, read-only, with an explicit workspace profile. An unavailable or incomplete scan stays unverified, and the script exits nonzero for an unhealthy or unverified deployment, an open critical finding or a tracked rule that is still present. The operator then reviews the app’s Insights metrics in the workspace.

Every page view writes a portal.usage line to the app log. For adoption reporting over months, a Unity Catalog usage table can receive the same events in batches every minute.

Set it up

python scripts/review_app.py --profile <profile> --app <app-name> --env <environment> \
  --deployment <active-deployment-id>

# src/environments.yml: off by default
usage_table:
  prod: main_prod.governance.lakedash_usage

Limits

  • CI runs the static checks and tests; the review needs a deployed app and suitable access.
  • The operator reads system metrics in the workspace UI, and a sparse metrics window can’t establish performance under load.
  • App logs are short-lived, and a failed usage-table write is logged and dropped.