azure-functions-host icon indicating copy to clipboard operation
azure-functions-host copied to clipboard

Support for configuring CORS, SupportCredentials using host.json

Open balag0 opened this issue 6 years ago • 5 comments

Once we have the CORS middleware available in functions host, in addition to site config this will be another way to configure CORS headers.

balag0 avatar Sep 09 '19 22:09 balag0

Not sure if this is related, but can someone point me to some documentation on how I can configure CORS when using Azure Functions on Linux running in a Kubernetes cluster as I can't seem to find anything to help me. I'm guessing I need to be able to configure from host.json as local.settings.json is ignored when running in a container?

ianadavies avatar Nov 30 '20 19:11 ianadavies

++ @fabiocav @ahmelsayed Yes, the proposal is for the settings to be configured using host.json. But this is not supported yet.

balag0 avatar Nov 30 '20 20:11 balag0

Hi @balag0

I am interested in this solution. has it been implemented? Where can I find documentation on what I need to add to host.json?

I have added this and it does not seem to work:

`

"extensions":{ "http":{ "routePrefix":"api", "customHeaders":{ "Access-Control-Allow-Origin":"*", "Access-Control-Allow-Headers": "X-Requested-With,content-type", "Access-Control-Allow-Methods":"GET, POST" } } } `

RenSilvaAU avatar Jan 11 '22 23:01 RenSilvaAU

the mechanism to configure via host.json doesn't exist today. Adding @fabiocav for inputs/planning.

balag0 avatar Jan 11 '22 23:01 balag0

Not sure if this is related, but can someone point me to some documentation on how I can configure CORS when using Azure Functions on Linux running in a Kubernetes cluster as I can't seem to find anything to help me. I'm guessing I need to be able to configure from host.json as local.settings.json is ignored when running in a container?

@ianadavies did you resolve this issue? This is the exact scenario where I'm stuck and don't seem to find anything helpful.

santanukumardas avatar Oct 12 '22 08:10 santanukumardas