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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper II
Helper II

Nodejs powerbi Get Token Request failing with AADSTS7000218


I am using the sample provided at and use the correct application ID along with the below config defined in the Jason config file.



"authorityUrl" : "",

"resourceUrl" : "",

"apiUrl" : "",

"appId" : "",

"workspaceId" : "",

"reportId" : "",

"username" : "",

"password" : ""



But when this methid from the sample code given below


But when this method is called 

    // use user credentials and appId to get an aad token
    let promise = () => { return new Promise(
        (resolve, reject) => {
            context.acquireTokenWithUsernamePassword(config.resourceUrl, config.username, config.password, config.appId , function(err, tokenResponse) {
                if (err) reject(err);


then It throw this error.

Get Token request returned http error: 401 and server response: {"error":"invalid_client","error_description":"AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.\r\nTrace ID: 6560c4b9-fe40-4120-ab2a-921956300000\r\nCorrelation ID: fd7fb0dd-e345-4206-b426-d121000f7393\r\nTimestamp: 2019-08-02 19:14:41Z","error_codes":[7000218],"timestamp":"2019-08-02 19:14:41Z","trace_id":"6560c4b9-fe40-4120-ab2a-921956300000","correlation_id":"fd7fb0dd-e345-4206-b426-d121000f7393"}


I do not understand why it is asking for client Secret because there is no option provided in this to specific client secret.

Not sure where I need to specify that . Not sure How can we make this sample work. I have use Azure Portal to register the App and assigning permission to PowerBI but that also did not worked and throwing the same error.


Any help would be really appreciated.




Helper V
Helper V

you get the secret when you register it as an Azure Web app (API/Web app Type).  If you registered as "Native" type, then there is no client secret.


This basically registers it properly inside Azure portal for you, must easier than missing something in Azure Portal in my opinion, although, good to know how to properly do it yourself anyway as background info.

Also, you need to provide these values.  You get workspace ID from getting it in when navigating to the workspace, it provides the GUID in the url there.  You get the report ID by navigating to and clicking the report from the workspace, then in the url, the report guid will show up.  The username and password is the one who is registering it, and we always use a service account aka master user in the documentation or service principal (newer way recently if working with V2 of the workspaces).  Anything new for workspaces is V2.

"appId" : "",

"workspaceId" : "",

"reportId" : "",

"username" : "",

"password" : ""

Even after providing these values in the config file and registering the app it is not working.

Helpful resources

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors