Configure CORS for Azure Functions Local Host
Another easy way to configure CORS on Azure Functions is to use Azure Portal,
1- Go to the Function App Settings in Azure Portal
2 - Click on CORS and add your local host url
And there you have it!!
Hope this helps someone.
You can configure CORS in the local settings file local.settings.json
:
{
"Values": {
},
"Host": {
"CORS": "*"
}
}
Settings in the
local.settings.json
file are used only when you're running projects locally
You can start the host like this
func host start --cors *
You can also be more specific and provide a comma delimited list of allowed urls
More here: https://github.com/Azure/azure-webjobs-sdk-script/issues/1012