azure-functions-openapi-extension icon indicating copy to clipboard operation
azure-functions-openapi-extension copied to clipboard

Cannot access the swagger ui or openAPI doc endpoints after setting Auth to Function level

Open StMarian opened this issue 3 years ago • 2 comments

Cannot access the swagger ui or openAPI doc endpoints after setting Auth to Function level If you set the open API auth level to anything other than Anonymous (User, Function, System or Admin), the swagger/ui and the openAPI doc endpoints become unaccessible.

To Reproduce Steps to reproduce the behavior:

  1. Create sample Azure function project: a. .NET 6.0 b. HTTP trigger with OpenAPI
  2. Publish it to the azure
  3. Add these settings on the Function App's Configuration page: image
  4. Browse https://<your-app>/api/swagger/ui?code=123 or https://<your-app>/api/swagger.json?code=123

Expected behavior You should see the desired page

Actual behavior Error 401 Screenshot_1

Environment

  • OS: Windows 11
  • Browser chrome
  • Version 1.3.0

StMarian avatar Aug 10 '22 12:08 StMarian

Seems to be related to #422

StMarian avatar Aug 12 '22 12:08 StMarian

as a workaround, you can set openapi functions' key via cli and use it instead of OpenApi__ApiKey

StMarian avatar Aug 12 '22 14:08 StMarian