<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unsuccessful Silent Connection to SQL Endpoint in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Unsuccessful-Silent-Connection-to-SQL-Endpoint/m-p/3732644#M49936</link>
    <description>&lt;P&gt;Hello Fabric Community,&lt;/P&gt;&lt;P&gt;I hope this message finds you well. I'm reaching out because I've encountered a roadblock in establishing a silent connection to the SQL endpoint within Fabric. Despite being able to access the endpoint successfully via SSMS with MFA, my attempts at a silent connection have been met with an "unauthorized" response.&lt;/P&gt;&lt;P&gt;Here are the details I'm currently working with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Your Data Warehouse details&lt;BR /&gt;const dataWarehouseEndpoint = 'your_data_warehouse_endpoint'&lt;BR /&gt;const databaseName = 'your_database_name'&lt;BR /&gt;const clientId = 'your_client_id'&lt;BR /&gt;const clientSecret = 'your_client_secret'&lt;BR /&gt;const authority = '&lt;A href="https://login.microsoftonline.com/" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/'&lt;/A&gt;your_tenant_id'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to access the endpoint using SSMS with MFA, but I'm specifically seeking a silent connection for more streamlined integration. The goal is to connect without user interaction.&lt;/P&gt;&lt;P&gt;If anyone in the community has faced a similar challenge or has insights into how to resolve this issue, I would greatly appreciate your guidance. Additionally, if there are specific configurations or adjustments that need to be made in the provided code, please share your expertise.&lt;/P&gt;&lt;P&gt;Thank you in advance for your help.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Feb 2024 07:11:15 GMT</pubDate>
    <dc:creator>Omar_Osman</dc:creator>
    <dc:date>2024-02-29T07:11:15Z</dc:date>
    <item>
      <title>Unsuccessful Silent Connection to SQL Endpoint</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unsuccessful-Silent-Connection-to-SQL-Endpoint/m-p/3732644#M49936</link>
      <description>&lt;P&gt;Hello Fabric Community,&lt;/P&gt;&lt;P&gt;I hope this message finds you well. I'm reaching out because I've encountered a roadblock in establishing a silent connection to the SQL endpoint within Fabric. Despite being able to access the endpoint successfully via SSMS with MFA, my attempts at a silent connection have been met with an "unauthorized" response.&lt;/P&gt;&lt;P&gt;Here are the details I'm currently working with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Your Data Warehouse details&lt;BR /&gt;const dataWarehouseEndpoint = 'your_data_warehouse_endpoint'&lt;BR /&gt;const databaseName = 'your_database_name'&lt;BR /&gt;const clientId = 'your_client_id'&lt;BR /&gt;const clientSecret = 'your_client_secret'&lt;BR /&gt;const authority = '&lt;A href="https://login.microsoftonline.com/" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/'&lt;/A&gt;your_tenant_id'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to access the endpoint using SSMS with MFA, but I'm specifically seeking a silent connection for more streamlined integration. The goal is to connect without user interaction.&lt;/P&gt;&lt;P&gt;If anyone in the community has faced a similar challenge or has insights into how to resolve this issue, I would greatly appreciate your guidance. Additionally, if there are specific configurations or adjustments that need to be made in the provided code, please share your expertise.&lt;/P&gt;&lt;P&gt;Thank you in advance for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 07:11:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unsuccessful-Silent-Connection-to-SQL-Endpoint/m-p/3732644#M49936</guid>
      <dc:creator>Omar_Osman</dc:creator>
      <dc:date>2024-02-29T07:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unsuccessful Silent Connection to SQL Endpoint</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unsuccessful-Silent-Connection-to-SQL-Endpoint/m-p/3736022#M49968</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/697822"&gt;@Omar_Osman&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Base on your description,&amp;nbsp;&lt;SPAN&gt;it sounds like you're experiencing an issue with establishing a silent connection to a SQL endpoint within Fabric. Could you please check or try the following info?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. Check if have been granted the proper permission&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Check the required scope (it could be Dashboard.ReadWrite.All or Dashboard.Read.All) and whether admin consent is required.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Token: You could use&lt;A href="https://jwt.io/" target="_self"&gt; JWT.io&lt;/A&gt; to decode the token to check the aud and permissions.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Check if the client ID and client secret you're using are correct and authorized to access the SQL endpoint. And&lt;/SPAN&gt;&amp;nbsp;verify that the authority URL is correct and that the tenant ID is properly&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. Use a service principal or managed identity for authentication instead of a user account. This would allow for a more streamlined and automated connection process.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/entra/identity-platform/howto-create-service-principal-portal" target="_blank"&gt;Create a Microsoft Entra app and service principal in the portal&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-configure?view=azuresql&amp;amp;tabs=azure-cli" target="_blank"&gt;Configure Microsoft Entra authentication - Azure SQL Database &amp;amp; SQL Managed Instance &amp;amp; Azure Synapse Analytics&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 09:52:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unsuccessful-Silent-Connection-to-SQL-Endpoint/m-p/3736022#M49968</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-01T09:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Unsuccessful Silent Connection to SQL Endpoint</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unsuccessful-Silent-Connection-to-SQL-Endpoint/m-p/3748089#M50172</link>
      <description>&lt;P&gt;Hi. Unfortunately, the connection issue persists despite thorough verification, even when utilizing a username and password. The error encountered is "ConnectionError: Connection lost - socket hang up," and this issue replicates when experimenting with an alternative library.&lt;BR /&gt;&lt;SPAN&gt;Here is an excerpt from the code I'm currently using:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var Connection = require("tedious").Connection;

var config = {
  server:
    //"****.datawarehouse.pbidedicated.windows.net",
    "*****.datawarehouse.fabric.microsoft.com",
  database: "Gold",
  options: {
    encrypt: true,
    trustServerCertificate: false,
  },
  authentication: {
    //type: "azure-active-directory-password",
    type: "azure-active-directory-service-principal-secret",
    options: {
      //userName: "@.onmicrosoft.com",
      //password: "****",
      clientId: "****",
      tenantId: "****",
      clientSecret: "****",
    },
  },
};

var connection = new Connection(config);

connection.connect((err) =&amp;gt; {
  if (err) {
    console.log("Connection Failed");
    throw err;
  }

  console.log("Custom connection Succeeded");
  connection.close();
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;ConnectionError: Connection lost - socket hang up
     {
    code: 'ESOCKET'
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm open to any further suggestions or insights you may have. Your expertise is highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 10:29:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unsuccessful-Silent-Connection-to-SQL-Endpoint/m-p/3748089#M50172</guid>
      <dc:creator>Omar_Osman</dc:creator>
      <dc:date>2024-03-07T10:29:09Z</dc:date>
    </item>
  </channel>
</rss>

