<?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 embedding for PHP web application in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1668616#M27872</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/271810"&gt;@verma_pragya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a number of steps you need to take:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a Workspace Collection inside Azure and get the Access keys (I understand you've completed this)&lt;/LI&gt;&lt;LI&gt;Create a Workspace using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/mt711503.aspx" target="_blank" rel="nofollow noopener noreferrer"&gt;REST API&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- with PHP, you'll be using probably use CURL for this. Don't forget to add the Authorization header with one of the Access keys and use POST as described&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="here" href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-iframe/" target="_blank" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;. Note that you don't need to actually post anything, just use the POST method, otherwise you'll just get a JSON with the existing workspaces.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;POST &lt;A href="https://api.powerbi.com/v1.0/collections/mypbiapp/workspaces" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/collections/mypbiapp/workspaces&lt;/A&gt; Authorization: AppKey {yourAccessKey}&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Now you should have a workspace id.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Import a .pbix file from Power BI Desktop into your workspace. This is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/mt711504.aspx" target="_blank" rel="nofollow noopener noreferrer"&gt;also achieved using the REST API&lt;/A&gt;.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;don't forget to add the datasetDisplayName parameter to the URL&lt;/STRONG&gt;, ie: POST the data and file to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://api.powerbi.com/v1.0/collections/{collectionName}/workspaces/{workspaceId}/imports?datasetDisplayName={somename" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/collections/{collectionName}/workspaces/{workspaceId}/imports?datasetDisplayName={somename&lt;/A&gt;}&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Now you should have a report id.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create an embed token. This is a JSON Web Token (JWT). You can use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/firebase/php-jwt" target="_blank" rel="nofollow noopener noreferrer"&gt;php-jwt&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for this. The JWT claims payload required for PBIe are listed&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-app-token-flow/" target="_blank" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;. Note that you only need to pass the payload and your Access key to php-jwt.&lt;/LI&gt;&lt;LI&gt;With that token, you can finally embed the report in your application using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript" target="_blank" rel="nofollow noopener noreferrer"&gt;PowerBI Javascript&lt;/A&gt;. You can just copy the powerbi.js file from the dist dir if you wish. You need to create a configuration object as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embedding-Basics" target="_blank" rel="nofollow noopener noreferrer"&gt;described here&lt;/A&gt;.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;var embedConfiguration = { type: 'report', accessToken: {your-jwt-token-string}, id: {your-report-id-string}, embedUrl: '&lt;A href="https://embedded.powerbi.com/appTokenReportEmbed" target="_blank" rel="noopener"&gt;https://embedded.powerbi.com/appTokenReportEmbed&lt;/A&gt;' }; var $reportContainer = $('#reportContainer'); //some div var report = powerbi.embed($reportContainer.get(0), embedConfiguration);&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;And now you should have a report in your app.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/39770804/use-powerbi-embedded-in-php" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/39770804/use-powerbi-embedded-in-php&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Stephen Tao&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Feb 2021 07:33:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-02-16T07:33:14Z</dc:date>
    <item>
      <title>Power BI embedding for PHP web application</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1663056#M27823</link>
      <description>&lt;P&gt;Is it possible to embed a Power BI report in a php application.&amp;nbsp;If so, how to generate access token and embed url using php?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be appreciated. Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 12:16:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1663056#M27823</guid>
      <dc:creator>verma_pragya</dc:creator>
      <dc:date>2021-02-12T12:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI embedding for PHP web application</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1664860#M27840</link>
      <description>&lt;P&gt;&lt;A href="https://powerbi.microsoft.com/en-us/developers/embedded-analytics/isv/" target="_blank"&gt;Power BI Embedded (microsoft.com)&lt;/A&gt;&amp;nbsp; You'll probably want to go with the JavaScript API.&amp;nbsp; Do you have Azure AD?&lt;/P&gt;</description>
      <pubDate>Sun, 14 Feb 2021 00:45:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1664860#M27840</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-02-14T00:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI embedding for PHP web application</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1665001#M27842</link>
      <description>&lt;P&gt;Yes, I have Azure AD. I can embed a report using c# and python to generate the access token and embed URL, and javascript rest APIs to embed. However, I have no clue on how to generate access token using PHP, since I want to embed report in my PHP application.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Feb 2021 06:53:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1665001#M27842</guid>
      <dc:creator>verma_pragya</dc:creator>
      <dc:date>2021-02-14T06:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI embedding for PHP web application</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1668616#M27872</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/271810"&gt;@verma_pragya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a number of steps you need to take:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a Workspace Collection inside Azure and get the Access keys (I understand you've completed this)&lt;/LI&gt;&lt;LI&gt;Create a Workspace using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/mt711503.aspx" target="_blank" rel="nofollow noopener noreferrer"&gt;REST API&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- with PHP, you'll be using probably use CURL for this. Don't forget to add the Authorization header with one of the Access keys and use POST as described&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="here" href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-iframe/" target="_blank" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;. Note that you don't need to actually post anything, just use the POST method, otherwise you'll just get a JSON with the existing workspaces.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;POST &lt;A href="https://api.powerbi.com/v1.0/collections/mypbiapp/workspaces" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/collections/mypbiapp/workspaces&lt;/A&gt; Authorization: AppKey {yourAccessKey}&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Now you should have a workspace id.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Import a .pbix file from Power BI Desktop into your workspace. This is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/mt711504.aspx" target="_blank" rel="nofollow noopener noreferrer"&gt;also achieved using the REST API&lt;/A&gt;.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;don't forget to add the datasetDisplayName parameter to the URL&lt;/STRONG&gt;, ie: POST the data and file to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://api.powerbi.com/v1.0/collections/{collectionName}/workspaces/{workspaceId}/imports?datasetDisplayName={somename" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/collections/{collectionName}/workspaces/{workspaceId}/imports?datasetDisplayName={somename&lt;/A&gt;}&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Now you should have a report id.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create an embed token. This is a JSON Web Token (JWT). You can use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/firebase/php-jwt" target="_blank" rel="nofollow noopener noreferrer"&gt;php-jwt&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for this. The JWT claims payload required for PBIe are listed&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-app-token-flow/" target="_blank" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;. Note that you only need to pass the payload and your Access key to php-jwt.&lt;/LI&gt;&lt;LI&gt;With that token, you can finally embed the report in your application using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript" target="_blank" rel="nofollow noopener noreferrer"&gt;PowerBI Javascript&lt;/A&gt;. You can just copy the powerbi.js file from the dist dir if you wish. You need to create a configuration object as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embedding-Basics" target="_blank" rel="nofollow noopener noreferrer"&gt;described here&lt;/A&gt;.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;var embedConfiguration = { type: 'report', accessToken: {your-jwt-token-string}, id: {your-report-id-string}, embedUrl: '&lt;A href="https://embedded.powerbi.com/appTokenReportEmbed" target="_blank" rel="noopener"&gt;https://embedded.powerbi.com/appTokenReportEmbed&lt;/A&gt;' }; var $reportContainer = $('#reportContainer'); //some div var report = powerbi.embed($reportContainer.get(0), embedConfiguration);&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;And now you should have a report in your app.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/39770804/use-powerbi-embedded-in-php" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/39770804/use-powerbi-embedded-in-php&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Stephen Tao&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 07:33:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1668616#M27872</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-16T07:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI embedding for PHP web application</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1728528#M28433</link>
      <description>&lt;P&gt;I'm working on a similar problem...trying to embed for customers in Drupal. So far, my solution is to use the python (with flask) solution and potentially embed the flask service URL (localhost:5000 for now) in an iframe to serve the report. It works in my local Drupal instance. I'm working on how to pass the Drupal user id to the Javascript and then to the PowerBI API for row level security.&amp;nbsp;&lt;BR /&gt;Good luck!!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 19:45:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-embedding-for-PHP-web-application/m-p/1728528#M28433</guid>
      <dc:creator>melsmithsch</dc:creator>
      <dc:date>2021-03-17T19:45:08Z</dc:date>
    </item>
  </channel>
</rss>

