Short answer: a Direct Lake on OneLake model reads its tables through one shared expression, AzureStorage.DataLake("https://onelake.dfs.fabric.microsoft.com/<workspace-id>/<lakehouse-id>", ...). Deployment pipelines offer no data source rule for it, so the IDs travel unchanged from stage to stage. The fix, in preview since the November 2026 update: replace the IDs with text M parameters (WorkspaceId, LakehouseId) in TMDL view, then add a parameter rule for each in the test and production stages. After the next deploy, each stage's model reads its own lakehouse. Refresh and check the lineage after the first deploy.
Picture the usual setup: a development workspace with a small lakehouse of sample data, a test workspace with a copy of last month, and production with everything. The semantic model is built once in development and deployed forward. Without parameters, the production model would read the development lakehouse after deployment, and nobody notices until a manager asks why the numbers stopped in March.
Why is there no data source rule?
Data source rules in deployment pipelines work for a fixed list of sources (SQL Server, Azure SQL, SharePoint, OData and a few more), and only between sources of the same type. A Direct Lake on OneLake model points straight at a OneLake storage path, which is not on that list. For everything else, Microsoft's guidance is the same: use parameters. Direct Lake on SQL models are different again, because their expression points at the SQL analytics endpoint.
What does the TMDL look like?
In web modelling, open TMDL view, find the shared expression that holds the AzureStorage.DataLake connection, and change it to use two parameters. Keep the expression's existing name (here DirectLake - Sales) so the partitions still find it:
createOrReplace
expression 'DirectLake - Sales' =
let
Source = AzureStorage.DataLake("https://onelake.dfs.fabric.microsoft.com/" & WorkspaceId & "/" & LakehouseId, [HierarchicalNavigation = true])
in
Source
expression WorkspaceId = "<dev-workspace-id>" meta [IsParameterQuery = true, IsParameterQueryRequired = true, Type = "Text"]
expression LakehouseId = "<dev-lakehouse-id>" meta [IsParameterQuery = true, IsParameterQueryRequired = true, Type = "Text"]Four rules for this script:
- The parameters must be of type Text, or parameter rules cannot rebind them.
- Use the IDs, not full URLs. For a warehouse, name the parameter
WarehouseIdand use the warehouse ID, never the SQL analytics endpoint's ID. - Every
expressionsits at the same indentation level. - Keep any other connection options and annotations on the expression as they were.
If you prefer one value per stage, a single OneLakeSourceUrl parameter holding the whole URL works too, with AzureStorage.DataLake(OneLakeSourceUrl, [HierarchicalNavigation = true]) and one rule instead of two.
Which rule goes in which stage?
Rules are set in the target stage, never in development. With three stages:
| Stage | WorkspaceId | LakehouseId | Where the value comes from |
|---|---|---|---|
| Development | dev workspace ID | dev lakehouse ID | the TMDL itself; no rules allowed here |
| Test | test workspace ID | test lakehouse ID | parameter rules in the Test stage |
| Production | prod workspace ID | prod lakehouse ID | parameter rules in the Production stage |
- 1Write parametersTMDL view in development: WorkspaceId, LakehouseId as Text
- 2Deploy oncethe model must exist in the target stage before you can add rules
- 3Add rulesDeployment rules, the model, Parameter rules: set both IDs for that stage
- 4Deploy againrules only apply on a deployment from the stage before
- 5Refresh and checkrefresh, open lineage, confirm the model reads that stage's lakehouse
The same parameters can serve several connections: if a model reads a lakehouse and a warehouse in the same workspace, both expressions share WorkspaceId and each gets its own item ID parameter.
Where do you find the IDs?
Open the workspace or the lakehouse in the browser. The address shows /groups/<workspace-id>/ and, for a lakehouse, /lakehouses/<lakehouse-id>. Copy the GUIDs only. For a warehouse, take the ID from the warehouse item's own address, not from its SQL analytics endpoint.
What goes wrong?
- The production model still reads development. The rules were added but nothing was deployed since. Deploy from test to production once more.
- Rules you cannot add. You are not the owner of the semantic model in that stage; only the item owner can create rules. Rules also cannot exist in the development stage.
- "Table not found" after deploying. The target lakehouse lacks a table or column the model uses. Parameters change where the model looks, not what is there.
- Access denied in test. The target model's identity or connection has no access to the test lakehouse. Parameters do not grant access.
- Rules gone after reassigning a workspace. Unassigning and reassigning a workspace to the pipeline deletes its rules; set them up again.
- A composite model. Its text parameters can be made in Power Query, but the Direct Lake expression itself is only editable in TMDL view.
- Preview. The parameter support is in preview; test the whole path once in a copy before relying on it for a release.
Where can you check this?
- Microsoft Learn: Develop Direct Lake semantic models (Use M parameters with deployment pipelines)
- Microsoft Learn: Create deployment rules
- Microsoft Learn: What's new in Power BI, November 2026
Where do you start?
Open your Direct Lake on OneLake model in TMDL view and check whether the connection holds hard-coded IDs. If it does, add the two parameters in development, deploy once, set the rules in test and production, and deploy again. Direct Lake in Power BI covers how the storage mode works, and version control with PBIP keeps the TMDL change in source control.