Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.