Forum Discussion
Fabric - Create Reports model via Microsoft Fabric API
- 1 year ago
Hi Anonymous,
The error here is likely caused by a manually modified .pbir or report.json file, or the semantic model is not being referenced in the exact format expected by the API.
So please switch back to the byConnection which you were using earlier since the Fabric REST API supports it.
And try the above steps which i mentioned earlier like re-export the report again using power bi desktop and connect to the live semantic model in the same Fabric workspace. Do not modify any of the generated files. Encode each file in Base64 and send it to the API.
This makes sure the byConnection block is generated correctly by the backend schema.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
Hi Anonymous,
Thank you for reaching out to Microsoft Fabric Community.
The issue here is that byConnection is currently not supported for the report deployment using the Microsoft Fabric REST API. The byConnection is valid in the .pbir files when opened in the power bi desktop, but the Fabric REST API requires byPath to properly bind the report to an existing semantic model during deployment.
Try to use byPath instead of byConnection like this below:
{
"version": "4.0",
"datasetReference": {
"byPath": {
"workspaceObjectId": "<workspace id>",
"datasetObjectId": "<dataset id>"
}
}
}
Replace <workspace id> with the actual Workspace Id where the semantic model is deployed and <dataset id> with the semantic model’s guid.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa