<?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 Using PowerShell to get PowerBI SQL connection strings in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Using-PowerShell-to-get-PowerBI-SQL-connection-strings/m-p/2761837#M38594</link>
    <description>&lt;P&gt;Looking for an automated way to identify all SQL sources for a PowerBI dataset. Would like a way in PowerShell to get a list of connections for a PowerBI Dataset, then for each connection get&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;the SQL statement&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(query text found under the 'Advanced Options' in PBI desktop).&amp;nbsp; Shown here in red:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Untitled.png" style="width: 200px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/781951iB5D96C054B19CE73/image-size/small?v=v2&amp;amp;px=200" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;MicrosoftPowerBIMgmt Get-PowerBIDatasource function&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;as well as the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Power BI REST API for Get Datasources&lt;/EM&gt;&lt;/STRONG&gt;. These both include the 'server' and 'database' fields that are found on the connection setup screen, but do not include the actual query text.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternately, if a connection does not include SQL query text, would there be a way to access the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Navigate' step &lt;/STRONG&gt;in the&lt;STRONG&gt; 'Applied Steps'&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the SQL query text or text from the 'Navigate' step I can then parse the text as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or suggestions would be appreciated!&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2022 12:16:36 GMT</pubDate>
    <dc:creator>aWalsh523</dc:creator>
    <dc:date>2022-09-12T12:16:36Z</dc:date>
    <item>
      <title>Using PowerShell to get PowerBI SQL connection strings</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-PowerShell-to-get-PowerBI-SQL-connection-strings/m-p/2761837#M38594</link>
      <description>&lt;P&gt;Looking for an automated way to identify all SQL sources for a PowerBI dataset. Would like a way in PowerShell to get a list of connections for a PowerBI Dataset, then for each connection get&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;the SQL statement&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(query text found under the 'Advanced Options' in PBI desktop).&amp;nbsp; Shown here in red:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Untitled.png" style="width: 200px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/781951iB5D96C054B19CE73/image-size/small?v=v2&amp;amp;px=200" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;MicrosoftPowerBIMgmt Get-PowerBIDatasource function&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;as well as the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Power BI REST API for Get Datasources&lt;/EM&gt;&lt;/STRONG&gt;. These both include the 'server' and 'database' fields that are found on the connection setup screen, but do not include the actual query text.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternately, if a connection does not include SQL query text, would there be a way to access the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Navigate' step &lt;/STRONG&gt;in the&lt;STRONG&gt; 'Applied Steps'&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the SQL query text or text from the 'Navigate' step I can then parse the text as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or suggestions would be appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 12:16:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-PowerShell-to-get-PowerBI-SQL-connection-strings/m-p/2761837#M38594</guid>
      <dc:creator>aWalsh523</dc:creator>
      <dc:date>2022-09-12T12:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using PowerShell to get PowerBI SQL connection strings</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-PowerShell-to-get-PowerBI-SQL-connection-strings/m-p/2762922#M38600</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/440523"&gt;@aWalsh523&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;AFAIk, current you can't directly get the advanced SQL statement from the data connector by rest API.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;It should be more suitable to trace these on the database side or you can consider parameterized t-sql string with query parameters, then you can use the rest API to get query parameters to get detailed t-sql queries.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Using-the-Power-BI-Service-Parameters-to-change-connection/ba-p/392016" target="_self"&gt;Using the Power BI Service Parameters to change connection strings (To possibly change between Dev&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    source=Sql.Database("server", "database",[Query=SQLParameter])
in 
    source&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/get-parameters" target="_blank"&gt;Datasets - Get Parameters - REST API (Power BI Power BI REST APIs) | Microsoft Docs&lt;/A&gt;&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>Tue, 13 Sep 2022 01:52:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-PowerShell-to-get-PowerBI-SQL-connection-strings/m-p/2762922#M38600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T01:52:44Z</dc:date>
    </item>
  </channel>
</rss>

