Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not supporting Microsoft.Azure.Functions.Worker.Sdk version 1.16.0 #625

Open
Strandfelt opened this issue Nov 8, 2023 · 10 comments
Open

Comments

@Strandfelt
Copy link

Strandfelt commented Nov 8, 2023

Describe the issue
When upgrading the Microsoft.Azure.Functions.Worker.Sdk package to 1.16.0 which was released on November 7, the Open API is not able to generate if there are HTTP triggers.

It is worth to note that in a vanilla function project with NO triggers, the documents will actually be rendered, but when you add an HTTP triggered function to the project, the Open API endpoints will vanish.

To Reproduce
Steps to reproduce the behavior:

  1. Create vanilla dotnet-isolated Azure Function referencing Microsoft.Azure.Functions.Worker.Sdk 1.15.1 without any Functions
    • E.g. func init MyOpenApiFunctionApp --worker-runtime dotnetIsolated --target-framework net7.0
  2. Add Microsoft.Azure.Functions.Worker.Extensions.OpenApi 1.5.1
  3. See that Open API documents are generated (with no Function routes)
  4. Upgrade Microsoft.Azure.Functions.Worker.Sdk to 1.16.0
  5. See that Open API documents are generated (with no Function routes)
  6. Add an HTTP triggered function with Open API attributes
  7. See that Open API documents are no longer generated
  8. Downgrade Microsoft.Azure.Functions.Worker.Sdk to 1.15.1
  9. See that Open API documents are generated again (now with Function routes)

Expected behavior
Open API documents are generated for a Functions project referencing Microsoft.Azure.Functions.Worker.Sdk package to 1.16.0 when there are triggers in the project

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

  • TargetFramework: net7.0
  • AzureFunctionsVersion: v4
  • OS: Windows
@nserpen
Copy link

nserpen commented Nov 9, 2023

This issue also exists in net6.0. Spend couple of hours to fix and find out what I did wrong. It happens exactly as in the above description.

@Bitguru72
Copy link

Bitguru72 commented Nov 9, 2023

I can confirm the same issue in 1.16.0, and as well in 1.16.1. Rolling back to 1.15.1 solves the issue and the http trigger endpoints for OpenAPI reappears. On .net7 and v4 and Windows. All other nugets on latest versions.

@Bitguru72
Copy link

So, I've discovered more details about the issue. Since the referenced assembly, that holds the OpenAPI, contains the function http triggers and the old behaviour of the Microsoft.Azure.Functions.Worker.Sdk was to scan ALL assemblies for functions, internal or public, and register them it worked fine.
I have my own set of nugets, that contain internal function triggers (timers). They also dissappear with the 1.16.0 SDK. So, the issue has nothing to do with the http or OpenAPI, but seems to be a change in scanning/discovery of triggers in other assemblies than the "main assembly".

@NFMynster
Copy link

Can also confirm the issue with Microsoft.Azure.Functions.Worker.Sdk 1.16.x where 1.15.1 works.

@Revnixcad
Copy link

irm the issue with Microsoft.Azure.Functions.Worker.Sdk 1.16.x where 1.15.1 works.

For me this is also the case

@LukeMcHaleJones-Jacobs
Copy link

Just ran into this. Can confirm also - have had to downgrade to 1.15.1. Well done for opening this @Strandfelt.

@kshyju
Copy link
Member

kshyju commented Nov 13, 2023

Please see Azure/azure-functions-dotnet-worker#2052 (comment)

@Revnixcad
Copy link

Please see Azure/azure-functions-dotnet-worker#2052 (comment)

Yes this release works for me, thank you for the fast implementation of the solution.

@nserpen
Copy link

nserpen commented Nov 14, 2023

Yes, 1.16.2 release solves the problem. Thank you.

@verdantburrito
Copy link

This issue should be closed, since it's a problem that doesn't originate in this repo's code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants