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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Microsoft.PowerBI.API issues - PowerBIReportExportConfiguration - MethodNotAllowed

Good morning all,

 

     On Wednesday, 5/4, our API report generator started returning Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'MethodNotAllowed' when we are requesting an ExportID.  The script that we are using below is what is running.

private static async Task<string> PostPowerBIExportRequest(Guid groupId, Guid reportId, PowerBIClient client)
        {
            Console.WriteLine("The PowerBI Export Request has fired.");

            var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration
            {
                Settings = new ExportReportSettings
                {
                    Locale = "en-us",
                },

            };
            var exportRequest = new ExportReportRequest
            {
                Format = FileFormat.PDF,
                PowerBIReportConfiguration = powerBIReportExportConfiguration,
            };

            try
            {
                var export = await client.Reports.ExportToFileInGroupAsync(groupId, reportId, exportRequest);

                return export.Id;
            }
            catch (Exception e)
            {
                Console.WriteLine("PowerBIExportConfiguration step has failed.");
                Console.WriteLine(e.ToString());
                return "Failure";
            }
        }

 

Please let me know what steps to take to remedy this outage.

 

Thank you,

J.R.

1 ACCEPTED SOLUTION
AmosHersch
Microsoft Employee
Microsoft Employee

Hi,

 

Exporting a report using the API is not supported on Gen1 capacities anymore. I assume this is why you started getting the error.

Please try upgrading your capacity to Gen2, or assign the workspace to a different capacity which is Gen2.

View solution in original post

3 REPLIES 3
S19K15
Regular Visitor

Even you are running on Gen2, it will not work if you have set workspace with "Large Semantic Model" which you can select if workspace is in a capacity.

Anonymous
Not applicable

Thank you, AmosHersch,

 

Upgrading to Gen2 has resolved my issue.

AmosHersch
Microsoft Employee
Microsoft Employee

Hi,

 

Exporting a report using the API is not supported on Gen1 capacities anymore. I assume this is why you started getting the error.

Please try upgrading your capacity to Gen2, or assign the workspace to a different capacity which is Gen2.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.