Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone,
I’m exploring options for importing a Power BI report from one workspace to another or from One-drive Path to a workspace using the REST API. Has anyone tried this before? If so, could you share your experience, steps, or any challenges you faced during the process?
I've tried importing pbix from one-drive with rest API - POST "https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports?datasetDisplayName={datasetDisplayName}" but One-drive path isn't supported with this one.
Any guidance or insights would be greatly appreciated!
Thank you in advance.
Solved! Go to Solution.
The Power BI REST API does not support directly importing a .pbix file from a OneDrive path. To import a report into a workspace, you need to upload the .pbix file using the REST API endpoint POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports, providing the file as binary content in the request. If the file is on OneDrive, you can use the Microsoft Graph API to programmatically download it (via GET /me/drive/root:/path/to/file.pbix:/content) and pass it as a stream to the Power BI API. Ensure you have the necessary permissions (Dataset.ReadWrite.All for Power BI and Files.ReadWrite for OneDrive). Note that the file must be under 1 GB, and you can handle conflicts with the nameConflict parameter. Combining these APIs enables automating report uploads effectively.
The Power BI REST API does not support directly importing a .pbix file from a OneDrive path. To import a report into a workspace, you need to upload the .pbix file using the REST API endpoint POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports, providing the file as binary content in the request. If the file is on OneDrive, you can use the Microsoft Graph API to programmatically download it (via GET /me/drive/root:/path/to/file.pbix:/content) and pass it as a stream to the Power BI API. Ensure you have the necessary permissions (Dataset.ReadWrite.All for Power BI and Files.ReadWrite for OneDrive). Note that the file must be under 1 GB, and you can handle conflicts with the nameConflict parameter. Combining these APIs enables automating report uploads effectively.
@Poojara_D12 , Thanks for the reply
Can you share more details on how can I pass the file as binary content?
Can you please dm so that it can be easy to understand and solve it.