Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a console app in C# .net framework. I am trying to connect MS Fabric Lakehouse SQL Analytics Endpoint using Service Principal, but it always gives me error 'Could not login because the authentication failed.', when i researched i found in community (authenticate to Fabric Data Warehouse with Service... - Microsoft Fabric Community) it says in SQL query window Create a user with your service principal name and add db_owner role. But when i tried to execute the query it says 'CREATE USER is not a supported statement type.' Its a deadlocak, i want to access Lakehouse tables from C# without user interaction login. Kindly Assist.
//Not working
string connectionString = @"Data Source=msfabricendpoint.datawarehouse.fabric.microsoft.com,1433;
Initial Catalog=insights_LH_PRD;
Authentication=Active Directory Service Principal;
User ID=[ClientId];
Password=[Client_Secret]";
Encrypt=True;
TrustServerCertificate=False;";
SqlConnection conn = new SqlConnection(connectionString);
conn.Open();
Hi @jigmoth ,
Thanks for using Fabric Community.
The answer provided for this thread - authenticate to Fabric Data Warehouse with Service... - Microsoft Fabric Community assuming user would like to connect Azure SQL using pyodbc in Fabric via Service Principal..
If you are tring to connecting MS Fabric Lakehouse SQL Analytics Endpoint using Service Principal
Note: After creating Service Prinipal in Azure Entra ID. You need to add service principal to Fabric workspaces like this:
Make sure to allow access to service principals by enabling below option in Admin Portal:
After providing the access you should be able to do the connection using Service Principal.
Docs to refer -
c# - Generating token for Fabric Rest api using client secret - Stack Overflow
Connectivity to data warehousing - Microsoft Fabric | Microsoft Learn
Hope this is helpful. Please let me know incase of further queries.
Thank you for responding, for me i cannot see Tenant settings options and many other menus, i can only see Capacity Settings & Help Support. What am i missing here?
Hi @jigmoth ,
It looks like you do not have the necessary permissions.
I can find a similar thread -
Solved: Admin Portal Only Has Capacity Settings ONLY - No... - Microsoft Fabric Community
Thank you
Hello @jigmoth ,
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
Hello, Yes this worked for me thank you. Appreciate you help.
Hi @jigmoth ,
Glad to know that your issue got resolved. Please continue using Fabric Community on your further queries.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Data Engineering, Data Science, Data Warehouse and General Discussion.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |