Search code examples
node.jspowerbidatasetpowerbi-datasource

Power BI, connect directly to a dataset from a nodeJS app


I have an application that uses data from a DataSet in Power BI, right now, we use a flow under power automate to retrieve this data from and generated endpoint.

This is a simple question because I cannot find anything under the MS docs. Is it possible (using a connector or something similar) to retrieve the data from the dataset directly from my nodeJS app?

Note: Our app is deployed in Azure so maybe there could be an Azure function to handle that

Any guidance or docs will be highly appreciated, at least to point me in the right direction.


Solution

  • You'll need to register your application in the Azure Active Directory to obtain the necessary credentials (client ID and client secret) that will be used to authenticate your app when making requests to the Power BI API.

    In your Node.js app, you must implement the OAuth 2.0 authentication flow to obtain an access token. This access token will be used in subsequent API calls to authenticate your app.

    Once you have the access token, you can use it to make API requests to retrieve data from your Power BI dataset. You can use the "Execute DAX" or "Get Data Rows" API endpoints to get the needed data.

    Once you retrieve the data from the dataset, you can process it as needed within your Node.js app.

    For the documentation, you can refer to the official Microsoft Power BI REST API documentation.