Hi @Edgar
Do you want to output the result of that API call? You can refer to my sample code to print the results to the console:
using Azure.Identity;
using Microsoft.Graph;
using Newtonsoft.Json;
var scopes = new[] { "https://graph.microsoft.com/.default" };
var tenantId = "{tenant id}";
// Values from app registration
var clientId = "{client id}";
var clientSecret = "{client secret}";
// using Azure.Identity;
var options = new TokenCredentialOptions
{
AuthorityHost = AzureAuthorityHosts.AzurePublicCloud
};
// https://docs.microsoft.com/dotnet/api/azure.identity.clientsecretcredential
var clientSecretCredential = new ClientSecretCredential(
tenantId, clientId, clientSecret, options);
GraphServiceClient graphServiceClient = new GraphServiceClient(clientSecretCredential, scopes);
var result = await graphServiceClient.Users["{user id}"].JoinedTeams.GetAsync();
Console.WriteLine(JsonConvert.SerializeObject(result));
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.