Mount Microsoft OneDrive to Google Colab


Sun Apr 24 2022 13:33:43 GMT+0000 (Coordinated Universal Time)

Saved by @hasitha #colab #onedrive #rclone

#Run this from cmd.
$ rclone authorize "onedrive"

# Download & Install Latest Setup
!curl | sudo bash

# Authenticate One Drive
!rclone config

# Mount One Drive
#To stream files we need to mount One Drive.
!sudo mkdir /content/onedrive
!nohup rclone --vfs-cache-mode writes mount onedrive: /content/onedrive &

Microsoft OneDrive connection stops working after 1 hour when the access token expires. I eventually found a somewhat hacky solution. The refresh tokens from the python msal lib