You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The X-Forwarded-Host header provided by Azure Front Door is missing in a fresh new function in dotnet 8 isolated.
Is working fine in dotnet 6 in-process but stops working when migrating to 8 isolated.
Investigative information
Please provide the following:
Timestamp:
Function App version: 4
Function App name:
Function name(s) (as appropriate):
Invocation ID:
Region: France Central
Repro steps
create an Azure Function in dotnet 8 isolated
in a function testforwardheader, output the value of the header X-Forwarded-Host req.Headers.TryGetValue("X-Forwarded-Host", out StringValues value)
publish the function behind a Front Door with redirect rules to this app from the url subdomain.myfrontdoordomain.com/myfunction.
call the function using subdomain.myfrontdoordomain.com/myfunction/api/testforwardheader
Expected behavior
in step 4 you should get the host requested by client, so subdomain.myfrontdoordomain.com
Actual behavior
in step 4 you get an empty string
Known workarounds
Someone found a workaround. They were able to find and restore the value from the bindingContext.BindingData using custom middleware.
I know that the Front Door will send X-Forwarded-Host and X-Forwarded-Proto which we were able to use with the older Swashbuckle library which we used for In-Process Function Apps.
The text was updated successfully, but these errors were encountered:
@paulverbeke are you using the ASP.NET Core integration for your tests? In the HTTP proxying mode, all headers should be forwarded and will be processed by the worker.
@fabiocav thanks for getting back quickly. Yes we are using ASP.NET Core integration. But I couldn't find anything online regarding "HTTP proxying mode". Is there something I need to enable or specify somewhere ?
EDIT: I just tested the starting Azure Functions template without ASP.NET Core integration (with HttpRequestData/HttpResponseData) and the header is available.
Is it expected behavior that ASP.NET Core integration is causing header to be dropped ? If so why the default Visual Studio template is showing an example function with ASP.NET Core integration without this drawback be documented somewhere ?
The X-Forwarded-Host header provided by Azure Front Door is missing in a fresh new function in dotnet 8 isolated.
Is working fine in dotnet 6 in-process but stops working when migrating to 8 isolated.
Investigative information
Please provide the following:
Repro steps
testforwardheader
, output the value of the header X-Forwarded-Hostreq.Headers.TryGetValue("X-Forwarded-Host", out StringValues value)
subdomain.myfrontdoordomain.com/myfunction
.subdomain.myfrontdoordomain.com/myfunction/api/testforwardheader
Expected behavior
in step 4 you should get the host requested by client, so
subdomain.myfrontdoordomain.com
Actual behavior
in step 4 you get an empty string
Known workarounds
Someone found a workaround. They were able to find and restore the value from the bindingContext.BindingData using custom middleware.
Workaround
Related information
written in C#
Someone else had this problem
The text was updated successfully, but these errors were encountered: