Forum Discussion

G2_Ship's avatar
G2_Ship
New Member
1 year ago
Solved

Service Principle Connect to Fabric SQL DB

So I am trying to connect an Entity Framework model to a Fabric SQL instance(not warehouse).  It requires the use of a service Principle/Registered App clientId.  The App is also registered as an Enterprise app etc.  I have also gone to the DB and added the principle with:
CREATE USER [testprinciple] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [testprinciple];
ALTER ROLE db_datawriter ADD MEMBER [testprinciple];

This seems to work just fine.  I can see the user in SSMS(but nothing in Fabric UI-Roles/permissions)  but I will assume that is there because Fabric SQL did find the user in Entra.

The problem however is when I try to connect with a Connection string through EF or really any other client like SSMS, Data studio etc.   None of them see to support using a service account-or Fabric SQL does not support Entra wo MFA.  

(Database 'master' on server 'XYZ.database.fabric.microsoft.com' is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of '{5A6F8E2F-04D8-4BC3-8A08-056D4753F415}'.)

 

Maybe Remaining on Azure SQL and then mirroring etc. would be a better approach?  Open to thoughts on this one!

Does Fabric SQL only support Entra MFA?  If that is the case this application will have to remin on Azure SQL.  TY!

6 Replies

  • Hi    G2_Ship 

    Did your Fabric admin turned on the Service Principle can use Fabric API's seetting? Please check that once. Pls refere below image

     

     
     

    The error you afre getting, like database is 'xxxxx" not availabe means it's not about MFA, may be it could be missing some workspace item permissions, you are using older ssms versions. The error you are getting is already is in the connectivty erros of documentation. Pls refere this Troubleshoot Common Connection Issues - Azure SQL & SQL database in Fabric | Microsoft Learn

     

     

     

    Please refer below docs urls. it might helps you

    Authentication in SQL database - Microsoft Fabric | Microsoft Learn

    Microsoft Entra Authentication in Fabric Data Warehouse - Microsoft Fabric | Microsoft Learn

     

    Please let me know if it helps you.

     

    Thank you!!

     

    Did I answer your question? Mark my post as a solution!

    Proud to be a Super User!

     

  • Thanks Supar!  I will look into this.  In the meantime I spun up SQL Azure and am not blocked at least.  It would be great if I could just host inside of Fabric.    I am on SSMS 20.xx but will try an upgrade to that as well.  Appreciate the feedback.

  • v-achippa's avatar
    v-achippa
    Icon for Community Support rankCommunity Support

    Hi G2_Ship,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Thank you suparnababu8 for the prompt response.

     

    As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the user for the issue worked? Is your issue resolved or let us know if you need any further assistance.

     

    Thanks and regards,

    Anjan Kumar Chippa

    • v-achippa's avatar
      v-achippa
      Icon for Community Support rankCommunity Support

      Hi @G2_Ship,

       

      We wanted to kindly follow up to check if the solution provided by the user for the issue worked? or let us know if you need any further assistance.

       

      Thanks and regards,

      Anjan Kumar Chippa

      • v-achippa's avatar
        v-achippa
        Icon for Community Support rankCommunity Support

        Hi @G2_Ship,

         

        As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the user for the issue worked? Is your issue resolved or let us know if you need any further assistance.

         

        Thanks and regards,

        Anjan Kumar Chippa

  • I have been able to connect as a service principal using SSMS 21, so check which version you are working with.