Forum Discussion
Reading file from onedrive
- Anonymous1 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 -
Hi msprog
You're absolutely right to be concerned—if your Power BI report reads data from your personal OneDrive (associated with your user account), that connection will break once your account is disabled (e.g., if you leave the organization), because OneDrive access is tied to your individual identity. The best practice in this scenario is to avoid using personal or individual OneDrive accounts for shared or organizational reports. Instead, the recommended solution is to store the file in a SharePoint Online Document Library (which is part of Microsoft 365 and can be backed by Teams or a shared SharePoint site). Power BI supports connecting directly to SharePoint folders, and files placed there are not tied to an individual user’s lifecycle. Alternatively, if your organization prefers OneDrive, you can request your IT department to create a shared or generic service account with a OneDrive or SharePoint license. This account should be managed like a service identity, with access delegated appropriately. The file would then reside in that account’s storage, and the Power BI dataset would connect to it using that service account's credentials. Make sure to set up a Power BI gateway or OAuth credentials accordingly in the Power BI Service. This ensures continuity of access and minimizes risk due to personnel changes, making your report architecture more sustainable and enterprise-compliant.