question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft.Graph `GraphServiceClient` initialisation results in No operations defined in spec!

See original GitHub issue

Describe the issue Initialising Microsoft.Graph GraphServiceClient anywhere in a function app that uses OpenAPI results in No operations defined in spec!

To Reproduce Steps to reproduce the behavior:

  1. Create a new Function App v4 .net 6, with an HttpTrigger with OpenAPI extension
  2. Install Microsoft.Graph v4.21.0 (You may also need Azure.Identity v1.5.0 if you plan to make a working example)
  3. Start function app
  4. Notice that the swagger UI and swagger JSON has no operations

Expected behavior Operations should be listed as per normal

Example code:

ClientSecretCredential credential = new ClientSecretCredential(
                    tenantId,
                    clientId,
                    clientSecret,
                    new TokenCredentialOptions
                    {
                        AuthorityHost = AzureAuthorityHosts.AzurePublicCloud
                    });
            string[] scopes = new[] { "https://graph.microsoft.com/.default" };

            graphClient = new GraphServiceClient(credential, scopes);

commenting out the final line solves the issue. It seems that somehow GraphServiceClient’s constructor disturbs something on the OpenAPI side.

Environment (please complete the following information, if applicable):

  • Version: Microsoft.Azure.WebJobs.Extensions.OpenApi 1.2.0

Additional context I am writing a function app to manage B2C users via the GraphAPI. I’m using OpenAPI to maintain and share the documentation.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
justinyoocommented, Mar 29, 2022

It was #381 and #387

0reactions
KholofeloMoyabacommented, Mar 29, 2022

Yes, there’s the change log in the release-notes directory.

None of the PR reference this issue. So I can’t really tell what this issue was. But it’s really out of interest now, I’ll dig around the PRs and try and see. Thank you once again for the help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swashbuckle.AspNetCore: 'No operations defined in spec! ...
In short: i needed to change my HOST project SDK: from 'Microsoft.NET. ... i did not find explicitly is it should be like...
Read more >
Microsoft Graph Known Issues
This error is due to intermittent license check failures, which we are working to fix. As a temporary workaround, add the Directory.
Read more >
Swagger docs "No operations defined in spec!" : r/node
Hello all, I have set up a Fastify project and I want to use Swagger to document the endpoints, however, I get the...
Read more >
Microsoft Teams – Markus Moeller's SharePoint Blog
The first thing is an EditForm bound to a Class representing the Offer object. All the field controls are then bound to a...
Read more >
An introduction to Microsoft Graph for developers
Improve your application's interactions with Microsoft Graph, without adding complexity • Designed to simplify building high- quality, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found