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
gah113
Advocate I
Advocate I

ExportToFileInGroupAsync Fails with 400 Error (Bad Request)

I am building a .NET application to export Power BI reports hosted on an Azure capacity. The following code fails with a 400 Error (Bad Request) without any information:

 

var reportId = Guid.Parse(powerBiDashboardConfig.ReportId);
var datasetId = Guid.Parse(powerBiDashboardConfig.DatasetId);
var groupId = Guid.Parse(powerBiDashboardConfig.WorkspaceId);

// Set the export configuration properties:
var exportConfiguration = new PowerBIReportExportConfiguration
                          {
                               Settings = new ExportReportSettings
                                    {
                                        Locale = "en-us",
                                        IncludeHiddenPages = true                                        
                                    }
                                };
var exportReportRequest = new ExportReportRequest 
                          {
                               Format = FileFormat.PDF,
                               PowerBIReportConfiguration = exportConfiguration
                                };

// Send the export request:
var export = (await client.Reports.ExportToFileInGroupWithHttpMessagesAsync(groupId, reportId, exportReportRequest)).Body;

 

I have tried making this call manually and the export to PDF works as expected.

5 REPLIES 5
AmosHersch
Microsoft Employee
Microsoft Employee

Hi @gah113 ,

Is the report you're exporting a Power BI (PBIX) report or a Paginated (RDL) report?

Assuming it's a PBIX report I suggest yoy try to see the response message body (using fiddler for example) to see if it contains information regarding the error reason.

The message body reads: "Export report requires effective identity to be provided for the report's dataset"

I have tried to send the exportRequest with an effectiveIdentity and the same error message is returned.

Note that no effective identity is required when manually sending requests to reports/{reportId}/ExportTo via the REST API.

AFAIK this error indicates that your report's dataset has RLS applied, so you must provide an effective identity for that dataset in the export request.

Are you sure you've sent the request with effective identity correctly? Did you specify the dataset ID and RLS parameters?

You can try to export a report with a dataset that doesn't have RLS applied and see that you don't get this error.

When you call the API manually you're not using a Service Principal probably, and hence you don't require to provide an effective identity.

@AmosHersch thanks for your help! We resolved the issue by specifying a dataset ID in the datasets property of the effective identity we were passing.

Any reason this property is required for Export but not for other calls using effective identity (e.g. GenerateToken)?

I would expect this property to be required also in GenerateToken request, especially when the request is from a Service Principal. It might work without an effective identity (or without the property) for a master user.

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.