Forum Discussion
Lakehouse Connection issue using SQL Endpoint
- 1 year ago
Hi v-nmadadi-msft , We found the solution for the issue. For lakehouse, the connection gets rerouted to some different URL. Initially we were tokenizing it and trying to connect to it, but the trick is you need to perform socket , prelogin on the original end point and "send the redirected URL to the login stage" while using the TDS protocol. PFB sample :
original Sql end point : nkttul5irfuejgeufneefoktjm-obtyxdfizvlura7ao2yincxurq.datawarehouse.fabric.microsoft.comRedircted URL : pbipneu9-northeurope.pbidedicated.windows.net\ABCDUL5IRFUEJGEUFNEEFOKTJM-CCSJOZJPH6FE5GFNZMCN4ILWLA-dw:1433
Existing code logic trying to connect : pbipneu9-northeurope.pbidedicated.windows.net
Hi Pratik_0527 ,
Thanks for reaching out to the Microsoft fabric community forum.
Check these troubleshooting steps:
-> Please ensure that the caller has contributor or higher workspace role.
-> The required delegated scope to call lakehouse are Lakehouse.ReadWrite.All or item.ReadWrite.All, ensure these are in place.
-> Since you're calling from a C++ app make sure you're using the correct token endpoint.
For Ex if it is to get lakehouse it should be something like this
GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/lakehouses/{lakehouseId}
If this post helps, then please consider Accepting as solution to help the other members find it more quickly and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
Hi v-nmadadi-msft We have verified the enpoint that we are using with the help of Native driver by microsoft and the SSMS tool. Both are able to connect to the Lakehouse.
Also we are not using CURL as the "GET" request suggested by you shows something like CURL API.
Let us know if Lakehouse connectivity requires CURL API calls?
- v-nmadadi-msft1 year agoCommunity Support
Hi Pratik_0527 ,
If you are trying to connect to SQL endpoint using a C++ app,
you have to use REST API and the supported features for it areItems - REST API (SQLEndpoint) | Microsoft Learn
whereas for lakehouse these are the supported features
Items - REST API (Lakehouse) | Microsoft Learn
If this post helps, then please consider Accepting as solution to help the other members find it more quickly and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you- Pratik_05271 year agoHelper I
Hi,
Thanks for the revert, Let us take a look at this REST API usage and feasibility in our code setup. We will surely try it and update with our findings.
- v-nmadadi-msft1 year agoCommunity Support
Hi Pratik_0527
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If our responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.