Refresh Fabric semantic model partitions without SSMS
Most models use incremental refresh. Once in a while someone needs to reload history. I built a Fabric notebook tool so support teams do not need SSMS on a PC to do it.
Most semantic models I work with use incremental refresh, and that is the right design. The scheduled refresh touches only the recent partitions and everything else stays put.
Then, once in a while, someone needs to reload history. A source system was corrected. A business rule changed. One table has to be rebuilt, or just three specific partitions of one fact table.
In practice this lands on the support team, and the usual tool is SSMS. You connect over the XMLA endpoint from a PC, find the table, right-click Process, pick partitions and hope you chose the right ones. It works, but it is cumbersome, it needs a desktop install and a VPN or VDI session, and there is no record of what was run.
I wanted something that lives where the team already works: a Fabric notebook.
What I built
fabric-partition-refresh is a small Python package for Fabric notebooks. You open a notebook, call one function and get a point-and-click panel.
- Pick a table and see its partitions, with row counts and last refresh time.
- Select partitions one by one, by name match, or by a from/to range.
- Preview first. Every run is a dry run by default, and a real refresh needs an explicit confirmation.
- Run the refresh and get a before/after table with refreshed time and row-count change for every partition.
from fabric_partition_refresh import launch_refresh_ui
panel = launch_refresh_ui("My Workspace", "My Semantic Model")
For automation there is also a plain Python API, so the same logic can run from a pipeline.
Two refresh paths, chosen for you
Fabric gives you two ways to refresh a specific partition, and each has a catch.
- Enhanced refresh (REST API) is asynchronous, reports progress and appears in refresh history. But it refuses partition-level requests on tables that have an incremental refresh policy, which are exactly the tables you usually want.
- TMSL over the XMLA endpoint works on those tables. It is synchronous, and it only shows up in refresh history after it finishes.
The default auto strategy tries Enhanced refresh first and falls back to TMSL when it hits the policy error. You can also force either one.
Safety, because this touches production data
- Dry run is the default.
- An empty partition selection is refused, not treated as "everything".
- Large selections can be split into batches. If one fails, the remaining batches are marked as skipped.
- A guard checks refresh history for a run already in progress.
Things I learned the hard way
- A TMSL refresh gives no progress feedback. The panel shows a heartbeat so the person running it knows the cell is alive, but not how far along it is.
- An in-progress XMLA refresh is invisible to the running-refresh guard, because it only appears in history once complete.
- On a table with a refresh policy, the fallback leaves one failed entry in refresh history from the first Enhanced attempt. On those tables, set
strategy="tmsl"to avoid the noise. - TMSL objects in one command run in parallel unless wrapped in a sequence. Controlling that is on the roadmap.
Requirements
The person running it needs write permission on the semantic model, the XMLA endpoint set to read-write for the capacity, and the relevant tenant setting enabled. The README has the details.
Design choices
I wanted it to be maintainable like real software, not a pile of notebook cells. All Fabric access sits behind a small interface, so the logic is tested against a fake backend. There are 66 unit tests, CI on Python 3.10 to 3.12, linting and strict type checking. That makes it safe for others to change.
What is next
- Multiple tables in one request.
- Sequenced TMSL for controlled parallelism.
- An audit log written to a Lakehouse table.
- Parameterised runs from pipelines.
Try it
Download the wheel from the v0.1.0 release, upload it to a Lakehouse and install it in your notebook:
%pip install /lakehouse/default/Files/<wheel-file>
The code is in the GitHub repo. Issues, ideas and pull requests are welcome. If a refresh behaves differently from what I described, I would especially like to hear about it.
New posts also go to the newsletter.