<?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 Powershell API Export to File with RLS applied in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Powershell-API-Export-to-File-with-RLS-applied/m-p/997326#M22868</link>
    <description>&lt;P&gt;I am trying to export a Power BI report to a PDF file using a powershell script.&amp;nbsp; &amp;nbsp;The report exports fine when I leave out the powerBIReportConfiguration portion, but I get blank pages when I try to use an RLS role.&amp;nbsp; This makes me feel like I am doing it wrong.&amp;nbsp; Any help is appreciated.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    $body = '{"format":"PDF", 
              "powerBIReportConfiguration" : {"identities": [{ "username": "'+$user+ '",
                                                              "roles": [ "'+$role+'" ],
                                                              "datasets": [ "'+$datasetID+'" ]
                                                             }]
                                               }
              }'
    $url = "https://api.powerbi.com/v1.0/myorg/groups/"+$workspaceID+"/reports/"+$reportID+"/ExportTo"
    $export = Invoke-PowerBIRestMethod -Method POST -Url $url -Body $body -ContentType application/json | ConvertFrom-Json
    $exportID = $export.id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 29 Mar 2020 23:06:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-29T23:06:28Z</dc:date>
    <item>
      <title>Powershell API Export to File with RLS applied</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Powershell-API-Export-to-File-with-RLS-applied/m-p/997326#M22868</link>
      <description>&lt;P&gt;I am trying to export a Power BI report to a PDF file using a powershell script.&amp;nbsp; &amp;nbsp;The report exports fine when I leave out the powerBIReportConfiguration portion, but I get blank pages when I try to use an RLS role.&amp;nbsp; This makes me feel like I am doing it wrong.&amp;nbsp; Any help is appreciated.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    $body = '{"format":"PDF", 
              "powerBIReportConfiguration" : {"identities": [{ "username": "'+$user+ '",
                                                              "roles": [ "'+$role+'" ],
                                                              "datasets": [ "'+$datasetID+'" ]
                                                             }]
                                               }
              }'
    $url = "https://api.powerbi.com/v1.0/myorg/groups/"+$workspaceID+"/reports/"+$reportID+"/ExportTo"
    $export = Invoke-PowerBIRestMethod -Method POST -Url $url -Body $body -ContentType application/json | ConvertFrom-Json
    $exportID = $export.id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 23:06:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Powershell-API-Export-to-File-with-RLS-applied/m-p/997326#M22868</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-29T23:06:28Z</dc:date>
    </item>
  </channel>
</rss>

