1
votes

I am trying to connect Azure Analysis Services with connection string from Node js api. I am using OLEDB module for this connectivity.

Problem is: When I try to connect, Login prompt is getting popped out automatically. I want this flow to happen without any prompt.

Is there any solution or specific properties for connection string to do this?

1

1 Answers

0
votes

You can add a Service Principle to your database and add its info to your connection string as a username and password. This will prevent the need for a popup.

const oledb = require('oledb');

var appId = "appId";
var authKey = "appSecret";
var connectionString = `Provider=MSOLAP;Data Source=asazure://aspaaseastus2.asazure.windows.net/(servername);Initial catalog=(database name);User ID=app:${appId};Password=${authKey};`;

const db = oledb.oledbConnection(connectionString);

db.query(`EVALUATE
            CALCULATETABLE(
                Customer,
                Customer[First Name] = "Aaron" )`
    ).then(result => {
        console.log(result);
    },
    err => {
        console.error(err);
    });