0

I have some files in my personal OneDrive account. I want to access some of these files with Python, make some updates & then upload back to OneDrive.

I have seen a few examples on here & some other sites, which seem to make sense. My question though is in order to download files & upload files to OneDrive programmatically whether I need a Azure account? My understanding is that I need this for the authentication part. I would happily create an Azure account however I see you have to pay. There is a free 12 month option but for what I would like to do, 12 months is not long enough.

mHelpMe
  • 6,336
  • 24
  • 75
  • 150
  • 1
    Have you tried with `Delegated permission(personal Microsoft account)` of [Microsoft Graph REST AP](https://learn.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http#permissions)? References: [OneDrive API and Azure Active Directory setup to upload as personal account](https://stackoverflow.com/questions/66787193/onedrive-api-and-azure-active-directory-setup-to-upload-as-personal-account?rq=1) and [Download files from personal OneDrive using Python](https://stackoverflow.com/questions/58171733/download-files-from-personal-onedrive-using-python) – Ecstasy Apr 06 '22 at 10:12
  • 1
    **I think you will still need an Azure account as MS Graph uses AAD.** "Microsoft Graph uses Azure Active Directory to authenticate accounts and authorize applications. Using the v2.0 endpoint your application can sign in consumer users with Microsoft accounts and work/school users with Azure Active Directory accounts with a single authentication flow. " Reference: [Authorizing your app to access OneDrive](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/authentication?view=odsp-graph-online#microsoft-graph-onedrive-and-sharepoint-online) – Ecstasy Apr 06 '22 at 10:36
  • 1
    @DeepDave-MT thanks for the above, just going through the links now & will check delegated permissions. Tend to agree though looks like I will need to get an Azure account and pay unless I can find another cloud provider – mHelpMe Apr 06 '22 at 11:17

1 Answers1

0

My question though is in order to download files & upload files to OneDrive programmatically whether I need a Azure account?

Azure account is not mandatory when you need to access and read/write files from OneDrive.

With python-onedrive module, you can access personal OneDrive account.

To install, run: pip install python-onedrive

Refer this OneDrive SDK for Python GitHub repository to implement the same.

Utkarsh Pal
  • 4,079
  • 1
  • 5
  • 14