TeamsFx.CreateMicrosoftGraphClient Method

Definition

Overloads

CreateMicrosoftGraphClient(TokenCredential, String, ILogger<MsGraphAuthProvider>)

Get Microsoft graph client.

CreateMicrosoftGraphClient(TokenCredential, String[], ILogger<MsGraphAuthProvider>)

Get Microsoft graph client.

CreateMicrosoftGraphClient(TokenCredential, String, ILogger<MsGraphAuthProvider>)

Get Microsoft graph client.

public Microsoft.Graph.GraphServiceClient CreateMicrosoftGraphClient (Azure.Core.TokenCredential credential, string scopes = ".default", Microsoft.Extensions.Logging.ILogger<Microsoft.TeamsFx.MsGraphAuthProvider> logger = default);
member this.CreateMicrosoftGraphClient : Azure.Core.TokenCredential * string * Microsoft.Extensions.Logging.ILogger<Microsoft.TeamsFx.MsGraphAuthProvider> -> Microsoft.Graph.GraphServiceClient
Public Function CreateMicrosoftGraphClient (credential As TokenCredential, Optional scopes As String = ".default", Optional logger As ILogger(Of MsGraphAuthProvider) = Nothing) As GraphServiceClient

Parameters

credential
TokenCredential

Token credential instance.

scopes
String

The string of Microsoft Token scopes of access separated by space. Default value is .default.

logger
ILogger<MsGraphAuthProvider>

Logger of MsGraphAuthProvider class. If the value is null, it will use the logger constructed by DI during TeamsFx class initialization.

Returns

Microsoft.Graph.GraphServiceClient

Graph client with specified scopes.

Applies to

CreateMicrosoftGraphClient(TokenCredential, String[], ILogger<MsGraphAuthProvider>)

Get Microsoft graph client.

public Microsoft.Graph.GraphServiceClient CreateMicrosoftGraphClient (Azure.Core.TokenCredential credential, string[] scopes, Microsoft.Extensions.Logging.ILogger<Microsoft.TeamsFx.MsGraphAuthProvider> logger = default);
member this.CreateMicrosoftGraphClient : Azure.Core.TokenCredential * string[] * Microsoft.Extensions.Logging.ILogger<Microsoft.TeamsFx.MsGraphAuthProvider> -> Microsoft.Graph.GraphServiceClient
Public Function CreateMicrosoftGraphClient (credential As TokenCredential, scopes As String(), Optional logger As ILogger(Of MsGraphAuthProvider) = Nothing) As GraphServiceClient

Parameters

credential
TokenCredential

Token credential instance.

scopes
String[]

The array of Microsoft Token scopes of access. Default value is [.default].

logger
ILogger<MsGraphAuthProvider>

Logger of MsGraphAuthProvider class. If the value is null, it will use the logger constructed by DI during TeamsFx class initialization.

Returns

Microsoft.Graph.GraphServiceClient

Graph client with specified scopes.

Applies to