Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Neehar
Helper I
Helper I

PowerBIEntityNotFound - Microsoft.PowerBI.Api.V2.ExportReportWithHttpMessagesAsync

Hello,

 

I'm trying to copy the Power BI reports in the workspaces from one tenant to another tenant. 

 

I have used the service principal authentication for getting the token.

 

once I get the token I have followed the below steps.

 

Step 1

//Exporting the report into the memory stream.

MemoryStream destination = new MemoryStream();
powerbiclient.Reports.ExportReportWithHttpMessagesAsync(ReportId).Result.Body.CopyTo(destination);

 

Step 2

//converting to ByteArray

byte[] byteArray = destination.ToArray();

 

Step 3

//posting the byteArray  to the power bi API

https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/imports?datasetDisplayName={datasetDisplayNa...

 

Everything was working fine in the dev environment.

 

But in the prod environment, I'm facing the issue in the step1 while exporting the report to the memory stream using 

ExportReportWithHttpMessagesAsync

 

It says 

{"error":{"code":"PowerBIEntityNotFound","pbi.error":{"code":"PowerBIEntityNotFound","parameters":{},"details":[],"exceptionCulprit":1}}}

 

Note that I have also given the below API permissions.

Dataset.Read.All
Dataset.ReadWrite.All
Report.Read.All
Report.ReadWrite.All

 

 

Please Help.

 

Thanks | Neehar

 

 

1 REPLY 1
lbendlin
Super User
Super User

If you have a Pro license you can consider raising a Pro ticket at https://powerbi.microsoft.com/en-us/support/pro/

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors