<?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 Can't update dataset parameter programmatically in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Can-t-update-dataset-parameter-programmatically/m-p/1426472#M26072</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;we're using the C# SDK (Microsoft.PowerBI.Api.V2)&amp;nbsp; to automate the process of creating new workspaces with a single dataset/report by cloning an existing one (kind of like a template). The datasource is a web endpoint, and it uses a paramter which needs to be upated for the new dataset.&amp;nbsp; Unfortunately that last step returns a forbiden error (operation is only supported for the dataset owner), which makes no sense because the operation is being run under the same account that creates the dataset to begin with.&amp;nbsp; Here are the steps we're taking&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a new instance of the&amp;nbsp;&amp;nbsp;PowerBIClient class using the app registration accoutn details (works)&lt;/LI&gt;&lt;LI&gt;Create a new workspace (works)&lt;/LI&gt;&lt;LI&gt;Get the template dataset and "clone it" into the new workspace. This is done by reading the file and using the&amp;nbsp;&amp;nbsp;PostImportWithFileAsyncInGroup function (works)&lt;/LI&gt;&lt;LI&gt;Ge the new dataset's name&amp;nbsp;(works)&lt;/LI&gt;&lt;LI&gt;Use the&amp;nbsp;UpdateParametersAsync function to update the paramter so it points to a different datasource (fails, forbbiden error)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var paramRequest = new UpdateDatasetParametersRequest(new UpdateDatasetParameterDetails("paramName", "paramValue"));
await client.Datasets.UpdateParametersAsync(group.Id, newDataset.Name, paramRequest);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Not sure if I'm missing something obvious, but it makes little sense that the account that's creating the dataset in the firstplace, can't update the parameter because of permissions.&amp;nbsp; &amp;nbsp;If I navigate to the PowerBI App and check the new dataset access, it show the app registration as the owner.&amp;nbsp; If I check the dataset settings, some of the options (including the parameters section) are disabled because "This dataset has been configured by AppRegistrationName (App ID: 00000-0000-0000-0000-00000000). Would you like to take over the settings?"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's a clear indication that the app registration account is indeed the owner of that dataset, which also happens to be the account that runs the whole process, so why would I get a forbidden error??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated&lt;/P&gt;</description>
    <pubDate>Sun, 11 Oct 2020 19:30:23 GMT</pubDate>
    <dc:creator>Dres</dc:creator>
    <dc:date>2020-10-11T19:30:23Z</dc:date>
    <item>
      <title>Can't update dataset parameter programmatically</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Can-t-update-dataset-parameter-programmatically/m-p/1426472#M26072</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;we're using the C# SDK (Microsoft.PowerBI.Api.V2)&amp;nbsp; to automate the process of creating new workspaces with a single dataset/report by cloning an existing one (kind of like a template). The datasource is a web endpoint, and it uses a paramter which needs to be upated for the new dataset.&amp;nbsp; Unfortunately that last step returns a forbiden error (operation is only supported for the dataset owner), which makes no sense because the operation is being run under the same account that creates the dataset to begin with.&amp;nbsp; Here are the steps we're taking&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a new instance of the&amp;nbsp;&amp;nbsp;PowerBIClient class using the app registration accoutn details (works)&lt;/LI&gt;&lt;LI&gt;Create a new workspace (works)&lt;/LI&gt;&lt;LI&gt;Get the template dataset and "clone it" into the new workspace. This is done by reading the file and using the&amp;nbsp;&amp;nbsp;PostImportWithFileAsyncInGroup function (works)&lt;/LI&gt;&lt;LI&gt;Ge the new dataset's name&amp;nbsp;(works)&lt;/LI&gt;&lt;LI&gt;Use the&amp;nbsp;UpdateParametersAsync function to update the paramter so it points to a different datasource (fails, forbbiden error)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var paramRequest = new UpdateDatasetParametersRequest(new UpdateDatasetParameterDetails("paramName", "paramValue"));
await client.Datasets.UpdateParametersAsync(group.Id, newDataset.Name, paramRequest);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Not sure if I'm missing something obvious, but it makes little sense that the account that's creating the dataset in the firstplace, can't update the parameter because of permissions.&amp;nbsp; &amp;nbsp;If I navigate to the PowerBI App and check the new dataset access, it show the app registration as the owner.&amp;nbsp; If I check the dataset settings, some of the options (including the parameters section) are disabled because "This dataset has been configured by AppRegistrationName (App ID: 00000-0000-0000-0000-00000000). Would you like to take over the settings?"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's a clear indication that the app registration account is indeed the owner of that dataset, which also happens to be the account that runs the whole process, so why would I get a forbidden error??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated&lt;/P&gt;</description>
      <pubDate>Sun, 11 Oct 2020 19:30:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Can-t-update-dataset-parameter-programmatically/m-p/1426472#M26072</guid>
      <dc:creator>Dres</dc:creator>
      <dc:date>2020-10-11T19:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can't update dataset parameter programmatically</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Can-t-update-dataset-parameter-programmatically/m-p/1428406#M26081</link>
      <description>&lt;P&gt;A couple weeks back there was a fantastic Power BI Dev Camp that talked about this in great depth.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 14:48:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Can-t-update-dataset-parameter-programmatically/m-p/1428406#M26081</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-10-12T14:48:04Z</dc:date>
    </item>
  </channel>
</rss>

