<?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 Re: Power BI Embbeded using Fabric in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embbeded-using-Fabric/m-p/3738784#M49992</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/698938"&gt;@marcelocostafil&lt;/a&gt;&amp;nbsp;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can refer the following links to embed the report for your organization:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;OL id="content-well-in-this-article-list" class="" aria-live="polite" aria-relevant="additions"&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-1---register-a-microsoft-entra-application" target="_blank" rel="noopener"&gt;Step 1 - Register a Microsoft Entra application&lt;/A&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-2---create-a-power-bi-workspace" target="_blank" rel="noopener"&gt;Step 2 - Create a Power BI workspace&lt;/A&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-3---create-and-publish-a-power-bi-report" target="_blank" rel="noopener"&gt;Step 3 - Create and publish a Power BI report&lt;/A&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-4---get-the-embedding-parameter-values" target="_blank" rel="noopener"&gt;Step 4 - Get the embedding parameter values&lt;/A&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-5---embed-your-content" target="_blank" rel="noopener"&gt;Step 5 - Embed your content&lt;/A&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/training/paths/power-bi-embedded/" target="_blank" rel="noopener"&gt;Embed Power BI analytics - Training | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://youtu.be/7gt9PPNoJS4" target="_self"&gt;Power BI Embedded Step by Step Series&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Mon, 04 Mar 2024 03:02:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-03-04T03:02:52Z</dc:date>
    <item>
      <title>Power BI Embbeded using Fabric</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embbeded-using-Fabric/m-p/3736113#M49972</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm with a mission: Embed a report in a app from my company.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is: I have no idea if the steps that I got so far are the right ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a trial license for Microsoft Fabric. I created a report, have it published in a workspace. Then I created an Azure App with tenant read permissions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now for the first test, I just want to show the report in a simple html page using the published report, with the token confirmation from the Azure App.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this the right way? Are there any other configurations that I need to do? Anyone know any detailed tutorial that I can check?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll leave my code here (The one in my machine has the reports/tenant/secrets ids)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html lang="en"&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;BR /&gt;&amp;lt;meta charset="UTF-8"&amp;gt;&lt;BR /&gt;&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;Embedded Power BI Report&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;script src="&lt;A href="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js" target="_blank"&gt;https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js&lt;/A&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;!-- O script acima é necessário para incorporar o Power BI --&amp;gt;&lt;BR /&gt;&amp;lt;style&amp;gt;&lt;BR /&gt;body {&lt;BR /&gt;margin: 0;&lt;BR /&gt;padding: 0;&lt;BR /&gt;}&lt;BR /&gt;#reportContainer {&lt;BR /&gt;height: 100vh;&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;BR /&gt;&amp;lt;body&amp;gt;&lt;BR /&gt;&amp;lt;div id="reportContainer"&amp;gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;// Função para incorporar o relatório&lt;BR /&gt;function embedReport(token) {&lt;BR /&gt;// Configurações do relatório&lt;BR /&gt;const reportConfig = {&lt;BR /&gt;type: 'report',&lt;BR /&gt;id: 'report id', // Substitua pelo ID do seu relatório&lt;BR /&gt;embedUrl: 'embed url', // Substitua pela URL de incorporação do seu relatório&lt;BR /&gt;accessToken: token, // Use o token de acesso obtido do Azure AD&lt;BR /&gt;tokenType: 0,&lt;BR /&gt;permissions: 1,&lt;BR /&gt;settings: {&lt;BR /&gt;filterPaneEnabled: false,&lt;BR /&gt;navContentPaneEnabled: false&lt;BR /&gt;}&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;const reportContainer = document.getElementById('reportContainer');&lt;BR /&gt;const report = powerbi.embed(reportContainer, reportConfig);&lt;/P&gt;&lt;P&gt;// Tratar erros&lt;BR /&gt;report.off('error');&lt;BR /&gt;report.on('error', function (event) {&lt;BR /&gt;console.error(event.detail);&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Função para realizar o login e obter o token de acesso&lt;BR /&gt;function loginAndGetToken() {&lt;BR /&gt;// Redirecionar o usuário para a página de login do Azure AD&lt;BR /&gt;const redirectUri = encodeURIComponent(window.location.href);&lt;BR /&gt;const clientId = 'client id'; // Substitua pelo ID do cliente do seu aplicativo Azure AD&lt;BR /&gt;const authUrl = `&lt;A href="https://login.microsoftonline.com/tenant" target="_blank"&gt;https://login.microsoftonline.com/tenant&lt;/A&gt; id/oauth2/v2.0/authorize?client_id=${clientId}&amp;amp;response_type=code&amp;amp;redirect_uri=${redirectUri}&amp;amp;response_mode=query&amp;amp;scope=&lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_blank"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;`;&lt;/P&gt;&lt;P&gt;window.location.href = authUrl;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Verificar se a página foi redirecionada com um código de autorização&lt;BR /&gt;const params = new URLSearchParams(window.location.search);&lt;BR /&gt;const code = params.get('code');&lt;BR /&gt;if (code) {&lt;BR /&gt;// Trocar o código de autorização por um token de acesso&lt;BR /&gt;const tokenUrl = '&lt;A href="https://login.microsoftonline.com/tenant" target="_blank"&gt;https://login.microsoftonline.com/tenant&lt;/A&gt; id/oauth2/v2.0/token';&lt;BR /&gt;const clientId = 'client id'; // Substitua pelo ID do cliente do seu aplicativo Azure AD&lt;BR /&gt;const clientSecret = 'client secret'; // Substitua pela chave secreta do seu aplicativo Azure AD&lt;BR /&gt;const redirectUri = encodeURIComponent(window.location.href);&lt;BR /&gt;const requestBody = `client_id=${clientId}&amp;amp;scope=&lt;A href="https://analysis.windows.net/powerbi/api/.default&amp;amp;code=${code}&amp;amp;redirect_uri=${redirectUri}&amp;amp;grant_type=authorization_code&amp;amp;client_secret=${clientSecret" target="_blank"&gt;https://analysis.windows.net/powerbi/api/.default&amp;amp;code=${code}&amp;amp;redirect_uri=${redirectUri}&amp;amp;grant_type=authorization_code&amp;amp;client_secret=${clientSecret&lt;/A&gt;}`;&lt;/P&gt;&lt;P&gt;fetch(tokenUrl, {&lt;BR /&gt;method: 'POST',&lt;BR /&gt;headers: {&lt;BR /&gt;'Content-Type': 'application/x-www-form-urlencoded'&lt;BR /&gt;},&lt;BR /&gt;body: requestBody&lt;BR /&gt;})&lt;BR /&gt;.then(response =&amp;gt; response.json())&lt;BR /&gt;.then(data =&amp;gt; {&lt;BR /&gt;const accessToken = data.access_token;&lt;BR /&gt;// Incorporar o relatório usando o token de acesso obtido&lt;BR /&gt;embedReport(accessToken);&lt;BR /&gt;})&lt;BR /&gt;.catch(error =&amp;gt; console.error(error));&lt;BR /&gt;} else {&lt;BR /&gt;// Se não houver um código de autorização na URL, realizar o login&lt;BR /&gt;loginAndGetToken();&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 10:50:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embbeded-using-Fabric/m-p/3736113#M49972</guid>
      <dc:creator>marcelocostafil</dc:creator>
      <dc:date>2024-03-01T10:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Embbeded using Fabric</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embbeded-using-Fabric/m-p/3738784#M49992</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/698938"&gt;@marcelocostafil&lt;/a&gt;&amp;nbsp;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can refer the following links to embed the report for your organization:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;OL id="content-well-in-this-article-list" class="" aria-live="polite" aria-relevant="additions"&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-1---register-a-microsoft-entra-application" target="_blank" rel="noopener"&gt;Step 1 - Register a Microsoft Entra application&lt;/A&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-2---create-a-power-bi-workspace" target="_blank" rel="noopener"&gt;Step 2 - Create a Power BI workspace&lt;/A&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-3---create-and-publish-a-power-bi-report" target="_blank" rel="noopener"&gt;Step 3 - Create and publish a Power BI report&lt;/A&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-4---get-the-embedding-parameter-values" target="_blank" rel="noopener"&gt;Step 4 - Get the embedding parameter values&lt;/A&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI class=""&gt;&lt;FONT size="3"&gt;&lt;FONT size="3"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization?tabs=react#step-5---embed-your-content" target="_blank" rel="noopener"&gt;Step 5 - Embed your content&lt;/A&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/training/paths/power-bi-embedded/" target="_blank" rel="noopener"&gt;Embed Power BI analytics - Training | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://youtu.be/7gt9PPNoJS4" target="_self"&gt;Power BI Embedded Step by Step Series&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 03:02:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embbeded-using-Fabric/m-p/3738784#M49992</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-04T03:02:52Z</dc:date>
    </item>
  </channel>
</rss>

