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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I've been trying to generate an access token to call the Power BI REST api.
I haven't had any luck following multiple tutorials where I've had various problems:
I'm trying to get an access token for a web app where the app owns the data, so I already know the credientials.
Ideally I would like an access token to stay static so I can generate embed tokens without having to get a new access token for each embed request. I would also like to contain this to NodeJS as that's what my server is written in.
Any suggestions?
Thanks!
Solved! Go to Solution.
@cheesepudding wrote:
Hi,
I've been trying to generate an access token to call the Power BI REST api.
I haven't had any luck following multiple tutorials where I've had various problems:
I'm trying to get an access token for a web app where the app owns the data, so I already know the credientials.
Ideally I would like an access token to stay static so I can generate embed tokens without having to get a new access token for each embed request. I would also like to contain this to NodeJS as that's what my server is written in.
Any suggestions?
Thanks!
It is not possible, by default an access token would expire in one hour, see AAD token lifetime. What is the concern to get a new access token every time? I don't know NodeJS, but you can get a new token simply by calling a POST REST API.
POST /common/oauth2/token HTTP/1.1
Host: login.windows.net
Content-Type: application/x-www-form-urlencoded
client_id={your client id}&grant_type=password&resource=https%3A%2F%2Fanalysis.windows.net%2Fpowerbi%2Fapi&username={your power bi account}&password={your power bi account password}
@cheesepudding wrote:
Hi,
I've been trying to generate an access token to call the Power BI REST api.
I haven't had any luck following multiple tutorials where I've had various problems:
I'm trying to get an access token for a web app where the app owns the data, so I already know the credientials.
Ideally I would like an access token to stay static so I can generate embed tokens without having to get a new access token for each embed request. I would also like to contain this to NodeJS as that's what my server is written in.
Any suggestions?
Thanks!
It is not possible, by default an access token would expire in one hour, see AAD token lifetime. What is the concern to get a new access token every time? I don't know NodeJS, but you can get a new token simply by calling a POST REST API.
POST /common/oauth2/token HTTP/1.1
Host: login.windows.net
Content-Type: application/x-www-form-urlencoded
client_id={your client id}&grant_type=password&resource=https%3A%2F%2Fanalysis.windows.net%2Fpowerbi%2Fapi&username={your power bi account}&password={your power bi account password}
Hi Eric,
Thanks for the answer, this is what I was looking for.
Where would I find the documentation for this?
I had a look on https://msdn.microsoft.com/library/dn877544.aspx , but their link is broken.
Thanks,
Cheese Pudding
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |