<?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 Failed to update data model parameters - using new October update way to change connection string in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1573482#M17293</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to change the connection string using parameters, as described on this page:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/report-server/connect-data-source-apis" target="_blank" rel="noopener"&gt;Change data source connection strings with PowerShell - Power BI | Microsoft Docs.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I create a new Power BI report, everything works fine and I am able to modify the parameter (and thus the connection string).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when adding a parameter to an existing Power BI report, I am not able to modify the value and get the following error message:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Failed to update data model parameters for [report path] The remote server returned an error: (500) Internal Server Error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As described on the page, I first get the parameters with the Get-RsRestItemDataModelParameters function, then I modify the value and I use Set-RsRestItemDataModelParameters to apply to the report server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Report server version:&amp;nbsp;9.7627.11028 (October 2020)&lt;/P&gt;&lt;P&gt;ReportingServicesTools PowerShell module : 0.0.5.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help is very much appreciated,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Martin B.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Dec 2020 14:07:21 GMT</pubDate>
    <dc:creator>Martin51</dc:creator>
    <dc:date>2020-12-29T14:07:21Z</dc:date>
    <item>
      <title>Failed to update data model parameters - using new October update way to change connection string</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1573482#M17293</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to change the connection string using parameters, as described on this page:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/report-server/connect-data-source-apis" target="_blank" rel="noopener"&gt;Change data source connection strings with PowerShell - Power BI | Microsoft Docs.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I create a new Power BI report, everything works fine and I am able to modify the parameter (and thus the connection string).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when adding a parameter to an existing Power BI report, I am not able to modify the value and get the following error message:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Failed to update data model parameters for [report path] The remote server returned an error: (500) Internal Server Error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As described on the page, I first get the parameters with the Get-RsRestItemDataModelParameters function, then I modify the value and I use Set-RsRestItemDataModelParameters to apply to the report server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Report server version:&amp;nbsp;9.7627.11028 (October 2020)&lt;/P&gt;&lt;P&gt;ReportingServicesTools PowerShell module : 0.0.5.9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help is very much appreciated,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Martin B.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 14:07:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1573482#M17293</guid>
      <dc:creator>Martin51</dc:creator>
      <dc:date>2020-12-29T14:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to update data model parameters - using new October update way to change connection string</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1573581#M17296</link>
      <description>&lt;P&gt;Please confirm if you are working with Power BI Report Server or with the regular Power BI Service.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Service: Try doing the same call in the Power BI API sandbox.&amp;nbsp; If that works, use the basic&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.1" target="_blank"&gt;Invoke-RestMethod (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;or&amp;nbsp; the slightly more luxurious&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.profile/invoke-powerbirestmethod?view=powerbi-ps" target="_blank"&gt;Invoke-PowerBIRestMethod (MicrosoftPowerBIMgmt.Profile) | Microsoft Docs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;instead of your cmdlets.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 15:11:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1573581#M17296</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-12-29T15:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to update data model parameters - using new October update way to change connection string</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1573633#M17297</link>
      <description>&lt;P&gt;I am working with the on-premises Power BI report server. I am now using the Invoke-RestMethod. I get an error but without any message:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Invoke-RestMethod : {"error":{"code":"0","message":""}}.&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Dec 2020 15:45:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1573633#M17297</guid>
      <dc:creator>Martin51</dc:creator>
      <dc:date>2020-12-29T15:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to update data model parameters - using new October update way to change connection string</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1576900#M17322</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="277818" data-lia-user-login="Martin51" class="lia-mention lia-mention-user"&gt;Martin51&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;How did you set up your parameter, you should have a list of names under Server Name and Database Name (the doc didn't mention), so you can edit parameter to switch between servers and databases. You can took a look at the desktop parameter that is same as&amp;nbsp;Desktop for Report Server, this blog explains&amp;nbsp;parameter in detail:&amp;nbsp;&lt;A href="https://www.mssqltips.com/sqlservertip/4475/using-parameters-in-power-bi/" target="_blank"&gt;Using Parameters in Power BI (mssqltips.com).&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Paul Zheng _ Community Support Team&lt;BR /&gt;If this post helps, please Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2021 02:53:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1576900#M17322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-01T02:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to update data model parameters - using new October update way to change connection string</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1586552#M17396</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not using a list of values but just a default value. This parameter is used as connection string in the data source settings. I would like to programatically change the value via PowerShell , in order to modify the connection string during deployment to another environment. I have now more information about the error, this is what the report server logs shows:&amp;nbsp;An item with the same key has already been added.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2021-01-07 16:17:57.8626|INFO|572|Received request POST /api/v2.0/PowerBIReports(Path='/TestReport')/DataModelParameters| RequestID = s_adfa12bb-a254-4bac-bdc9-41dd77cb36d7&lt;BR /&gt;2021-01-07 16:17:58.7062|ERROR|515|OData exception occurred: System.ArgumentException: An item with the same key has already been added.&lt;BR /&gt;at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)&lt;BR /&gt;at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)&lt;BR /&gt;at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)&lt;BR /&gt;at Microsoft.ReportingServices.Portal.Repositories.CatalogItemRepository.SetDataModelDataSourcesTrusted(IPrincipal userPrincipal, Guid itemId, IEnumerable`1 dataSources, Boolean isOverwrite)&lt;BR /&gt;at Microsoft.ReportingServices.Portal.ODataWebApi.V2.Controllers.PowerBIReportsController.&amp;lt;PostDataModelParameters&amp;gt;d__33.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at System.Threading.Tasks.TaskHelpersExtensions.&amp;lt;CastToObject&amp;gt;d__1`1.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at System.Web.Http.Controllers.ApiControllerActionInvoker.&amp;lt;InvokeActionAsyncCore&amp;gt;d__1.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at System.Web.Http.Controllers.ActionFilterResult.&amp;lt;ExecuteAsync&amp;gt;d__5.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&lt;BR /&gt;at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;at System.Web.Http.Controllers.ExceptionFilterResult.&amp;lt;ExecuteAsync&amp;gt;d__6.MoveNext().| RequestID = s_adfa12bb-a254-4bac-bdc9-41dd77cb36d7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 16:00:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Failed-to-update-data-model-parameters-using-new-October-update/m-p/1586552#M17396</guid>
      <dc:creator>Martin51</dc:creator>
      <dc:date>2021-01-07T16:00:32Z</dc:date>
    </item>
  </channel>
</rss>

