0

I'm attempting to use the microsoft power BI API to export a report a PDF file version. I'm able to successfully authenticate power BI with azure and can get a bearer token before making this call.

The ExportToFileInGroupAsync(reportId, groupId, exportRequest) is throwing an Object reference not set to an instance of an object error. I've verified that the groupId and reportId are correct, if I missed that I would expect it to be a 404 error instead of simply crashing.

Has anyone encountered this before?

                var exportRequest = new ExportReportRequest
                {
                    Format = format
                };

                if(_currentAccessToken == null) 
                    await Authenticate();
                // The 'Client' object is an instance of the Power BI .NET SDK
                // fails here
                var export = await client.Reports.ExportToFileInGroupAsync(reportId, groupId, exportRequest);

                // Save the export ID, you'll need it for polling and getting the exported file
                return export.Id;
user1299379
  • 381
  • 2
  • 4
  • 13

0 Answers0