Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
JeremsB
New Member

Unable to get PowerBI Access token from the API

(Newbie to PowerBI)
Hello,

I have a back-end app (NestJS) registered in Azure AD and I want to use it to retrieve a Power BI embed token in order to display some reports on my front-end app (React)

I've followed this tutorial and I use this route to try to get my token
https://api.powerbi.com/v1.0/myorg/groups/*workspaceId*/reports/*reportId* 
In the header I have a Bearer coming from this function

 

 

   const clientCredentialRequest = {
      scopes: ['https://analysis.windows.net/powerbi/api/.default'],
    };

    return this.msalClient.acquireTokenByClientCredential(
      clientCredentialRequest,
    );

 

 

(my msalClient is working well cause I use it for other tasks and I got no problems)

I got this error when trying to retrieve the embed token

 

 

{
    "error": {
        "code": "PowerBINotAuthorizedException",
        "pbi.error": {
            "code": "PowerBINotAuthorizedException",
            "parameters": {},
            "details": [],
            "exceptionCulprit": 1
        }
    }
}

 

 

There is a step in the tutoriel that I think maybe is not good, is the step 7

JeremsB_0-1693819966747.png

I have not this menu on Power BI

The (new) layout is like this

JeremsB_1-1693820066597.png


Also a last idea to solve my pb is about the pricing and the prerequesties to display power bi reports in a react app I have only AAD do I need anything else ?

Thanks in advance

(Sorry for my english, I'm french 🇫🇷)




1 REPLY 1
amitchandak
Super User
Super User

@JeremsB , refer if these can help

https://www.youtube.com/watch?v=N8qYRSqRz84

https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/generate-token

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors