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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.