Closed dr-dolittle closed 3 years ago
@dr-dolittle Thanks for the issue! Would you please provide more details on your AzFunc app instance details?
@justinyoo Linux, HTTPS only
@justinyoo Linux, HTTPS only
Thanks for confirming that. It's a known issue on the Linux instance. If you deploy it to the Windows instance, it won't happen. It's something we can't handle.
/cc @fabiocav @jeffhollan
@justinyoo What do you mean it is something you can't handle? Is it not possible to offer this as a configuration option or something like that?
It's not the issue on the extension side.
That only occurs on the Linux-based instance, which I suspect that the instance internally uses a reverse proxy or something similar to handle all the traffic in HTTP, not HTTPS.
Alternatively, as the UI script relies on https://github.com/swagger-api/swagger-ui, it's better to ask them for workaround. I have no visibility to the Swagger UI scripts.
But, let me take a look at this issue. I might have an idea how to fix this.
Can I join this problem?
@shlee7131 Alright. I'll assign this issue to you. As I've done some base work before you jumped on this issue, you can continue your contribution on the feature/force-https
branch.
In the branch, you'll see the new properties, ForceHttp
and ForceHttps
on the IOpenApiConfigurationOptions
interface.
With this property, find the AddServer(...)
method on both src/Microsoft.Azure.Functions.Worker.Extensions.OpenApi/Document.cs
and src/Microsoft.Azure.WebJobs.Extensions.OpenApi/Document.cs
.
Then, apply both ForceHttp
and ForceHttps
property values to the line I specified.
ForceHttp == false
and ForceHttps == false
then no changeForceHttp == true
and ForceHttps == false
then it SHOULD be HTTP
ForceHttp == false
and ForceHttps == true
then it SHOULD be HTTPS
ForceHttp == true
and ForceHttps == true
then it SHOULD be HTTPS
Please let me know if you have any question around this.
@dr-dolittle I reported this same issue, and found this work around:
https://github.com/Azure/Azure-Functions/issues/1933#issuecomment-889178952
Hope it helps.
@justinyoo The azure functions team punted this issue back to you.
Microsoft.Azure.WebJobs.Extensions.OpenApi v0.8.1-preview
The extension works locally when I make a request to https://somefunctionname.azurewebsites.net/swagger/ui. When I deploy the Azure Function to Azure https://somefunctionname.azurewebsites.net/swagger.json also works. But when I try https://somefunctionname.azurewebsites.net/swagger/ui I get
When I then update the Explore URI to https it works
Is this a bug or do I miss a setting to work with HTTPS on the first request?
Thanks