<?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: Programmatically enter missing dataset credentials using API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/942553#M22407</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you any update ? If my replay helps you please mark as accepted&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Feb 2020 10:33:27 GMT</pubDate>
    <dc:creator>Jayendran</dc:creator>
    <dc:date>2020-02-21T10:33:27Z</dc:date>
    <item>
      <title>Programmatically enter missing dataset credentials using API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/877900#M21756</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am leveraging the REST API's to invoke a Dataset Takeover and Update Parameters method, however as the new owner is different to the original/publishing owner the dataset requires updated credentials before it can be refreshed. Currently I have to manually enter the missing credentials to enable a refresh.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;Data source error&lt;/SPAN&gt;:&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;It looks like scheduled refresh failed because at least one data source is missing credentials. To start the refresh again, go to this dataset's settings page and enter credentials for all data sources.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;Cluster URI&lt;/SPAN&gt;:&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;WABI-NORTH-EUROPE-redirect.analysis.windows.net&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;Activity ID&lt;/SPAN&gt;:&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;00000000-0000-0000-0000-000000000000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;Request ID&lt;/SPAN&gt;:&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;e9498bc8-a818-4d27-9b35-06a4b0e94582&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;Time&lt;/SPAN&gt;:&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;2019-12-17 13:58:44Z&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My objective is to programatically script all these steps avoiding manual steps. The dataset does not use any gateways and only contains a single Azure SQL Database datasource. Is this feasible with current version of API's?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tim.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 17:05:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/877900#M21756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-17T17:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically enter missing dataset credentials using API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/887972#M21883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use my Powershell script to update the data source credentials. This powershell script is internally calling PowerBI REST API's&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can read the &lt;A href="https://social.technet.microsoft.com/wiki/contents/articles/53172.azuredevops-cicd-for-powerbi-reports.aspx" target="_blank" rel="noopener"&gt;full article here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;## Take Over DataSet

Invoke-PowerBIRestMethod -Url "groups/$($workspace.id)/datasets/$($datasetid)/Default.TakeOver" -Method Post

## update data source credentials

$BounGateway=Invoke-PowerBIRestMethod -Url "groups/$($workspace.id)/datasets/$($datasetid)/Default.GetBoundGatewayDataSources" -Method GET | ConvertFrom-Json


$UpdateUserCredential = @{
            credentialType ="Basic"
            basicCredentials = @{            
            username= $username
            password= "$(credentialpassword)"
            }
} | ConvertTo-Json



Invoke-PowerBIRestMethod -Url "gateways/$($BounGateway.value.gatewayId)/datasources/$($BounGateway.value.id)" -Method PATCH -Body $UpdateUserCredential | ConvertFrom-Json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Download the full source &lt;A href="https://gallery.technet.microsoft.com/AzureDevOps-CICD-for-fefd58b8" target="_blank" rel="noopener"&gt;code from here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 13:15:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/887972#M21883</guid>
      <dc:creator>Jayendran</dc:creator>
      <dc:date>2020-01-02T13:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically enter missing dataset credentials using API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/894873#M21955</link>
      <description>&lt;P&gt;Thank you for your response Jay. I forgot to add that my dataset is owned by a service principal (SPN) rather than a user principal. Is this approach still feasible?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 11:32:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/894873#M21955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-09T11:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically enter missing dataset credentials using API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/894909#M21957</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes using SPN is feasable, infact if you read &lt;A href="https://social.technet.microsoft.com/wiki/contents/articles/53172.azuredevops-cicd-for-powerbi-reports.aspx" target="_blank" rel="noopener"&gt;my article&amp;nbsp;&lt;/A&gt;I've used SPN for the same&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 12:12:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/894909#M21957</guid>
      <dc:creator>Jayendran</dc:creator>
      <dc:date>2020-01-09T12:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically enter missing dataset credentials using API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/942553#M22407</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you any update ? If my replay helps you please mark as accepted&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 10:33:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Programmatically-enter-missing-dataset-credentials-using-API/m-p/942553#M22407</guid>
      <dc:creator>Jayendran</dc:creator>
      <dc:date>2020-02-21T10:33:27Z</dc:date>
    </item>
  </channel>
</rss>

