Search code examples
jenkinsonedrive

Is there any way to store or update a file to One-drive after Jenkins build run?


Is there any way to store or update a CSV file to One-drive after Jenkins build run? I want it to happen without any third-party plugin.


Solution

  • You can do this using OneDrive API and curl, e.g.:

    curl https://graph.microsoft.com/v1.0/me/drive/root:/data.csv:/content -X PUT -d @data.csv -H "Authorization: bearer access_token_here"
    

    One limitation is that your csv file couldn't be more than 4MB.