How to setup Azure to access OneDrive via application permissions

Karl Richard Richter 0 Reputation points
2024-04-21T12:45:10.21+00:00

Hello!
I am reaching out, because I can't figure out, how to access OneDrive API.
My goal is to have a Python script, that upon execution uploads a file to a personal OneDrive folder. However, I can't get it to work without the delegated flow.
I tried an Azure App with both, certificate and client_secret, with both of them I get an access_token from https://graph.microsoft.com/.default. But I can't use said token to connect to the OneDrive of my tenant_id. For example I get errors like: 400 - {"error":{"code":"BadRequest","message":"Unable to retrieve tenant service info.".
It may just be an endpoint problem, but it can also be because, I didn't configure Azure right.

I am very new to all off the Microsoft authentication stuff and simply said, I just want a Python script to automatically upload a file, without me having to sign in. I tried for many days at this point and cannot find my error.

Thanks for the replies!

OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
829 questions
0 comments No comments
{count} votes