Documentation Index
Fetch the complete documentation index at: https://mintlify.com/microsoftgraph/msgraph-sdk-dotnet/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheGraphServiceClient class is the main entry point for interacting with Microsoft Graph. It provides access to all Graph API resources through a fluent API and manages authentication, request execution, and resource initialization.
Constructor Overloads
Using TokenCredential
Azure.Core TokenCredential for authenticating requests (e.g., ClientSecretCredential, DefaultAzureCredential)
List of permission scopes. Defaults to
[".default"] if not specifiedBase service URL. Defaults to
https://graph.microsoft.com/v1.0Using IRequestAdapter
Custom request adapter for making HTTP requests
Base service URL. Overrides the adapter’s base URL if provided
Using HttpClient and TokenCredential
Custom HttpClient instance with middleware pipeline
TokenCredential for authentication
Permission scopes for authentication
Base service URL
Using IAuthenticationProvider
Custom authentication provider implementing IAuthenticationProvider
Base service URL
Properties
RequestAdapter
Batch
Resource Properties
The client exposes all Graph API resources as properties:Users- User management operationsGroups- Group management operationsApplications- Application registration managementServicePrincipals- Service principal managementDrives- OneDrive and SharePoint drive operationsSites- SharePoint site operationsTeams- Microsoft Teams operationsChats- Chat operationsMe- Operations for the signed-in user- And many more…
Code Examples
Basic Initialization with ClientSecretCredential
Using DefaultAzureCredential
Custom BaseUrl for Beta Endpoint
Using Custom HttpClient
Batch Requests
Disposal
IDisposable. Dispose when done to clean up resources:
See Also
Authentication Providers
Learn about authentication options
Users API
User management operations
Groups API
Group management operations
Batch Requests
Execute multiple requests efficiently
