# docker-compose.yml
version: "3.9"
services:
onedrive_exporter:
image: ghcr.io/andrzejressel/onedrive-exporter:VERSION
environment:
- ONEDRIVE_CLIENT_ID=CLIENT_ID
- ONEDRIVE_REDIRECT=http://localhost:8080/
- ONEDRIVE_CLIENT_SECRET=CLIENT_SECRET
volumes:
- onedrivedata:/data
ports:
- "8080:8080"
# prometheus.yaml
- job_name: 'onedrive'
metrics_path: /q/metrics
static_configs:
- targets: ['localhost:8080']
- Open https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade and then click
New registration
. - Enter a name for your app, choose account type
Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)
, selectWeb
inRedirect URI
, then type (be careful when copying and pasting)http://localhost:8080/onedrive
(or your custom url where collector will be available +/onedrive
suffix) and click Register. Copy and keep theApplication (client) ID
- this is yourCLIENT_ID
. - Under
manage
selectCertificates & secrets
, clickNew client secret
. Enter a description (can be anything) and setExpires
to 24 months. Copy and keep that secret Value - this is yourCLIENT_SECRET
. - Under
manage
selectAPI permissions
, clickAdd a permission
and selectMicrosoft Graph
then selectdelegated permissions
. - Search and select the following permissions:
Files.Read
,offline_access
andUser.Read
. Once selected clickAdd permissions
at the bottom.
- It does not work with GraalVM. It may in the future - Azure/azure-sdk-for-java#21735