DNC DE NORONHA CONSULTING

Blog / Data Management · · 10 min

A data warehouse on OneLake, without a single name in it

How I set up a data warehouse in Microsoft Fabric next to a production database in two days: pipeline as code, no personal data in any layer, reports that move over one by one, and a Claude connector for colleagues.

A database with a struck-out row, through a filter into three stacked layers (STG, DOMAIN, RPT) that lead to a chart and a chat window

In my previous piece I described how I build Power BI reports as code, without Power BI Desktop. Those reports read straight from the production database, through views that return exactly what a report shows. That worked, but it chafed in three places. This week I put a data warehouse next to it for the same client, in Microsoft Fabric, on the same capacity. Below is how and why, and what Fabric doesn’t tell you along the way.

Why not just stay on production

That last point was the real trigger, and it also set the main design rule: no personal data, in any layer. Not in the end product, and not in the raw copy either.

Warehouse or lakehouse

Fabric offers two flavours. A lakehouse is Spark and notebooks; a warehouse is T-SQL with tables, views and stored procedures. The team knows SQL, the source is SQL, the reports read SQL views. A warehouse was the easy choice.

What sets the warehouse apart from a classic SQL Server: all tables live in OneLake as Delta Parquet. That’s an open format. Power BI can read it with Direct Lake without a copy, and a Spark notebook can read the same tables later without an export. You build in T-SQL, but you’re not locked into T-SQL. (Fabric Data Warehouse)

And it cost nothing extra. The warehouse runs in its own workspace on the F2 that was already there for the reports.

The layout

Production database (Azure SQL)
  │  nightly copy: only the columns needed,
  │  large tables incremental, never PII
  ▼
stg.*          narrow copy per source table
  │  T-SQL procedures (etl.*)
  ▼
shared.*  account.*  portfolio.*  ...   one schema per domain
  │                                      dimensions, facts, snapshots
  ▼
rpt.*          one view per report  ──▶  Power BI
domain schemas (read only)          ──▶  Claude connector

A few choices that make the difference:

Privacy lives in the source, not in the report

The usual approach is to copy everything and hide it in the reporting layer. Then the names and addresses are still in your warehouse, in every backup, and visible to anyone with read access to stg. I turned it around.

  1. The warehouse has its own identity. The pipeline runs under Fabric’s workspace identity, not under my account. No password, no secret that expires, and it doesn’t stop when I leave.
  2. That identity may only read specific columns on production. A script generates the per-column GRANT SELECT from the same copy list the pipeline uses. A column that isn’t on the list can’t even be requested by the pipeline. The database enforces the privacy rule, not my discipline.
  3. Where a value sits next to PII, production masks it first. A few fields are needed but live in a record with personal data, such as a contract stored as JSON. Production gets a view for that which extracts or masks the fields needed. Only that view crosses the line. Client names arrive partly masked (the first four characters and ****), so a colleague recognises an account without the name being in the warehouse.
  4. Free text stays out. Remarks and notes can contain anything. While moving a report over, one view turned out to have a column with analysis notes. That column was dropped rather than copied.

In the warehouse, a client is a number. That’s enough to count, group and follow over time. Anyone who wants to know who it is looks in the application, with the permissions that apply there.

The pipeline is code

The nightly copy is one Fabric pipeline using a standard pattern Microsoft calls metadata-driven ingestion: a Lookup reads the copy list, a ForEach loops over it, and per table an If condition picks a full or an incremental copy. (Incremental copy)

The run starts every night at 00:15. That’s the quietest hour on production, before the other night jobs. The first full copy took 53 minutes; the domains then load in five.

What Fabric Warehouse doesn’t tell you

Fabric Warehouse speaks T-SQL, but it isn’t SQL Server. These are the things I ran into, all documented on Microsoft Learn:

I had that list researched and checked against Microsoft Learn before a single table existed. That saved throwing away a warehouse over the collation.

Reports move over one by one

A big bang would break every report at once. So each report gets a view in the rpt schema of the warehouse, with the same name and columns as the production view it replaces. Then:

  1. Compare the two views row by row. The first report returned 2,348 rows, identical on both sides.
  2. Switch the model to import from the warehouse, through one shared connection with a service principal that may only read rpt.
  3. Put a badge in the report header that says when the warehouse was loaded, not when the model was refreshed. A user should see that it’s last night’s state.

Because the generator from my previous piece writes the model, the switch is one line: SOURCE = 'dwh'. The report itself doesn’t change. The first two reports moved over today. Reports that genuinely show client details stay on production; they don’t belong in a warehouse without names.

The connector: asking questions without SQL

The finishing piece is a small MCP server: a Claude connector colleagues can add in Claude Team. Questions like “what’s the oldest position”, “who trades most on the platform” or “how much is at location X” get answered by Claude writing its own query against the warehouse.

Because there’s no personal data in the warehouse, none can leak through the connector either. That’s the reason to solve privacy at the source: everything that comes after doesn’t have to solve it again.

What I’d do differently, and what not

The warehouse, the pipeline and the connector were up in two days, with Claude Code as my build partner and Microsoft Learn as referee. The long line of reports still to come is now routine: a view, a comparison, one line in the generator.

#fabric ·#onelake ·#data-warehouse ·#privacy ·#mcp ·#claude ·#how-to

← All posts