<?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: Update Datasource and Refresh using Service Principal in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3303916#M43253</link>
    <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/409836"&gt;@bhushant&lt;/a&gt;&amp;nbsp;, sorry if my questions seems lame, just wanted to recheck- if you have implemented this using spn or master account.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;if SPN, my assumtpion is this will work through access token which gonna expire in one hour. so after one hour will the report refresh fail&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2023 08:40:03 GMT</pubDate>
    <dc:creator>vamshikrishna20</dc:creator>
    <dc:date>2023-06-27T08:40:03Z</dc:date>
    <item>
      <title>Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/2498994#M35946</link>
      <description>&lt;P&gt;I am working in a multi-tenancy setup where each tenant has their own database. I am uploading a pbix file to a workspace and then trying to update the datasource to the correct connection and refresh the data using the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can update the datasource fine by calling&amp;nbsp;&lt;STRONG&gt;client.Datasets.UpdateDatasourcesAsync&lt;/STRONG&gt; on the&amp;nbsp;PowerBIClient. I pass in the UpdateDataSourcesRequest which contains a DatasourceConnectionDetails object, inside which is the server and database details. This succeeds however when I then call&amp;nbsp;&lt;STRONG&gt;client.Datasets.RefreshDatasetAsync&lt;/STRONG&gt; to refresh the data, I get an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; It looks like scheduled refresh failed because at least one data source is missing credentials. &lt;BR /&gt; To start the refresh again, go to this dataset's settings page and enter credentials for all data sources.&lt;/PRE&gt;&lt;P&gt;The issue appears to be the dataset is "owned" by the service principal. If I login and take over it, then refresh, it works. My aim is to be able to upload these pbix files to tenants and update to the correct datasource using the principal. Is this possible or will I have to use a master user for this instead?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 15:09:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/2498994#M35946</guid>
      <dc:creator>JAnder</dc:creator>
      <dc:date>2022-05-06T15:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/2501611#M35978</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/322179"&gt;@JAnder&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; It looks like scheduled refresh failed because at least one data source is missing credentials. &lt;BR /&gt; To start the refresh again, go to this dataset's settings page and enter credentials for all data sources.&lt;/PRE&gt;
&lt;P&gt;According to your statement, please make sure you have configured credentials of your data source correctly in Power BI Service. If your data source need gateway to refresh, please add the credential to data source in gateway.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/connect-data/refresh-scheduled-refresh" target="_self"&gt;Configure scheduled refresh&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/connect-data/service-gateway-data-sources" target="_self"&gt;Add or remove a gateway data source&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 09:38:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/2501611#M35978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-09T09:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/2502583#M35991</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;Thanks for responding. This is all being done via the API so logging in and doing it using the Power BI portal is not really an option. The data source already exists and is in use elsewhere though, so I am confident the credentials are OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem seems to be&amp;nbsp; because I am uploading a pbix and switching the datasource connection string using the API, which uses the Service Principal. The service principal takes ownership and then cannot refresh. If I was to login and "take over" the dataset with an admin account it would refresh ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for ideas how to handle that with the API. The answer may just be I cant use the principal and need a master user?&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;</description>
      <pubDate>Mon, 09 May 2022 16:04:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/2502583#M35991</guid>
      <dc:creator>JAnder</dc:creator>
      <dc:date>2022-05-09T16:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/2624104#M37222</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/322179"&gt;@JAnder&lt;/a&gt;&amp;nbsp; and&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp; -&lt;/P&gt;&lt;P&gt;I am trying to solve similar problem. please let me know if you have found a workaround or solution&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please see my use-case below&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;Use Service Principal to connect Data Source [ Azure SQL DB , Azure Databricks Delta Lake]&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;When the PBIX is published to wokspace, using REST API - Takeover is performed and ownership is transfered to Service Principal [with admin access to workspace] [Ref: &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/take-over-in-group" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/take-over-in-group&lt;/A&gt;]&lt;/LI&gt;&lt;LI&gt;After Takeover, the Data Source credentials are required to be refreshed as well, as we are using Service Principal we have first obtain a Token and then using REST API authenticate Credentials -&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#oauth-2.0-credentials-example" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#oauth-2.0-credentials-example&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;After this Step - Embedded Report starts working and connection to Dat Source is sucessfull , but after the Token expiry the Report stops working&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Please can you let me know&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if these are the right steps to Authenticate / Update Credentials of Service Principal ?&lt;/LI&gt;&lt;LI&gt;Any other workaround to use Service Principal based Authentication to Data Source from PBI-Embedded&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help, Many Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 06:52:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/2624104#M37222</guid>
      <dc:creator>bhushant</dc:creator>
      <dc:date>2022-07-07T06:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3300797#M43219</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/409836"&gt;@bhushant&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/322179"&gt;@JAnder&lt;/a&gt;&amp;nbsp;, I have a similar use case to refresh datasets using SPN. please help me know if this got resolved&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2023 16:33:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3300797#M43219</guid>
      <dc:creator>vamshikrishna20</dc:creator>
      <dc:date>2023-06-24T16:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3301565#M43226</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/313869"&gt;@vamshikrishna20&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Using "Service Principal to Authenticate Data Source Credentials" , is still not supported. Power BI is unable to get RefreshToken for Service Principal after initial Authentication during Data Source Credentials update. As a work-around, I have implemented following&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Embedd Report using Service Principal or Master Account&lt;/LI&gt;&lt;LI&gt;Update Data Source Credentials&amp;nbsp;using Service Principal or Master Account&lt;/LI&gt;&lt;LI&gt;While Updating Data Source Credentials with OAUTH2.0 set this [&lt;SPAN&gt;useEndUserOAuth2Credentials&lt;/SPAN&gt;] to True,this will ensure EndUser AD credentials are used for Authenticating DataSource&amp;nbsp;&amp;nbsp;&lt;UL&gt;&lt;LI&gt;ref-&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#oauth-2.0-credentials-example" target="_blank"&gt;Gateways - Update Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;If the above param is not set to true,&amp;nbsp;Service Principal or Master Account credentials/token is stored in connection, this token will expire after few hrs based on Service Principal or Master Account AD config&lt;/LI&gt;&lt;LI&gt;To render / load PBI report in Application using iframe, I am using a Master Account as ServicePrincipals can not be assigned PBI licenses&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope this will help you, I think with MS Fabric there are changes expected in the REST API and AUTH process&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 04:55:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3301565#M43226</guid>
      <dc:creator>bhushant</dc:creator>
      <dc:date>2023-06-26T04:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3302277#M43235</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/409836"&gt;@bhushant&lt;/a&gt;&amp;nbsp;, will this option also works for Direct Query also ?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 11:29:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3302277#M43235</guid>
      <dc:creator>vamshikrishna20</dc:creator>
      <dc:date>2023-06-26T11:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3302583#M43237</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/313869"&gt;@vamshikrishna20&lt;/a&gt;&amp;nbsp;- Yes, this will work for Direct Query as well , I have used this method for Direct Query connection to Azure Databricks Unity Catallog tables, Azure SQL Server Tables , ADLS Gen2 files&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 14:15:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3302583#M43237</guid>
      <dc:creator>bhushant</dc:creator>
      <dc:date>2023-06-26T14:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3303916#M43253</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/409836"&gt;@bhushant&lt;/a&gt;&amp;nbsp;, sorry if my questions seems lame, just wanted to recheck- if you have implemented this using spn or master account.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;if SPN, my assumtpion is this will work through access token which gonna expire in one hour. so after one hour will the report refresh fail&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 08:40:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3303916#M43253</guid>
      <dc:creator>vamshikrishna20</dc:creator>
      <dc:date>2023-06-27T08:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3303934#M43254</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/313869"&gt;@vamshikrishna20&lt;/a&gt;&amp;nbsp;-I have implemented this using Master-Account [AzureAD user],where the master account user will have permissions on to query data on data sources.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 08:51:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3303934#M43254</guid>
      <dc:creator>bhushant</dc:creator>
      <dc:date>2023-06-27T08:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update Datasource and Refresh using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3304292#M43257</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/409836"&gt;@bhushant&lt;/a&gt;&amp;nbsp;, do we have any documentation from microsoft or what was the turning point for you to switch from spn authentication to master account authentication.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also, to run the CD pipeline with Master account, do we have to set any permission in Azure Portal?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 12:40:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Update-Datasource-and-Refresh-using-Service-Principal/m-p/3304292#M43257</guid>
      <dc:creator>vamshikrishna20</dc:creator>
      <dc:date>2023-06-27T12:40:31Z</dc:date>
    </item>
  </channel>
</rss>

