We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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?
Solved! Go to Solution.
Hi @kunal105,
There's an argument nameconfilict for PostImportWithFileAsync, and as per this github sample, the argument value "Overwrite" can be used to overwrite the existing pbix file.
The report id doesn't change in a overwritten import, thus it won't affect the report embedded somewhere in your application. ![]()
Regards
Hi @kunal105,
There's an argument nameconfilict for PostImportWithFileAsync, and as per this github sample, the argument value "Overwrite" can be used to overwrite the existing pbix file.
The report id doesn't change in a overwritten import, thus it won't affect the report embedded somewhere in your application. ![]()
Regards
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.
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();
}
}
}
}If you want to see all the code I wrote to publish PBIX files to Power BI Embedded, you can check out this GITHUB repo and look at the program.cs file in the project named PBIEmbeddedDemo_Provisioning.
https://github.com/CriticalPathTraining/PowerBiEmbedded
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |