Well, I've achieved authentication already. Now, as the next step, I want it to print a simple query. I know it's returning information, but I don't see the query data.
In Microsoft Graph, this is the query and the response.

The following code was created so that when I run it, it provides me with the same information as the device listing.
using System;
using System.Threading.Tasks;
using Azure.Identity;
using Microsoft.Graph;
namespace new_project
{
class Program
{
static async Task Main(string[] args)
{
string[] scopes = {"https://graph.microsoft.com/.default"};
// Values from app registration
var clientId = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
var tenantId = "xxxxxxxxxxxxxxxxxxxxxxx";
var clientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx";
// using Azure.Identity;
var options = new ClientSecretCredentialOptions
{
AuthorityHost = AzureAuthorityHosts.AzurePublicCloud,
};
var clientSecretCredential = new ClientSecretCredential(
tenantId, clientId, clientSecret, options);
var graphClient = new GraphServiceClient(clientSecretCredential, scopes);
var result = await graphClient.Devices.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Select = new string []{ "deviceId" };
});
Console.WriteLine(result);
}
}
}
PS C:\Users\cjch1\OneDrive\new_project> dotnet run
Microsoft.Graph.Models.DeviceCollectionResponse
What's wrong with my code or the query? The Azure application already has all the permissions.

thanks