Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello Fabric Community,
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.
Here are the details I'm currently working with:
// Your Data Warehouse details
const dataWarehouseEndpoint = 'your_data_warehouse_endpoint'
const databaseName = 'your_database_name'
const clientId = 'your_client_id'
const clientSecret = 'your_client_secret'
const authority = 'https://login.microsoftonline.com/'your_tenant_id'
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.
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.
Thank you in advance for your help.
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.
Here is an excerpt from the code I'm currently using:
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) => {
if (err) {
console.log("Connection Failed");
throw err;
}
console.log("Custom connection Succeeded");
connection.close();
});
ConnectionError: Connection lost - socket hang up
{
code: 'ESOCKET'
}
I'm open to any further suggestions or insights you may have. Your expertise is highly appreciated.
Best Regards
Hi @Omar_Osman ,
Base on your description, 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?
1. Check if have been granted the proper permission
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.
Best Regards
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
8 | |
6 | |
3 | |
3 | |
2 |