Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Overwrite report when copy/clone via powershell or API?

I am setting up an ops process for elevating reports and I would like to use PowerShell to automate some of the steps, however I have found that the Copy/Clone functions of the Powershell and API seem to duplicate the report instead of overwriting when copying between workspaces. The dataset can be ignored or overwritten but the report seems to always duplicate. Has anyone successfully copied a report between workspaces without duplicating? I am hesitant to delete the original report before copy as I think that will break Dashboards and permissions?

The theory is that we will have three workspaces, OpsGroup1_Dev, OpsGroup1_Test, and OpsGroup1 where we push the Dev report either via the Desktop or PowerShell, then copy the report to Test/Prod as park of an elevation (like OctoDeploy or similar).

7 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for the suggestion Xiaoxin. I have followed that guide, and can move datasets (or pbix with embedded datasets) around without duplicating.

       

      My issue now is with .pbix files without embedded datasets (i.e. ones built when directly connected to a cloud dataset). I can import these with my previous code to the workspace of the associated dataset, however the code fails when uploading to a different workspace. If I try Cloning by first uploading to the initial workspace then cloning to the new workspace I get duplicates if the report already exists in the target space. The comments in section 4 (Cloning) of the referenced article seem to indicate that Cloning is the only way to move a report if the dataset exists, but that causes me issues. I don't think I should delete the report in the target workspace first as that might remove Dashboards and permissions?

       

      Maybe I am going about this the wrong way or am missing something with the PowerBI service... How should reports flow through DEV/TEST/PROD in an enterprise environment? I envision having a dataset upon which many reports may be built (and then extended to Dashboards), and I'd like to have an automated process that "deploys" a report to PROD as opposed to manually using the desktop to repoint the dataset and republishing.