Disable CORS middleware of Azure app service Disable CORS middleware of Azure app service azure azure

Disable CORS middleware of Azure app service


I don't think there is any extra setting to disable it explicitly from Azure App Service side. Microsoft itself recommend to use your CORS utilities instead of inbuilt one - Refer Here.

Note Provided by Doc -

Don't try to use App Service CORS and your own CORS code together. When used together, App Service CORS takes precedence and your own CORS code has no effect.


Try to check the deployed appsettings.json in the associated appservice using Kudu or command line. Might be the appsettings isn't being applied.

Associated App Service > Under the Development Tools > Advanced Tools (Kudu)

Associated App Service > Under the Development Tools > Console


My azure site is programmed in vb.net, but ultimately I had to do this and then it worked:

Dim strMethod As String strMethod = Request.HttpMethod.ToUpperIf InStr(strMethod, "OPTIONS") Then   Response.Flush()End If