March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Anyone had success connecting to SQL endpoint from a notebook using Service Principal?
I get "ActiveDirectoryServicePrincipal" is not valid using JDBC. Tried installing msal4j and mssql conenction jar, but couldnt figure it out.
I also tried using ADAL to generate access token instead but not sure what the resource URL would be. Tried various combinations but they all end up with an error (TCP/IP Connection).
I did see a blog post about using Pyodbc, but was hoping to use JDBC using Spark SQL as that works without an issue in Data Bricks.
Thanks!
Does it help to enable this setting?
"Allow service principals to use Power BI APIs"
Thanks for your response. I did see the blog post from other threads, too, but I believe it's really about adding service principal to the workspace, not necessarily for SQL Endpoint using Service Principal. The setting is turned on for me regardless, and I am already able to use Data Studio and Dataflow to connect to the SQL endpoint, just that I couldn't find a way to do it using a Notebook and JDBC.
I also saw that there is a way to do it using Pyodbc, but that would require using Pandas then converting to PySpark. I was hoping to use JDBC directly in Spark as that works without an issue in Data Bricks.
Thanks!
Hi @w0ns0ng
Thanks for using Microsoft Fabric Community.
Apologies for the delay in response.
I found an article which might help you. In this article they are using AAD/Entra username and password, but using other connection string options, I believe you can also use the same method to connect using Service Principle accounts.
I hope this information helps. If you have any further questions please do let us know.
Thanks.
Hi @w0ns0ng
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.
Otherwise, will respond back with the more details and we will try to help.
Thanks.
Hi @w0ns0ng
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.
If you have any question relating to the current thread, please do let us know and we will try out best to help you.
In case if you have any other question on a different issue, we request you to open a new thread.
Thanks.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
8 | |
4 | |
3 | |
2 | |
2 |
User | Count |
---|---|
8 | |
6 | |
5 | |
4 | |
4 |