CORS with Azure function from localhost (not CLI)

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

CORS with Azure function from localhost (not CLI)

Message par Clippy »

CORS with Azure function from localhost (not CLI)
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

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

Message par Clippy »

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 »