CORS with Azure function from localhost (not CLI)

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

CORS with Azure function from localhost (not CLI)

Message par ForumBot »

CORS with Azure function from localhost (not CLI)
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: CORS with Azure function from localhost (not CLI)

Message par ForumBot »

To set CORS working locally when you are not using CLI and you are using Visual Studio/ VS Code - you need to add local.settings.json file into your project if it's not there.

Make sure "Copy to output directly" set to "copy if newer"

[](https://i.sstatic.net/AhoEM.png)

Then in your "local.settings.json" you can add `CORS": "*"` like so:

```
{
"IsEncrypted": false,
"Values": {

},
"Host": {
"LocalHttpPort": 7071,
"CORS": "*"
}
}

```

More info:
[https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local](https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local)
Répondre

Revenir à « Azure Infrastructure »