I have my Azure function which is running locally, I am looking for a way where I can set CORS in my local.
I went through the below Microsoft Documentation but couldn't able to achieve it.
I have my Azure function which is running locally, I am looking for a way where I can set CORS in my local.
I went through the below Microsoft Documentation but couldn't able to achieve it.
To Enable CORS in your function app running locally in your machine
open the local.settings.json
file (or create one if it doesn't exist. see) in your function app root folder.
Then add (or append) the following to allow all :
{
//Your other configs here
"Host": {
"CORS": "*"
}
}
Or if you have a specific URL & port you want to whitelist
{
//Your other configs here
"Host": {
"CORS": "http://localhost:12345"
}
}
To Enable CORS in your function app hosted in Azure :
Go to your function app instance via the azure portal, then click on the "CORS" left menu option under the API section.
You can configure CORS for your function app here.