Azure / azure-functions-openapi-extension

This extension provides an Azure Functions app with Open API capability for better discoverability to consuming parties
https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi/
MIT License
375 stars 196 forks source link

openApi is not reachable when calling from the azure #665

Open TonyWuAGL opened 3 months ago

TonyWuAGL commented 3 months ago

Describe the issue when I try to call the swagger endpoint no matter is RenderSwaggerUI or RenderSwaggerDocument is all return messages: "Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified." However is worked in the local environment. And been looking inside the code from function app, nowhere has been used Microsoft.VisualStudio.TestPlatform.ObjectModel

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Azure Function'
  2. Click on 'RenderSwaggerUI' under Functions
  3. Click on 'Get Function URL' under Functions and copy the URL from _master (Host key)
  4. See error

Expected behavior Show swagger ui page.

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

CNBoland commented 3 months ago

We ran into similiar issue. For us, the problem was that our deployment pipeline was publishing the entire VS solution to an output folder (no longer supported. check your build log far a related warning). This included unit tests and all their dependencies. We solved the problem by changing the pipeline to publish only the Function App project (e.g. dotnet publish .\FunctionApp1).

That you're seeing an assembly load error on something named *.TestPlatform.* in the deployed application is a tell that you may have the same problem we did.