<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Embedding reports using Azure Analysis Services in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Embedding-reports-using-Azure-Analysis-Services/m-p/895059#M21960</link>
    <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code to return the report data is as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public async Task getReportEmbeddingData(string ws, string rep, string user) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; PowerBIClient pbiClient = getPBIClient(); var report = await pbiClient.Reports.GetReportInGroupAsync(ws, rep);&lt;/P&gt;&lt;P&gt;&amp;nbsp; var embedUrl = report.EmbedUrl; var reportName = report.Name;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GenerateTokenRequest genTokenReqParam = new GenerateTokenRequest(accessLevel: "Edit", allowSaveAs: true, identities: new&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;List { new EffectiveIdentity(username: user, roles: new List { "Manager" }, datasets: new List { *our dataset* }) });&lt;/P&gt;&lt;P&gt;&amp;nbsp; var embedding = await pbiClient.Reports.GenerateTokenInGroupAsync(ws, rep, genTokenReqParam);&lt;/P&gt;&lt;P&gt;&amp;nbsp; string embedToken = embedding.Token;&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.DateTime tokenExpiration = embedding.Expiration??DateTime.Now;&lt;/P&gt;&lt;P&gt;&amp;nbsp; return new ReportEmbeddingData { type = "report", reportId = rep, reportName = reportName, embedUrl = embedUrl,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; accessToken = embedToken, expiration = tokenExpiration }; }&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2020 14:35:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-01-09T14:35:17Z</dc:date>
    <item>
      <title>Embedding reports using Azure Analysis Services</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embedding-reports-using-Azure-Analysis-Services/m-p/895059#M21960</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code to return the report data is as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public async Task getReportEmbeddingData(string ws, string rep, string user) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; PowerBIClient pbiClient = getPBIClient(); var report = await pbiClient.Reports.GetReportInGroupAsync(ws, rep);&lt;/P&gt;&lt;P&gt;&amp;nbsp; var embedUrl = report.EmbedUrl; var reportName = report.Name;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GenerateTokenRequest genTokenReqParam = new GenerateTokenRequest(accessLevel: "Edit", allowSaveAs: true, identities: new&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;List { new EffectiveIdentity(username: user, roles: new List { "Manager" }, datasets: new List { *our dataset* }) });&lt;/P&gt;&lt;P&gt;&amp;nbsp; var embedding = await pbiClient.Reports.GenerateTokenInGroupAsync(ws, rep, genTokenReqParam);&lt;/P&gt;&lt;P&gt;&amp;nbsp; string embedToken = embedding.Token;&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.DateTime tokenExpiration = embedding.Expiration??DateTime.Now;&lt;/P&gt;&lt;P&gt;&amp;nbsp; return new ReportEmbeddingData { type = "report", reportId = rep, reportName = reportName, embedUrl = embedUrl,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; accessToken = embedToken, expiration = tokenExpiration }; }&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 14:35:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embedding-reports-using-Azure-Analysis-Services/m-p/895059#M21960</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-09T14:35:17Z</dc:date>
    </item>
  </channel>
</rss>

