Forum Discussion
Unable to read SQL Endpoint view into a Notebook dataframe
- 2 years ago
Hi Anonymous no I don't believe this will work as the View has been created using the SQL Analytics endpoint, there is no metadata sync from the SQL Endpoint to the Lakehouse (it's the other way round).
You could use JDBC connector in the Notebook to query the View in the SQL Endpoint, or create the View in the Lakehouse using Spark.
edit: I believe pyodbc would work here
Hi Anonymous no I don't believe this will work as the View has been created using the SQL Analytics endpoint, there is no metadata sync from the SQL Endpoint to the Lakehouse (it's the other way round).
You could use JDBC connector in the Notebook to query the View in the SQL Endpoint, or create the View in the Lakehouse using Spark.
edit: I believe pyodbc would work here
- SorenSparso2 years agoAdvocate I
Hi,
Do you know how to get the authentication to work in the SQL endpoint? I have tried different combinations of below statement, but it is not working:
df = spark.read\.format("jdbc") \.option("url", f"jdbc:sqlserver://***.datawarehouse.pbidedicated.windows.net:1433;database=***") \.option("dbtable", "someTable") \.option("authentication", "ActiveDirectoryIntegrated") \.option("encrypt", "true") \.option("clientid", "***") \.option("hostNameInCertificate", "*.pbidedicated.windows.net") \.load()display(df)Thanks 🙂- AndyDDC2 years agoMost Valuable Professional
Does this help at all? https://community.fabric.microsoft.com/t5/General-Discussion/authenticate-to-Fabric-Data-Warehouse-with-Service-Principal/td-p/3467512
- SorenSparso2 years agoAdvocate I
Hi,
Yes, that helped, thanks 🙂
I had to add the serviceprincipal to the workspace (CREATE USER is not a supported statement type.) but after that, I can now read views in a Lakehouse from a Notebook.
- PunChili2 years agoAdvocate II
Hi,
I can read data by using pyodbc package from endpoint. Now I would like to store these results in a delta table in lakehouse... is this possible?
Thank you 😄