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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nguyen-tr-ea-89
Frequent Visitor

Power API export image error: “couldn't load the model schema associated with this report”

We are trying to use Power BI API to export our reports as .PNG images.

 

We use a Service Principal as authentication to the API. The Service Principal is able to make API calls fine, but the exported images show the error message “couldn't load the model schema associated with this report. make sure you have a connection to the server, and try again”.

exported images show errorexported images show error

 

 

In Service, we connect the reports to our Azure SQL Managed Instance via on-prem gateway connection with OAuth authentication. Our reports use DirectQuery connection to pull data from our Azure SQL Database. The exported images work properly for Import connection, but there seems to be a problem when using DirectQuery.

 

 

Maybe there's something in Tenant settings that we need enabled?. Any suggestions are appreciated.

 

 

Things we have tried:

  • Service Principal is added to the workspace as "Contributor"
  • Service Principal is added as an user of the gateway connection
  • Service Principal is given db reader permissions to our SQL Database (we tested the connection from SP to SQL Database in Azure Data Factory and it was able to pull data)

 

2 REPLIES 2
VN999
Resolver I
Resolver I


Refresh the dataset in Power BI Service and check for any refresh errors.
Review and verify all data sources connections and queries in Power BI Desktop.
Republish the report to Power BI Service and test the export functionality again.
Check Power BI Service health status for any ongoing issues or maintenance

Thanks for the response! I tried your suggestions and it didn't work.

I do have a few things to ask:
* It seems I can provide an OAuth 2.0 access token for Azure SQL in the body of the API call ExportToFileInGroup. I hyperlinked the doc, please give me your thoughts. I tried providing the access token but the images still show the error. 
* Maybe I need to grant the Service Principal these API permissions: Dashboard.Read.All, Report.Read.All, Dataset.Read.All?
* There's also something called Service principal profiles in Power BI Embedded, is this relevant to resolve the problem?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.