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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.