You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const config = {
server: warehouseDetails.connString,
options: {
encrypt: true,
enableArithAbort: true,
// connectionIsolationLevel: ISOLATION_LEVEL.READ_UNCOMMITTED,
connectTimeout: 30000,
// database: warehouseDetails.warehouseName,
},
authentication: {
"type":'azure-active-directory-access-token',
"options": {
"token": IMPERSONATION_TOKEN,
}
}
}
var Connection = require('tedious').Connection;
var connection = new Connection(config);
connection.on('connect', function(err) {
if (err) {
console.error('Error during connection:', err.message);
//res.status(500).send('Error during connection');
}
console.log('Connected');
});
connection.on('end', function() {
console.log('Connection closed');
});
connection.on('error', function(err) {
console.error('Error during connection:', err.message);
// res.status(500).send('Error during connection');
});
console.log('Connecting to warehouse using user access token:');
connection.connect();
I am trying to connect to FabricWarehouse using a token of a user who has access to the database and aud of the token is 'https://database.windows.net/' and scopes(scp) is 'user_impersonation' and when I am trying to connect, it is giving the below error.
Error: Connection lost - socket hang up
at Connection.socketError (C:\Users\sugas\Downloads\test_warehouses\node_modules\tedious\lib\connection.js:1359:26)
at Connection.socketEnd (C:\Users\sugas\Downloads\test_warehouses\node_modules\tedious\lib\connection.js:1374:12)
at Socket.<anonymous> (C:\Users\sugas\Downloads\test_warehouses\node_modules\tedious\lib\connection.js:1066:12)
at Socket.emit (node:events:531:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {code: 'ESOCKET', stack: 'Error: Connection lost - socket hang up
a…ons (node:internal/process/task_queues:82:21)', message: 'Connection lost - socket hang up', cause: Error: socket hang up
at Connection.socket…Users\sugas\Downloads\test_warehouses\node_mo…}
code =
'ESOCKET'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to connect to FabricWarehouse using a token of a user who has access to the database and aud of the token is 'https://database.windows.net/' and scopes(scp) is 'user_impersonation' and when I am trying to connect, it is giving the below error.
Initially I was getting time out error.
Beta Was this translation helpful? Give feedback.
All reactions