{"record":{"id":"73148af6a3655936","repo":"microsoft/semantic-kernel","slug":"missing-scopes-configuration-for-microsoft-graph-a","errorCode":null,"errorMessage":"Missing Scopes configuration for Microsoft Graph API.","messagePattern":"Missing Scopes configuration for Microsoft Graph API\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"dotnet/samples/Concepts/Plugins/ApiManifestBasedPlugins.cs","lineNumber":110,"sourceCode":"        Console.WriteLine($\"\\nResult:\\n{result}\\n\");\n        Console.WriteLine(\"--------------------\");\n    }\n\n    private void WriteSampleHeadingToConsole(string pluginToTest, string functionToTest, KernelArguments? arguments, params string[] pluginsToLoad)\n    {\n        Console.WriteLine();\n        Console.WriteLine(\"======== [ApiManifest Plugins Sample] ========\");\n        Console.WriteLine($\"======== Loading Plugins: {string.Join(\" \", pluginsToLoad)} ========\");\n        Console.WriteLine($\"======== Calling Plugin Function: {pluginToTest}.{functionToTest} with parameters {arguments?.Select(x => x.Key + \" = \" + x.Value).Aggregate((x, y) => x + \", \" + y)} ========\");\n        Console.WriteLine();\n    }\n\n    private async Task AddApiManifestPluginsAsync(Kernel kernel, params string[] pluginNames)\n    {\n#pragma warning disable SKEXP0050\n        if (TestConfiguration.MSGraph.Scopes is null)\n        {\n            throw new InvalidOperationException(\"Missing Scopes configuration for Microsoft Graph API.\");\n        }\n\n        LocalUserMSALCredentialManager credentialManager = await LocalUserMSALCredentialManager.CreateAsync().ConfigureAwait(false);\n\n        var token = await credentialManager.GetTokenAsync(\n                        TestConfiguration.MSGraph.ClientId,\n                        TestConfiguration.MSGraph.TenantId,\n                        TestConfiguration.MSGraph.Scopes.ToArray(),\n                        TestConfiguration.MSGraph.RedirectUri).ConfigureAwait(false);\n#pragma warning restore SKEXP0050\n\n        BearerAuthenticationProviderWithCancellationToken authenticationProvider = new(() => Task.FromResult(token));\n#pragma warning disable SKEXP0040\n\n        // Microsoft Graph API execution parameters\n        var graphOpenApiFunctionExecutionParameters = new OpenApiFunctionExecutionParameters(\n            authCallback: authenticationProvider.AuthenticateRequestAsync,\n            serverUrlOverride: new Uri(\"https://graph.microsoft.com/v1.0\"),","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/samples/Concepts/Plugins/ApiManifestBasedPlugins.cs#L92-L128","documentation":"Error \"Missing Scopes configuration for Microsoft Graph API.\" thrown in microsoft/semantic-kernel.","triggerScenarios":"Thrown at dotnet/samples/Concepts/Plugins/ApiManifestBasedPlugins.cs:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a 'Scopes' entry to the Microsoft Graph API configuration section of the API manifest (e.g. 'User.Read') so the plugin can request the required permissions.","Verify the ApiManifest file referenced by the plugin includes the scopes array for the Microsoft Graph resource."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}