-
Notifications
You must be signed in to change notification settings - Fork 195
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
Endpoints visible locally but not when deployed on azure #122
Comments
You want to set the AuthLevel to anonymous AND remove the OpenAPISecurity attribute. The other option is to pass the authkey in the url for SwaggerUI |
@kaluznyt Thanks for the issue! Would you please let us know how to repro the issue so that we can dig in, on our end? Based on the code snippet, I don't see any issue why it's not coming up on Azure when it's deployed. |
Thanks for inputs, I will try to reproduce it from scratch, however it might be specific to that project/function, will try to provide more info. Also, some months ago I had introduced the OpenAPI e through the AlienCube package, and there everything works fine (different function, but same azure environment). How are these related ? Is the official Microsoft package using AlienCube underneath or it's non related ? Meaning is it going to be recommended to migrate to the official one ? |
@spboyer I cannot make these functions anonymous (requirements), however, the examples on the github page (https://github.com/Azure/azure-functions-openapi-extension/blob/main/docs/openapi-core.md) are always using AuthLevel of Function. I might try with anonymous just to see if the functions are visible. |
I made the function anonymous and removed the open api security attribute, but it's still the same, will try with AlienCube package |
Not sure if I can help with debugging on what went wrong with the azure.openapi extension since I can see no logs indicating that something went wrong |
It's interesting. I just created a new Azure Functions project with Visual Studio 2019 16.10 preview 4 and deploy the function app to Azure and it works as expected. I had no changes made at all. Could you please deploy the basic (or default) Azure Functions app to Azure, with this extension and have a look? |
This is a successor of the Aliencube package, which will be archived soon. |
I'm having the same issue as well, locally it works perfect with all endpoints appearing. Deploying to Azure, I see the 'No operations defined in spec!' message. I'm noticing that the 'paths' node of swagger.json is empty on Azure, but has full details on my local machine. |
@brandonjpetersen Make sure that all four endpoints starting with Unfortunately, I can't reproduce this issue. Have you tried the sample app in this repo and seen the same symptom? |
To troubleshoot: Started a new project in Visual Studio Version 16.9.4.
With the initial template code, deployed through Azure Dev Ops to a Azure Function App. Everything worked perfectly, the Swagger Doc generated correctly for the basic 'Function1' HTTP Trigger. Then I made the adjustment to add 'Dependency Injection' and 'Entity Framework Core' to the solution. I added a Startup.cs file and the following Nuget packages:
The Azure Dev Ops deployment executed without any errors, but the Swagger Docs no longer generated. I'm now testing to see which part caused the issue. |
Test 1: Adding only the Nuget package (Microsoft.Azure.Functions.Extensions (1.1.0)) - Working Note: Each of the above works locally, but Test 3 doesn't work on Azure |
@brandonjpetersen - be sure to use Visual Studio 16.10 now available. |
Thanks everything is working now after recreating it with VS 16.10. I also had to downgrade EF Core to 3.1.13. |
I have the same issue, using Azure Functions core 3.1 project, with references to EF Core 3.1.14. Works fine locally, but empty when deployed to Azure. |
I can confirm this issue with no endpoints (Message: No operations defined in spec!) if deployed to azure but working fine locally. |
Only seems to be an issue deploying to azure via a pipeline. Manually publishing direct to azure seems to work fine. Changing to 0.5.1. resolved the pipelines problem for me. |
I'm facing this issue on |
I face the problem locally too when running via powershell by 'func host start'.. When running f5 from visual studio, swagger is populated correctly which means that it is somehow VS dependent which is definitely wrong.. This needs to be solved.. |
It's resolved, and @vincentbitter 's contribution has been merged to the main repo (not yet published). Would you please try the new change on your end and let us know? |
I have some strange issue, when adding the references, and some basic attributes to the function to see if that will work, everything is OK locally, but when deployed on Azure Function app there are no endpoints:
I tried to comment out the OpenApiSecurity attribute and no success.
Do you have any clue why the difference ? Does it matter that the function is running in ASE ?
This is what I See on Azure:
This is what I see locally on the same project:
The text was updated successfully, but these errors were encountered: