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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Embedding reports using Azure Analysis Services

My team and I are attempting to embedd power bi reports in our angular app. Currently we have created a few reports connecting to Azure Analysis Services which, according to power bi service, are connecting correctly to the database and displaying the visuals as intended.

 

However when I try to get the data from one of those reports using power bi's api it returns an error 500 'BadRequest'; we are using an app owns data model with a service principal and it is able to return data and embed reports not using Analysis Services, we are also using RLS.

 

I can't figure out what we're missing. I assume that the gateways my collegues set up are working fine otherwise the report wouldn't load in power bi service, do we need to grant our service principal permissions or roles to use the database inside our Analysis Service? Is there some obscure function that I should be using to return data from these reports?

 

My code to return the report data is as follows

 

public async Task getReportEmbeddingData(string ws, string rep, string user) {

  PowerBIClient pbiClient = getPBIClient(); var report = await pbiClient.Reports.GetReportInGroupAsync(ws, rep);

  var embedUrl = report.EmbedUrl; var reportName = report.Name;

  GenerateTokenRequest genTokenReqParam = new GenerateTokenRequest(accessLevel: "Edit", allowSaveAs: true, identities: new         List { new EffectiveIdentity(username: user, roles: new List { "Manager" }, datasets: new List { *our dataset* }) });

  var embedding = await pbiClient.Reports.GenerateTokenInGroupAsync(ws, rep, genTokenReqParam);

  string embedToken = embedding.Token;

  System.DateTime tokenExpiration = embedding.Expiration??DateTime.Now;

  return new ReportEmbeddingData { type = "report", reportId = rep, reportName = reportName, embedUrl = embedUrl,                      accessToken = embedToken, expiration = tokenExpiration }; }

0 REPLIES 0

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.