Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

379
Views
Connect Power BI to Angular App through MSAL

I have been trying this from months and still I did not find any solution on how to authenticate user with PowerBI service along with the Microsoft Authentication using MSAL.

Tried with https://analysis.windows.net/powerbi/api/ this url as well in powerBI endpoint

export const protectedResources = {
    powerBI: {
        endpoint: "https://graph.microsoft.com/.default",
        scopes: ["Report.Read.All"],
    },
    graphMe: {
        endpoint: "https://graph.microsoft.com/v1.0/me",
        scopes: ["User.Read"],
    },
    armTenants: {
        endpoint: "https://management.azure.com/tenants",
        scopes: ["https://management.azure.com/user_impersonation"],
    }
}

Above the scopes code in config and below is the code got from Microsoft documentation which is working perfectly fine for Authenticating user with graph api and able to get user details.

export function MSALInstanceFactory(): IPublicClientApplication {
  return new PublicClientApplication(msalConfig);
}


export function MSALInterceptorConfigFactory(): MsalInterceptorConfiguration {
  const protectedResourceMap = new Map<string, Array<string>>();

  protectedResourceMap.set(protectedResources.graphMe.endpoint, protectedResources.graphMe.scopes);
  protectedResourceMap.set(protectedResources.armTenants.endpoint, protectedResources.armTenants.scopes);
  protectedResourceMap.set(protectedResources.powerBI.endpoint, protectedResources.powerBI.scopes);

  return {
    interactionType: InteractionType.Redirect,
    protectedResourceMap
  };
}
export function MSALGuardConfigFactory(): MsalGuardConfiguration {
  return {
    interactionType: InteractionType.Redirect,
    authRequest: loginRequest
  };
}

But the Problem is after user gets authenticated still user has to click on additional sign in button inside the iframe in order to again get authenticated with PowerBI.

enter image description here

See the image.

Please provide me a way to authenticate user in one shot just by single login I should be able to login user in both my app and powerBI service.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can find instructions for the Power BI APIs here: https://docs.microsoft.com/rest/api/power-bi/

Note that the Power BI APIs are on https://api.powerbi.com/v1.0/ (not graph.microsoft.com) and scopes will be similar to https://analysis.windows.net/powerbi/api/<scope name>

Follow the instructions to add PowerBI to your application in the Portal, and then you should be able to configure MSAL to acquire tokens with relevant scopes for each PowerBI endpoint you use.

For example:

powerBI: {
        endpoint: "https://api.powerbi.com/v1.0/myorg/reports",
        scopes: ["https://analysis.windows.net/powerbi/api/Report.Read.All"],
    }

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!