You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import asyncio
from azure.identity import ClientSecretCredential
from msgraph import GraphServiceClient
# Create a credential object. Used to authenticate requests
credential = ClientSecretCredential(
tenant_id='TENANT_ID',
client_id='CLIENT_ID',
client_secret='CLIENT_SECRET'
)
scopes = ['https://graph.microsoft.com/.default']
# Create an API client with the credentials and scopes.
client = GraphServiceClient(credentials=credential, scopes=scopes)
1. LIST ALL DRIVES (GET /drives)
async def get_drives():
drives = await client.drives.get()
if drives and drives.value:
for drive in drives.value:
print(drive.id, drive.drive_type, drive.name, drive.description, drive.web_url)
asyncio.run(get_drives())