<?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 Reimporting a pbix file In Embedded workspace in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Reimporting-a-pbix-file-In-Embedded-workspace/m-p/163870#M5479</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I imported a pbix file which is in Direct Query Mode using provision sample and it worked fine. I get a reportId and DatasetId for this report. I hardcode the reportid for this pbix in an web application. Now I want to re upload a new version of the pbix while keeping the same ReportId. I used the provision sample again and use import with same dataset name but it creates a new report with a new dataset and reportid. How can I replace existing one?&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2017 03:13:53 GMT</pubDate>
    <dc:creator>kunal105</dc:creator>
    <dc:date>2017-04-25T03:13:53Z</dc:date>
    <item>
      <title>Reimporting a pbix file In Embedded workspace</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Reimporting-a-pbix-file-In-Embedded-workspace/m-p/163870#M5479</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I imported a pbix file which is in Direct Query Mode using provision sample and it worked fine. I get a reportId and DatasetId for this report. I hardcode the reportid for this pbix in an web application. Now I want to re upload a new version of the pbix while keeping the same ReportId. I used the provision sample again and use import with same dataset name but it creates a new report with a new dataset and reportid. How can I replace existing one?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 03:13:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Reimporting-a-pbix-file-In-Embedded-workspace/m-p/163870#M5479</guid>
      <dc:creator>kunal105</dc:creator>
      <dc:date>2017-04-25T03:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reimporting a pbix file In Embedded workspace</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Reimporting-a-pbix-file-In-Embedded-workspace/m-p/164240#M5491</link>
      <description>&lt;P&gt;I went through this and I found that you must delete the dataset with that dataset ID which effectively deletes everything about the previous PBIX upload including the report and the dataset which both have the same ID. Here's the method I wrote to delete the previous PBIX resources before I upload the new version of the same PBIX file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; static void DeleteDataset(string workspaceCollectionName, string workspaceId, string datasetId) {
      using (var client = CreatePowerBIClient()) {
        var datasets = client.Datasets.GetDatasetsAsync(workspaceCollectionName, workspaceId).Result.Value;
        foreach (var dataset in datasets) {
          if (dataset.Name.Equals(datasetId)){
            Console.WriteLine("Deleting dataset named " + dataset.Name + " with ID of " + dataset.Name + "...");
            client.Datasets.DeleteDatasetByIdAsync(workspaceCollectionName, workspaceId, dataset.Id).Wait();
          }
        }
      }      
    }&lt;/PRE&gt;&lt;P&gt;If you want to see all the code I wrote to&amp;nbsp;publish PBIX files to Power BI Embedded, you can check out this GITHUB repo and look at the &lt;STRONG&gt;program.cs&lt;/STRONG&gt; file in the project named&amp;nbsp;&lt;STRONG&gt;PBIEmbeddedDemo_Provisioning&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/CriticalPathTraining/PowerBiEmbedded" target="_self"&gt;https://github.com/CriticalPathTraining/PowerBiEmbedded&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 13:12:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Reimporting-a-pbix-file-In-Embedded-workspace/m-p/164240#M5491</guid>
      <dc:creator>TedPattison</dc:creator>
      <dc:date>2017-04-25T13:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reimporting a pbix file In Embedded workspace</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Reimporting-a-pbix-file-In-Embedded-workspace/m-p/164858#M5508</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/11675"&gt;@kunal105&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There's an argument &lt;/SPAN&gt;&lt;EM&gt;nameconfilict&lt;/EM&gt;&lt;SPAN&gt; for &lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.powerbi.api.v1.importsextensions.postimportwithfileasync?view=powerbiapi-1.1.10#Microsoft_PowerBI_Api_V1_ImportsExtensions_PostImportWithFileAsync_Microsoft_PowerBI_Api_V1_IImports_System_String_System_String_System_IO_Stream_System_String_System_String_System_Threading_CancellationToken_" target="_self" rel="nofollow noopener noreferrer noopener noreferrer"&gt;PostImportWithFileAsync&lt;/A&gt;&lt;SPAN&gt;, and as per&amp;nbsp;&lt;/SPAN&gt;&lt;A title="" href="https://github.com/Microsoft/PowerBI-CSharp/blob/master/sdk/PowerBI.Api.Tests/ImportsTests.cs" target="_self" rel="nofollow noopener noreferrer noopener noreferrer"&gt;this github sample&lt;/A&gt;&lt;SPAN&gt;, the argument value "&lt;/SPAN&gt;&lt;SPAN&gt;Overwrite&lt;/SPAN&gt;&lt;SPAN&gt;" can be used&amp;nbsp;to overwrite&amp;nbsp;the existing pbix file. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The report id doesn't change in a overwritten import, thus it won't affect the report embedded somewhere in your application.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 09:52:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Reimporting-a-pbix-file-In-Embedded-workspace/m-p/164858#M5508</guid>
      <dc:creator>v-ljerr-msft</dc:creator>
      <dc:date>2017-04-26T09:52:57Z</dc:date>
    </item>
  </channel>
</rss>

