Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello
Is there any way to get the workspace id, and lakehouse/warehouse id in the sql endpoint?
Like some stores procedure or something is there?
Thanks
Solved! Go to Solution.
Hi @YashRaj5,
There is no direct built-in SQL function in Microsoft Fabric that lets you query the workspace ID or the Lakehouse/Warehouse ID directly from the SQL endpoint.
Regards,
Vinay Pabbu
Hi @YashRaj5,
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?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Vinay Pabbu
Hi @YashRaj5 ,
As far as I have seen, I haven't found a way to query the Id of the object from the SQL endpoint.
There are other options, such as notebooks, that you can use to get the Id of the lakehouse/warehouse object. Is there a specific reason you are looking to get the ID from the SQL endpoint?
Yea there is notebook, but I was hoping to find a way to build the abfss path for each table present in the warehouse dynamically, and as the path is consist of workspace id and lakehouse id, that's where I needed some Way to make it dynamic.
If you're looking to access the abfss path with SQL, one option you'd have is to capture the workspace and lakehouse/warehouse IDs within the processes that load data into the warehouse or lakehouse. You could then store the IDs as columns within the tables themselves. It may not be the most dynamic approach, but it would give you the access to those values within SQL.
If that is not viable for your use case, you'll likely have to pursue a Python/PySpark approach. Then you can use a library like notebookutils, sempy, or semantic-link-labs to dynamically build the abfss path.
If you need an example of what that looks like, check out a recent YouTube video I created: https://youtu.be/C1dv24AnMSM
If you find this helpful, be sure to accept your answer so others in the community can learn from your question!
Hi @YashRaj5,
There is no direct built-in SQL function in Microsoft Fabric that lets you query the workspace ID or the Lakehouse/Warehouse ID directly from the SQL endpoint.
Regards,
Vinay Pabbu
Seems like that, thanks for the input