Azure / Azure/azure-functions-openapi-extension
Clarification openapi working with easy auth
- Dominant language
- C#
- Stars
- 388
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
Hello, I'm trying to setup a swagger document that describe my azure function apis to consume then via some power apps, **the function uses easy auth authentication**.
Since azure functions has a neat "Export to power automate, see below" capability, I decided to give it a go and here I'm reporting my findings.

First of all, if the function uses easy auth, we can't get access to the open api specification in the portal because it will most likely return 401.

Adding CORS solved nothing because as you can see from the network tab, easy auth return a 401 for the unauthorized request

So I decided to temporarily disable easy auth (which by the way takes two confirmations not sure why that's the case)
___
**Confirmation 1**

**Confirmation 2**

___
At this point I can finally choose my power platform environment, give a name at the custom api, choose a **security schema**

Since I'm using easy auth, I'm going to pick azure ad and start to fill in the details till wait.. the screen updates and now all of a sudden you have no option to choose any security scheme because my openapi definition doesn't define any as suggested [here](https://github.com/Azure/azure-functions-openapi-extension/blob/main/docs/openapi-auth.md#oauth2-easy-auth-flow)
This is the updated screen:

On top of that the creation fails with this error:

**So my question is**: Are these parts supposed to play nicely together? Because that's absolutely not the case at the moment :) Seems like these functionalities (which could be very handy to save some time) are fighting each other and the customer experience is something like: Did they test this before putting it live? :)
Contributor guide
Assessment
This issue has not been assessed yet.