Forum Discussion
Reading file from onedrive
- 1 year ago
Hi msprog,
Thanks for reaching out to the Microsoft fabric community forum.
To address your issue -
Move the File to SharePoint or a Team’s OneDrive :SharePoint document libraries (which back Microsoft Teams and shared OneDrive locations) are not tied to an individual user account, so they remain available even if a team member leaves.
Steps:
Move the Excel/CSV file to a SharePoint Online document library (e.g., a Team site or a shared department folder).
In Power BI Desktop -Use “Get Data” - Web or SharePoint Folder option. Use the link to the file in SharePoint (make sure it is a direct or accessible path). Publish the report to Power BI Service. Set up scheduled refresh using OAuth2 with a service account or admin-managed account .
(Alternative Solution)
Use a Shared Service Account for OneDrive :
Keeps using OneDrive approach. Isolated from any individual user's employment status.Try To implement:
Create a generic OneDrive account, e.g - [email protected] (make sure it's a licensed Microsoft 365 user). Upload the data file to that account’s OneDrive. Share the file with yourself (and others, if needed). Update your Power BI report to use this new file path. When setting up refresh in the Power BI Service -
-
Sign in using that generic account for authentication to OneDrive
-
Use OAuth2 authentication, so that Power BI uses the token of the service account.
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Sreeteja.
Community Support Team -
Poojara_D12 v-sshirivolu i place the file in a sharepoint document library. I publish the report to the service. Now i login into the PBI service using my account. i need to configure the dataset to read the file. I don't see any option to configure a service account. Under oauth2, it just says signin - it uses the singed in account which is my personal account .
Secondly, if i use a service account, how do i ensure the service account has access to the file? please clarify
- v-sshirivolu1 year agoCommunity Support
Hi msprog
-
Ensure the service account has the necessary Microsoft 365 license (e.g., Power BI Pro if needed).
-
Share the SharePoint file (or folder) with the service account (e.g.,
[email protected]-
Open the SharePoint document library.
-
Click on the file or folder → "Share" → Invite the service account with View/Read access.
-
-
Log into Power BI Service using the service account (once):
-
This is just to establish credentials.
-
After login, go to the dataset settings → Data source credentials → Edit credentials.
-
Choose OAuth2 → Sign in, and use the service account to authenticate.
-
-
Once authorized, Power BI will use that token (service account) for refreshes — even if the report was published by another user.
- msprog1 year agoAdvocate III
Hello thanks for your support. But i tried the approach you are suggesting. when i login using the shared service account, it says that the semantic model is owned by the original user. isn't this an issue? if the original owner republishes the report or the model , will this still work?
- v-sshirivolu1 year agoCommunity Support
Hi msprog ,
If the semantic model (dataset) is originally published by a different user (not the service account), Power BI will consider that user as the owner of the dataset. This can lead to issues such as:
-
Access and refresh failures if the original owner leaves the organization or loses access.
-
OneDrive refresh not working as expected, since it relies on the identity and permissions of the publishing user.
-
Re-publishing by the original owner might rebind the dataset/report to their credentials, undoing the benefits of the shared service setup.
Recommended Approach:
To avoid these issues, follow this approach:
-
Re-publish the PBIX file using the service account:
-
Sign in to Power BI Desktop with the service account.
-
Open the PBIX file.
-
Save it to the service account's OneDrive location (or shared library if using SharePoint).
-
Publish to the workspace.
-
-
Rebind all related artifacts (reports, dashboards) to the newly published dataset.
-
Ensure the service account has the correct permissions on the OneDrive file or SharePoint location where the PBIX is stored.
Why this works:
This ensures that:
-
The dataset ownership lies with the service account.
-
Any refresh schedules, including OneDrive automatic refresh, work seamlessly.
-
There is no dependency on the original user, preventing disruption if they leave or make changes.
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Sreeteja.
Community Support Team -
-