Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Software versions
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
{at Connection.socketError
... node_modules\tedious\lib\connection.js:1344:26)
code: 'ESOCKET'
}
Note:that the connection works when using the powershell with the same parameters.
Install-Module -Name SqlServer
$connectionString = "Server=$server;Database=$database;User Id=$username;Password=$password;Authentication=Active Directory Password;Encrypt=True;TrustServerCertificate=False;"
# Create a SQL connection
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection
$sqlConnection.ConnectionString = $connectionString
Best Regards,
that "socket hang up" seems to be a rather popular error message lately.
If you have a Pro license you can open a Pro ticket at https://admin.powerplatform.microsoft.com/newsupportticket/powerbi
Otherwise you can raise an issue at https://community.fabric.microsoft.com/t5/Issues/idb-p/Issues .
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 |