After speaking with a Microsoft support specialist I found that my "Grant Type" within my Authorization settings in Postman were incorrect. I was using an Authorization Code, and I needed to use Client Credentials. My App Registration had Application permissions, not Delegated for the SharePoint permissions. So the call was not authorized to return SharePoint lists until I switched to the Client Credential Grant Type.
Also, anyone trying to do this in an Azure Function with the Graph Client SDK, you will need to use a Custom HTTP Client.
// using environment variables in local.settings.json for auth
var tenantId = Environment.GetEnvironmentVariable("AzureADAppTenantId");
var clientSecret = Environment.GetEnvironmentVariable("AzureADAppSecret");
var clientId = Environment.GetEnvironmentVariable("AzureADAppClientId");
// need to pass in a null auth provider so SDK uses token in header
IAuthenticationProvider authenticationProvider = null;
// create the http client using null provider
var client = GraphClientFactory.Create(authenticationProvider, "v1.0", GraphClientFactory.USGOV_Cloud);
// set the scope for the client calls
var scope = "https://graph.microsoft.us/v1.0/";
// create the scopes for us domain
List<string> scopes = new List<string>() { "https://graph.microsoft.us/.default" };
// create the client app
IConfidentialClientApplication app = ConfidentialClientApplicationBuilder.Create(clientId)
.WithClientSecret(clientSecret)
.WithTenantId(tenantId)
.WithAuthority("https://login.microsoftonline.us/" + tenantId)
.Build();
// wait for the token
AuthenticationResult authenticationResult = await app.AcquireTokenForClient(scopes).ExecuteAsync();
// set the token
var token = authenticationResult.AccessToken;
// add the auth headers to the client
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
// initialize the graph client
var graphClient = new GraphServiceClient(client, scope);
// now get the drives
var drives = await graphClient.Sites[siteId].Drives.Request().GetAsync();