Forum Discussion

msprog's avatar
msprog
Advocate III
1 year ago
Solved

Reading file from onedrive

I am working on PowerBI. I have a report that reads a file from my onedrive account. Now the concern raised is what will happen if i leave the organisation- my one drive account will be disabled. So ...
  • v-sshirivolu's avatar
    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