<?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 Embed report with SQL database as data source in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Embed-report-with-SQL-database-as-data-source/m-p/3804423#M51335</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;I have embedded my report in edit mode using service principal. I am able to edit and save reports whose data source is excel file. However, I am getting status 400 error when I try to embed report whose data comes directly from SQL database.&lt;/P&gt;&lt;P&gt;Is there any different method for these reports? Do I need any other permission or access to embed these reports?&lt;/P&gt;&lt;P&gt;I am using only import mode for my report and the code is from PowerBI-Developer-Samples repo from microsoft:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples" target="_blank" rel="noopener"&gt;https://github.com/microsoft/PowerBI-Developer-Samples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naam_nrj_0-1712150597738.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1071705i79A82DA4EDD6B19A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="naam_nrj_0-1712150597738.png" alt="naam_nrj_0-1712150597738.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Body of API call:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
reports: [ { allowEdit: true, id: '&amp;lt;my report id&amp;gt;' } ],
datasets: [ {id: '&amp;lt;my dataset id&amp;gt;'} ],
targetWorkspaces: [ { id: '&amp;lt;workspace id&amp;gt;' } ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code where it generates embed token:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const embedTokenApi = "https://api.powerbi.com/v1.0/myorg/GenerateToken";
const headers = await getRequestHeader();

console.log("======Body=========\n", formData)

// Generate Embed token for single report, workspace, and multiple datasets. Refer https://aka.ms/MultiResourceEmbedToken
const result = await fetch(embedTokenApi, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(formData)
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error I am facing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Response {
  size: 0,
  timeout: 0,
  [Symbol(Body internals)]: {
    body: PassThrough {
      _events: [Object],
      _readableState: [ReadableState],
      _writableState: [WritableState],
      allowHalfOpen: true,
      _maxListeners: undefined,
      _eventsCount: 5,
      [Symbol(shapeMode)]: true,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: null
    },
    disturbed: false,
    error: null
  },
  [Symbol(Response internals)]: {
    url: 'https://api.powerbi.com/v1.0/myorg/GenerateToken',
    status: 400,
    statusText: 'Bad Request',
    headers: Headers { [Symbol(map)]: [Object: null prototype] },
    counter: 0
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 15:31:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-04-03T15:31:11Z</dc:date>
    <item>
      <title>Embed report with SQL database as data source</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embed-report-with-SQL-database-as-data-source/m-p/3804423#M51335</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;I have embedded my report in edit mode using service principal. I am able to edit and save reports whose data source is excel file. However, I am getting status 400 error when I try to embed report whose data comes directly from SQL database.&lt;/P&gt;&lt;P&gt;Is there any different method for these reports? Do I need any other permission or access to embed these reports?&lt;/P&gt;&lt;P&gt;I am using only import mode for my report and the code is from PowerBI-Developer-Samples repo from microsoft:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples" target="_blank" rel="noopener"&gt;https://github.com/microsoft/PowerBI-Developer-Samples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naam_nrj_0-1712150597738.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1071705i79A82DA4EDD6B19A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="naam_nrj_0-1712150597738.png" alt="naam_nrj_0-1712150597738.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Body of API call:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
reports: [ { allowEdit: true, id: '&amp;lt;my report id&amp;gt;' } ],
datasets: [ {id: '&amp;lt;my dataset id&amp;gt;'} ],
targetWorkspaces: [ { id: '&amp;lt;workspace id&amp;gt;' } ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code where it generates embed token:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const embedTokenApi = "https://api.powerbi.com/v1.0/myorg/GenerateToken";
const headers = await getRequestHeader();

console.log("======Body=========\n", formData)

// Generate Embed token for single report, workspace, and multiple datasets. Refer https://aka.ms/MultiResourceEmbedToken
const result = await fetch(embedTokenApi, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(formData)
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error I am facing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Response {
  size: 0,
  timeout: 0,
  [Symbol(Body internals)]: {
    body: PassThrough {
      _events: [Object],
      _readableState: [ReadableState],
      _writableState: [WritableState],
      allowHalfOpen: true,
      _maxListeners: undefined,
      _eventsCount: 5,
      [Symbol(shapeMode)]: true,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: null
    },
    disturbed: false,
    error: null
  },
  [Symbol(Response internals)]: {
    url: 'https://api.powerbi.com/v1.0/myorg/GenerateToken',
    status: 400,
    statusText: 'Bad Request',
    headers: Headers { [Symbol(map)]: [Object: null prototype] },
    counter: 0
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 15:31:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embed-report-with-SQL-database-as-data-source/m-p/3804423#M51335</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-03T15:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Embed report with SQL database as data source</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embed-report-with-SQL-database-as-data-source/m-p/3806302#M51374</link>
      <description>&lt;P&gt;HI&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;What type of connection more are you worked? Please share some more detailed information to help us clarify them and troubleshoot.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition, you can also take a look at the official document limitation list if they meet to your scenario:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal#considerations-and-limitations" target="_blank"&gt;Embed Power BI content in an embedded analytics application with service principal and an application secret - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 01:58:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embed-report-with-SQL-database-as-data-source/m-p/3806302#M51374</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-03T01:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Embed report with SQL database as data source</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embed-report-with-SQL-database-as-data-source/m-p/3807105#M51380</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have update the question with more details.&lt;/P&gt;&lt;P&gt;I am using semantic model and import mode to get data from database.&lt;/P&gt;&lt;P&gt;I have exactly what the documentation says. Still I am unable to retrieve the embed keys.&lt;/P&gt;&lt;P&gt;I did not find any topic like this on the internet so I am not sure what's the cause of this error.&lt;/P&gt;&lt;P&gt;Reports with excel data as data source are working fine.&lt;/P&gt;&lt;P&gt;While I tried asking gemini for this, it suggests to give my service principal the admin acces to my SQL database. I doubt if its the right solution so I thought lets ask professionals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 14:23:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embed-report-with-SQL-database-as-data-source/m-p/3807105#M51380</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-03T14:23:20Z</dc:date>
    </item>
  </channel>
</rss>

