Forum Discussion
Automating Fabric feature workspace setup with OneLake shortcuts
A few weeks ago I ran into an annoying problem with Microsoft Fabric.
Every time I created a new feature workspace and branched it from my main Git branch, all the metadata came across perfectly (Lakehouse, Warehouse, schemas, tables, notebooks, pipelines, etc.), but... no data.
That meant every developer had to manually:
- Create a shortcut to the PROD Warehouse
- Copy some production data
- Delete the shortcut
- Finally start developing
So I automated it.
Now a single notebook:
- Detects the current workspace automatically
- Creates a temporary shortcut from DEV Lakehouse to PROD Warehouse storage
- Discovers all schemas and tables (no hardcoding)
- Reads a configurable number of records from each PROD table
- Copies a configurable number of rows into the DEV Warehouse using Spark + synapsesql()
- Deletes the shortcut when it's done
The important detail is that the DEV workspace already contains the complete metadata structure because it was created from the PROD Git branch. The notebook only seeds the data.
The workflow is now:
Create new workspace
|
v
Create Git branch from main
|
v
Run bootstrap notebook
|
v
DEV workspace ready for developmentHow does it work?
The notebook uses the OneLake DFS endpoint called by the Fabric UI when creating and deleting shortcuts.
The API calls used are:
Create shortcut:
POST https://onelake.dfs.fabric.microsoft.com/v2.0/workspaces/{workspaceId}/artifacts/{lakehouseId}/shortcuts/batchCreateDelete shortcut:
DELETE https://onelake.dfs.fabric.microsoft.com/v2.0/workspaces/{workspaceId}/artifacts/{lakehouseId}/shortcuts/Tables/{shortcutName}The authentication is handled using the Fabric notebook identity:
notebookutils.credentials.getToken( "https://storage.azure.com/" )
The shortcut is only temporary. It is created to expose the PROD Warehouse storage layer, Spark reads the underlying Delta files, the data is written into the DEV Warehouse, and then the shortcut is removed.
And yes, I considered keeping permanent shortcuts, but that does not fit my workflow. I need the freedom to play around with data without depending on PROD. The shortcut is only a temporary bridge to seed DEV data and is removed afterward.
So, the final result:
PROD Warehouse
|
| OneLake DFS shortcut endpoint
v
Temporary shortcut in DEV Lakehouse
|
| Spark reads underlying Delta files
v
Existing DEV Warehouse tables
|
v
Shortcut removed
The notebook does not create new tables. It relies on the metadata already synchronized through Git and only inserts sample data into the matching DEV tables.
A few things to consider:
- The amount of copied data is configurable.
- The user running the notebook needs access to both environments.
- Data governance rules should still be applied because this process moves PROD data into DEV.
The biggest benefit for me is that a new feature workspace can now go from "empty metadata" to "ready for development" with a single notebook execution.
I'm curious how other Fabric teams handle this today. Do you:
- copy data using pipelines?
- create the shortcut manually and keep them permanently?
- use another workspace provisioning approach?
Prince0011
Yeah, definitely. I mentioned PROD as the source, but it could just as easily be DEV, QA, or any other workspace.It really depends on how your team works. In my case, the goal was to automate the whole process of creating a new feature workspace, bringing in a representative dataset from another workspace, and getting everything ready for development with a single notebook.
The notebook simply creates a temporary shortcut, copies a configurable amount of data into the new workspace's warehouse, and then removes the shortcut. So the source environment is completely flexible.
Hi nathaliapuglisi ,
Great solution! Using a temporary OneLake shortcut as a bootstrap mechanism is a clever way to keep the development workspace independent after the initial data seeding.
I've seen a few other approaches that works, depending on their governance and operational requirements:
- Fabric Data Pipelines – Copy a curated subset of data into the DEV workspace. This is a common enterprise approach because it provides monitoring, scheduling, and operational visibility.
- Notebook-based seeding – Similar to your solution, but reading directly from a source Lakehouse or Warehouse and writing into the DEV environment without creating temporary shortcuts.
- Permanent OneLake shortcuts – Some teams keep shortcuts permanently for read-only development or analytics scenarios to avoid duplicating data, although this isn't ideal if developers need complete isolation.
- Sanitized or masked datasets – Instead of copying production data, some organizations maintain a QA or masked dataset as the source for developer workspaces, which helps address governance and compliance requirements.
- Automated workspace provisioning – Combining Git integration with Fabric REST APIs or deployment automation so that workspace creation, permission assignment, metadata deployment, and data seeding all happen as part of a single provisioning workflow.
I like your approach because it cleanly separates metadata deployment (Git) from data provisioning, and the temporary shortcut minimizes long-term dependencies between environments. The only additional consideration I'd suggest is ensuring the source data is appropriately governed or masked if production data is being used.
Thanks for sharing—it's always interesting to see different provisioning patterns emerging as Fabric matures
If this post helps, then please appreciate giving a Kudos or accepting as a Solution to help the other members find it more quickly.
7 Replies
- Prince0011Solution Sage
Really clever solution, temporary shortcut is a smart middle ground between permanent shortcuts and full pipeline copies.
Only thing I'd flag is governance, since this pulls real PROD data into DEV, worth checking if any tables have PII and maybe masking those columns during the Spark step.
I've mostly seen teams use parameterized pipelines instead, less flexible but simpler to maintain. Your approach seems like a nicer balance since DEV stays fully independent afterward.
- nathaliapuglisiNew Member
Prince0011
Yeah, definitely. I mentioned PROD as the source, but it could just as easily be DEV, QA, or any other workspace.It really depends on how your team works. In my case, the goal was to automate the whole process of creating a new feature workspace, bringing in a representative dataset from another workspace, and getting everything ready for development with a single notebook.
The notebook simply creates a temporary shortcut, copies a configurable amount of data into the new workspace's warehouse, and then removes the shortcut. So the source environment is completely flexible.
- ssritharSuper User
Hi nathaliapuglisi ,
Great solution! Using a temporary OneLake shortcut as a bootstrap mechanism is a clever way to keep the development workspace independent after the initial data seeding.
I've seen a few other approaches that works, depending on their governance and operational requirements:
- Fabric Data Pipelines – Copy a curated subset of data into the DEV workspace. This is a common enterprise approach because it provides monitoring, scheduling, and operational visibility.
- Notebook-based seeding – Similar to your solution, but reading directly from a source Lakehouse or Warehouse and writing into the DEV environment without creating temporary shortcuts.
- Permanent OneLake shortcuts – Some teams keep shortcuts permanently for read-only development or analytics scenarios to avoid duplicating data, although this isn't ideal if developers need complete isolation.
- Sanitized or masked datasets – Instead of copying production data, some organizations maintain a QA or masked dataset as the source for developer workspaces, which helps address governance and compliance requirements.
- Automated workspace provisioning – Combining Git integration with Fabric REST APIs or deployment automation so that workspace creation, permission assignment, metadata deployment, and data seeding all happen as part of a single provisioning workflow.
I like your approach because it cleanly separates metadata deployment (Git) from data provisioning, and the temporary shortcut minimizes long-term dependencies between environments. The only additional consideration I'd suggest is ensuring the source data is appropriately governed or masked if production data is being used.
Thanks for sharing—it's always interesting to see different provisioning patterns emerging as Fabric matures
If this post helps, then please appreciate giving a Kudos or accepting as a Solution to help the other members find it more quickly.
- v-kathullacCommunity Support
Thankyou ssrithar , Prince0011 for Addressing the issue.
Hi nathaliapuglisi ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
Thanks,
Chaithanya.
- v-kathullacCommunity Support
Thankyou @ssrithar , @Prince0011 for Addressing the issue.
Hi @nathaliapuglisi ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
Thanks,
Chaithanya.
- lskumardadiNew Member
Hello nathaliapuglisi ,
One quick check,after your feature branch got created based on your main branch via branch out workspace, have you made any PR to your main ?if so have you faced any conflicts in terms of lakehouse as you are trying to merge lakehouse also to your main.- nathaliapuglisiNew MemberAfter finishing my development, yes, I created a PR to main. There were no conflicts because I didn’t change any schema structure, I only inserted data using a temporary shortcut. If I had made changes to schemas, tables, or similar objects, then I would have needed to handle merge conflicts.