<?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 401 Unauthorized: Error while retrieving Embed URL (embed power bi for customers-Python) in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/401-Unauthorized-Error-while-retrieving-Embed-URL-embed-power-bi/m-p/1824005#M29294</link>
    <description>&lt;P&gt;I took every steps in this [tutorial](&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core&lt;/A&gt;) and got all the required [information / IDs / Parameters](&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core#step-5---get-the-embedding-parameter-values" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core#step-5---get-the-embedding-parameter-values&lt;/A&gt;). Also watched these [vids](&lt;A href="https://youtube.com/playlist?list=PLib8Q64STW-tCZVSvBAuEIzBsVlf0C81f" target="_blank" rel="noopener"&gt;https://youtube.com/playlist?list=PLib8Q64STW-tCZVSvBAuEIzBsVlf0C81f&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;However, at the final stage when running the [sample python code (flask app)](&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=python#step-8---embed-your-content" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=python#step-8---embed-your-content&lt;/A&gt;), and opening the localhost url in my browser I get this error:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;Error Details:&lt;BR /&gt;401 Unauthorized: Error while retrieving Embed URL&lt;BR /&gt;Unauthorized:&lt;BR /&gt;RequestId: 0b143776-bc54-492e-80bc-5401ecf32fd3&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Which I can't figure out why&lt;/P&gt;&lt;P&gt;it seems that I'm unable to get the token and 401 is return in `pbiembedservice.py` as the api response (last line):&lt;BR /&gt;```&lt;BR /&gt;class PbiEmbedService:&lt;/P&gt;&lt;P&gt;def get_embed_params_for_single_report(self, workspace_id, report_id, additional_dataset_id=None):&lt;BR /&gt;'''Get embed params for a report and a workspace&lt;/P&gt;&lt;P&gt;Args:&lt;BR /&gt;workspace_id (str): Workspace Id&lt;BR /&gt;report_id (str): Report Id&lt;BR /&gt;additional_dataset_id (str, optional): Dataset Id different than the one bound to the report. Defaults to None.&lt;/P&gt;&lt;P&gt;Returns:&lt;BR /&gt;EmbedConfig: Embed token and Embed URL&lt;BR /&gt;'''&lt;/P&gt;&lt;P&gt;report_url = f'&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/reports/{report_id" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/reports/{report_id&lt;/A&gt;}'&lt;BR /&gt;api_response = requests.get(report_url, headers=self.get_request_header())&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Other posts were not very helpful, can someone help me with that&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2021 07:15:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-05-05T07:15:27Z</dc:date>
    <item>
      <title>401 Unauthorized: Error while retrieving Embed URL (embed power bi for customers-Python)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/401-Unauthorized-Error-while-retrieving-Embed-URL-embed-power-bi/m-p/1824005#M29294</link>
      <description>&lt;P&gt;I took every steps in this [tutorial](&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core&lt;/A&gt;) and got all the required [information / IDs / Parameters](&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core#step-5---get-the-embedding-parameter-values" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core#step-5---get-the-embedding-parameter-values&lt;/A&gt;). Also watched these [vids](&lt;A href="https://youtube.com/playlist?list=PLib8Q64STW-tCZVSvBAuEIzBsVlf0C81f" target="_blank" rel="noopener"&gt;https://youtube.com/playlist?list=PLib8Q64STW-tCZVSvBAuEIzBsVlf0C81f&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;However, at the final stage when running the [sample python code (flask app)](&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=python#step-8---embed-your-content" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=python#step-8---embed-your-content&lt;/A&gt;), and opening the localhost url in my browser I get this error:&lt;/P&gt;&lt;P&gt;```&lt;BR /&gt;Error Details:&lt;BR /&gt;401 Unauthorized: Error while retrieving Embed URL&lt;BR /&gt;Unauthorized:&lt;BR /&gt;RequestId: 0b143776-bc54-492e-80bc-5401ecf32fd3&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Which I can't figure out why&lt;/P&gt;&lt;P&gt;it seems that I'm unable to get the token and 401 is return in `pbiembedservice.py` as the api response (last line):&lt;BR /&gt;```&lt;BR /&gt;class PbiEmbedService:&lt;/P&gt;&lt;P&gt;def get_embed_params_for_single_report(self, workspace_id, report_id, additional_dataset_id=None):&lt;BR /&gt;'''Get embed params for a report and a workspace&lt;/P&gt;&lt;P&gt;Args:&lt;BR /&gt;workspace_id (str): Workspace Id&lt;BR /&gt;report_id (str): Report Id&lt;BR /&gt;additional_dataset_id (str, optional): Dataset Id different than the one bound to the report. Defaults to None.&lt;/P&gt;&lt;P&gt;Returns:&lt;BR /&gt;EmbedConfig: Embed token and Embed URL&lt;BR /&gt;'''&lt;/P&gt;&lt;P&gt;report_url = f'&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/reports/{report_id" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/reports/{report_id&lt;/A&gt;}'&lt;BR /&gt;api_response = requests.get(report_url, headers=self.get_request_header())&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Other posts were not very helpful, can someone help me with that&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 07:15:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/401-Unauthorized-Error-while-retrieving-Embed-URL-embed-power-bi/m-p/1824005#M29294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-05T07:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: 401 Unauthorized: Error while retrieving Embed URL (embed power bi for customers-Python)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/401-Unauthorized-Error-while-retrieving-Embed-URL-embed-power-bi/m-p/1828756#M29319</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;@Anonymous,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Have you checked the device configurations to confirm if firewall policy and port settings enabled correctly?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/admin/power-bi-allow-list-urls" target="_blank"&gt;Add Power BI URLs to allow list - Power BI | Microsoft Docs&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;BTW, current power bi embedded features seem not able to be used offline, these token functions required to access to azure service.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 02:12:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/401-Unauthorized-Error-while-retrieving-Embed-URL-embed-power-bi/m-p/1828756#M29319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-07T02:12:02Z</dc:date>
    </item>
  </channel>
</rss>

